Closed albertziegenhagel closed 1 year ago
@gnikit If you too prefer solution 1. as expected behaviors (not requiring the suffixes to start with a dot) I can open a pull request with a fix (I think there is basically just an else
missing for the if
in
Although I would say the code could use a few other slight improvements. Eg. passing .a.b
as suffix will make it look for files ending in ab
, since all dots are being removed).
- OR The documentation should at least very explicitly state that a dot in the beginning is a mandatory requirement.
Well it kinda does since it only provides suffixes prefixed via .
, see.
IMO the suffixes should not be limited to just file extensions, they could be also globs or any type of string at the end of a file.
I can't say I remember why I coded it the src_file_exts
function that way, but improvements are always welcome.
Please remember to also add/edit the tests, update the docs and CHANGELOG or allow for maintainer edits in the PR.
I have a similar issue.
Having a source repository with
<root>
|- main.f90
|- inc
|- main.inc
But running fortls --debug_rootpath /path/to/root --incl_suffixes .inc
gives unexpected result.
Testing "initialize" request:
Root = "/path/to/root"
[INFO] fortls - Fortran Language Server 2.13.0 Initialized
Successful!
Source directories:
/path/to/root
^^^
The /path/to/root/inc
is expected here. In VSCode, the Modern Fortran extension does not parse my .inc
files.
Update I realize that the v2.13.0 I am using is released before these discussions, so I need to upgrade to a newer version.
Describe the bug If I pass include suffixes via
--incl_suffixes
to fortls that do not start with a dot, they are simply ignored, with no warning whatsoever. This is especially surprising, since the description of the setting in the Modern Fortran VS Code extension lists the defaults without dots (see package.json#L443)To Reproduce
Having a source repository with
running
python -m fortls --debug_rootpath=C:\source\test-fortls --incl_suffixes inc
gives
but running
python -m fortls --debug_rootpath=C:\source\test-fortls --incl_suffixes .inc
gives the correct:
Expected behavior
In the order of my personal preference: