fortran-lang / fortls

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

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

Closed cafhach closed 2 months ago

cafhach commented 2 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!