File tree Expand file tree Collapse file tree 4 files changed +20
-1
lines changed Expand file tree Collapse file tree 4 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## Unreleased
4
4
5
+ ### Fixed
6
+
7
+ - Fixed bug with Fixed Format references being incorrectly detected in comments
8
+ ([ #447 ] ( https://github.com/fortran-lang/fortls/issues/447 ) )
9
+
5
10
## 3.1.2
6
11
7
12
### Fixed
Original file line number Diff line number Diff line change @@ -1137,7 +1137,7 @@ def get_code_line(
1137
1137
def strip_comment (self , line : str ) -> str :
1138
1138
"""Strip comment from line"""
1139
1139
if self .fixed :
1140
- if FRegex .FIXED_COMMENT .match (line ) and FRegex .FIXED_OPENMP .match (line ):
1140
+ if FRegex .FIXED_COMMENT .match (line ) and not FRegex .FIXED_OPENMP .match (line ):
1141
1141
return ""
1142
1142
else :
1143
1143
if FRegex .FREE_OPENMP .match (line ) is None :
Original file line number Diff line number Diff line change @@ -51,3 +51,12 @@ def test_references():
51
51
[free_path , 78 , 6 , 12 ],
52
52
),
53
53
)
54
+
55
+
56
+ def test_references_ignore_comments_fixed ():
57
+ string = write_rpc_request (1 , "initialize" , {"rootPath" : str (test_dir / "fixed" )})
58
+ file_path = test_dir / "fixed" / "comment_as_reference.f"
59
+ string += ref_req (file_path , 3 , 22 )
60
+ errcode , results = run_request (string )
61
+ assert errcode == 0
62
+ assert len (results [1 ]) == 2
Original file line number Diff line number Diff line change
1
+ program comment_as_reference
2
+ C Comment with variable name gets picked as a ref: variable_to_reference
3
+ real variable_to_reference
4
+ variable_to_reference = 1
5
+ end program comment_as_reference
You can’t perform that action at this time.
0 commit comments