fortran-lang / fortls

fortls - Fortran Language Server
https://fortls.fortran-lang.org/
MIT License
257 stars 41 forks source link

What is the intended interaction between root_path and source_dirs? #418

Closed cafhach closed 4 months ago

cafhach commented 4 months ago

I had issues with the directories-Option in VScode, i.e. the source_dirs argument in fortls. Reading into the code I cannot grasp what the intended behavior is. The documentation says

By default all directories under the current project will be recursively parsed for Fortran sources. Alternatively, one can define a series of directories for fortls to look for source files

From my perspective this implies, that fortl will respect my choice of source_dirs, if specified at all. But looking into method serve_initialize in https://github.com/fortran-lang/fortls/blob/a23b93f0d21ecdf083230298cb0fd8b56f532021/fortls/langserver.py I see that self.root_path is added to the source list in any case. Is this a bug or am I misinterpreting the docs? Thanks a lot!