hansec / fortran-language-server

Fortran Language Server for the Language Server Protocol
MIT License
294 stars 57 forks source link

error about 'unknown module' when modules are in different folder and connected with cmake #223

Open mghaderizefreh opened 2 years ago

mghaderizefreh commented 2 years ago

Hey, I use cmake to build my project. I have several folders each with one or two modules. I receive "PROBLEMS" in vscode saying that the x modules are not found in the project. And I guess because of this I don't receive additional diagnosis regarding the use of subroutines and functions of those modules. Is there a solution for this already available that kind of interacts with cmake and understands the location of other modules? Thanks

gnikit commented 2 years ago

Hey not sure if you are using fortran-language-server or fortls, since the vscode modern Fortran extension is not compatible with the former.

Aside from that what you want is to setup a configuration file with the location of your source files. See the fortls documentation for more info:

https://gnikit.github.io/fortls/options.html#available-options

All these options can be set via both the command line and/or a configuration file. The command line arguments can be set through the option "fortran.fortls.extraArgs"