Description
Describe the bug
When user performs the reference search (i.e., Go to /Peek /Find All References), the comments in the fixed format are not excluded from the result.
See the example below. When you perform "Find All References" to variable WORLD, the result includes the word "WORLD" in the comment that should be excluded.
The cause of this issue is rather obvious. The condition FRegex.FIXED_OPENMP.match(line)
in the below code should be negated.
fortls/fortls/parsers/internal/parser.py
Lines 1137 to 1141 in 3cf8f29
To Reproduce
- Prepare a set of source codes in the fixed format.
- Perform {Go to|Peek|Find All} References over a symbol you choose. Make sure it gives you some (non empty) result.
- Comment out some of the references and try again.
- See the result still includes the comment that should be excluded.
Expected behavior
The comment should be excluded from the result of the reference search.
Screenshots & Animations
Nothing to add.
Setup information (please complete the following information):
- OS: Linux
- Python Version: 3.10.12
- fortls Version: 3.1.3
- Code editor used: VS Code
- the Fortran extension for the code editor and its version: Modern Fortran v3.2.0
Configuration information (please complete the following information):
Nothing special.
Additional context
I will post a PR of the suggested fix. Just a second...