Skip to content

Commit 048a2f5

Browse files
committed
Fixes Hover over literal and parameter strings does not show value #54
1 parent 1e464f0 commit 048a2f5

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# CHANGELONG
22

3+
## 2.2.4
4+
5+
### Fixed
6+
7+
- Fixed hovering value of literal and constant strings not displaying
8+
([#54](https://github.com/gnikit/fortls/issues/54))
9+
310
## 2.2.3
411

512
### Changed

fortls/regex_patterns.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class FortranRegularExpressions:
8080
r"CONTIGUOUS)",
8181
I,
8282
)
83-
PARAMETER_VAL: Pattern = compile(r"[\w]*[\s\&]*=[\s\&]*([\w\.\*\-\+\\]*)", I)
83+
PARAMETER_VAL: Pattern = compile(r"\w*[\s\&]*=[\s\&]*([\w\.\*\-\+\\\'\"]*)", I)
8484
TATTR_LIST: Pattern = compile(
8585
r"[ ]*,[ ]*(PUBLIC|PRIVATE|ABSTRACT|EXTENDS\([a-z0-9_]*\))", I
8686
)

test/test_server.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,12 @@ def check_return(result_array, checks):
612612
"INTEGER, PARAMETER :: var4 = 123",
613613
"DOUBLE PRECISION, PARAMETER :: somevar = 23.12",
614614
"DOUBLE PRECISION, PARAMETER :: some = 1e-19",
615+
"LOGICAL(kind=8), PARAMETER :: long_bool = .true.",
616+
"LOGICAL",
617+
"CHARACTER(len=5), PARAMETER :: sq_str = '12345'",
618+
"CHARACTER(LEN=5)",
619+
'CHARACTER(len=5), PARAMETER :: dq_str = "12345"',
620+
"CHARACTER(LEN=5)",
615621
"INTEGER, POINTER",
616622
"""FUNCTION fun1(arg) RESULT(fun1)
617623
INTEGER, INTENT(IN) :: arg

0 commit comments

Comments
 (0)