Closed syf1913 closed 3 years ago
how are you using fortls
as in through VS Code
, Atom
, vim
...? I don't use coarrays so you might have to provide a MWE if you want us to replicate the error
Thank you for your reply!
In VS code
, but I don't think it's coarrays, it's just arrays defined in old FORTRAN 77-style
.
This is not related to fortls
but with the input options of the VSCode extension. What is probably happening is your linter is complaining that it does not know how to mock-compile your code. If you are using the Modern Fortran extension then you need to input the relevant coarray arguments that you use during compilation as part of your linter extra arguments. For more help please close this issue and migrate it to https://github.com/krvajal/vscode-fortran-support/issues
FYI the only errors fortls
is capable of displaying in VSCode (or anywhere I think) are:
Multiple definitions with the same variable name Variable definition masks definition from parent scope Missing subroutine/function arguments Unknown user-defined type used in "TYPE"/"CLASS" definition (only if visible in project) Unclosed blocks/scopes Invalid scope nesting Unknown modules in "USE" statement Unimplemented deferred type-bound procedures Use of unimported variables/objects in interface blocks Statement placement errors ("CONTAINS", "IMPLICIT", "IMPORT")
The rest is done by the VSCode extension through a -fsyntax-only
call to gfortran
@syf1913 sorry I completely missed the
I don't think it's coarrays
part of your answer. If you are still having problems please move the issue to the extension repo.
ok, I see, thank you very much for your patience to answer my questions. I will figure it out .
Thanks again!
have you solved this problem?
This is a linter error i.e. from VS Code's Modern Fortran (or whatever editor and linter you are using) not fortls
. Either way, the problem is unrelated to this repo (fortran-language-server
)
Thank you for your reply! but I used gfortran in Ubuntu and found the same problem. I can't solve this problem o(╥﹏╥)o.
I think you are going in the wrong direction on this issue. From your picture, I think it's your code that has a problem, not fortran-language-server
Thank you for your reply! but I used gfortran in Ubuntu and found the same problem. I can't solve this problem o(╥﹏╥)o.
First search result will land you on this SO post: https://stackoverflow.com/questions/67545509/coarrays-disabled-use-fcoarrays which tells you that you need to pass a flag to your compiler.
You then you need to read the instructions of the VS Code extension, specifically: https://github.com/fortran-lang/vscode-fortran-support#additional-linting-options and pass something like -fcoarray=single
.
Again, this is completely unrelated to this repository.
Thank you for your patient reply!
Hello, hope you're good.
I just started using fls, which is very awesome! Here is my problem. I have a
main402.f
file such as:It gives me
Coarrays disabled at (1), use '-fcoarray=' to enable
. Although I get the above error when I use fls , I can successfully compile the code. I'm not experienced enough to understand what the problem is, could someone kindly help me?