hansec / fortran-language-server

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

Preprocessor define replaces parts of token #141

Closed mystery-e204 closed 4 years ago

mystery-e204 commented 4 years ago

The parser for preprocessor defines (specified in .fortls) wrongly replaces parts of single tokens. Here is what I mean by that. Given the source file

#define FOO replaced_1
#define BAR replaced_2
FOO
FOO_abc
FOO_BAR

Intellisense lists the following symbols:

replaced_1
replaced_1_abc
replaced_1_replaced_2

However, it should be:

replaced_1
FOO_abc
FOO_BAR
hansec commented 4 years ago

Thanks for the report! This should now be fixed in master and will be included in the next patch.