hansec / fortran-language-server

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

Specific directory for the module files #143

Closed pivui closed 4 years ago

pivui commented 4 years ago

Dear Chris,

First of all, I take this opportunity to thank you for this package which is very useful for me!

I was wondering whether it was possible to specify a directory where the fortran server should look for the .mod files. Indeed, I am using CMake in such a way that the modules are all gathered in some dedicated directory, different from the one containing the sources. Therefore, my use <module> statements always raise a diagnostic error (which disappears if I copy the associated module file in the same directory as the source file).

hansec commented 4 years ago

Thanks, I am glad you find it useful!

The language server does not actually parse *.mod files, it only parses source files and performs all analysis from those. This is because the format for*.mod file change periodically and is often different between compiler vendors. For source files you can set search paths for a project to tell the server where to look.