-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error during parsing #207
Comments
Hi @vickysharma0812 could you provide a Minimal Working Example so that the issue can be replicated? |
Hello @gnikit Please find the attached directory. fls_vikas_issue.zip |
@gnikit I want to ask whether FLS supports SUBMODULE feature of Modern Fortran? Regards |
So both the fortran language server and the Modern Fortran extension support submodules, as far as I know at least. On a separate matter,
This is most definitely a bug which is triggered by using a space character between the base module's name and the right parenthesis in the submodule definition i.e. This breakssubmodule(baseModule ) submodule1 This workssubmodule(baseModule) submodule1 |
Yes, your are right here. I face no problem with Modern Fortran extension. I don't know much about FLS.
The process of compiling the code is given below. Step-1: Compile gfortran -c foo_module.F90 ├── call_foo.F90
├── foo_module.F90
├── foo_module.mod <--------
├── foo_module.o <------
├── foo_module.smod <-------
├── foo_module@submodule1.F90
├── foo_module_submodule2.F90
└── Screenshot from 2021-10-02 23-07-24.pngfg Step-2: Compile submodules, it will create gfortran -c foo_module@submodule1.F90
gfortran -c foo_module_submodule2.F90 Output: ├── call_foo.F90
├── foo_module.F90
├── foo_module.mod
├── foo_module.o
├── foo_module.smod
├── foo_module@submodule1.F90
├── foo_module@submodule1.o <---------------
├── foo_module@submodule1.smod <--------------
├── foo_module_submodule2.F90
├── foo_module@submodule2.smod <--------------
├── foo_module_submodule2.o <--------------
└── Screenshot from 2021-10-02 23-07-24.png Step:3 compile gfortran -c call_foo.F90 -I. Output .
├── call_foo.F90
├── call_foo.o <-----------
├── foo_module@display.smod
├── foo_module.F90
├── foo_module.mod
├── foo_module.o
├── foo_module.smod
├── foo_module@submodule1.F90
├── foo_module@submodule1.o
├── foo_module@submodule1.smod
├── foo_module_submodule2.F90
├── foo_module_submodule2.o
└── Screenshot from 2021-10-02 23-07-24.png Linking: gfortran -o test.out call_foo.o foo_module@submodule1.o foo_module_submodule2.o foo_module.o Executing: ./test.out Output testing :: hello::world
testing :: hello::world |
@gnikit thank you for responding.
In my project I keep the header definition in modules and implementations in submodules.
Regards |
@vickysharma0812 did you try removing the trailing whitespace between the base module |
I am not sure what I was doing last night and I couldn't compile your MWE, thanks for the instructions all seems to work on my end. Try the fix I mentioned, for the time being at least. I will have a look when I get some time. BTW as a general note you mind want to incorporate a formatter into your workflow |
@gnikit I have installed Can I ask what do they do? Regards |
They are formatters, so they make your code easier to read and look pretty findent and fprettify you only need one of the too. I simply mentioned them because the bug you stumbled upon was due to formatting. |
@gnikit Thanks, I have uninstall findent, and kept only fprettify. |
The regex for submodule parent names was too greedy only matching patterns at the start of the string.
@vickysharma0812 I have gone ahead and issued a fix for this under a dev version of fortls. |
@gnikit: It seems you are frequently updating fortls on your side. Is there any chance that you are gonna release your own version over python? I guess you tried to communicate with hansec to merge your development? Sry for beeing offtopic. |
Hi @JHenneberg, I tried contacting hansec to update this repo instead of making a fork but I suspect that he is extremely busy with work that's why I went ahead and released the dev version of fortls under the name Given that it has been a while since all of this happened and a lot of changes have occured in the codebase, the fork has now diverged substantially from the main fortran-language-server repository which means it is unlikely I will be opening another PR in future to incorporate the changes from dev to master. |
@gnikit I see. Great I will give your version a try. Overlooked the install instruction probably. Thanks for your effort. |
Thank you very much for FLS and its support in VS Code.
I am using FLS-v1.12.0
I use Fortran module in my project.
If the name of the module is
IntVector_Method.F90
Then the name of submodules are
IntVector_Method@submodule1.F90
,IntVector_Method@submodule2.F90
, and so on.I receive following error from FLS.
How can remove this error?
Regards
Vikas
The text was updated successfully, but these errors were encountered: