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 22
33## Unreleased
44
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+
510## 3.1.2
611
712### Fixed
Original file line number Diff line number Diff line change @@ -1137,7 +1137,7 @@ def get_code_line(
11371137 def strip_comment (self , line : str ) -> str :
11381138 """Strip comment from line"""
11391139 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 ):
11411141 return ""
11421142 else :
11431143 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():
5151 [free_path , 78 , 6 , 12 ],
5252 ),
5353 )
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