Skip to content

Commit ba2041e

Browse files
authored
Fix ambiguous '\W' pattern (#32)
1 parent a1deeb6 commit ba2041e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

server/feature_hover.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def detect_registry_name(line: str, registry_start: int) -> str:
190190
return ""
191191

192192
for i in range(registry_start - 1, 0, -1):
193-
if re.match("\W", line[i]):
193+
if re.match(r"\W", line[i]):
194194
continue
195195
else:
196196
type_span = get_current_word(line, i)

server/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ def get_current_word(line: str, start_pos: int) -> SpanInfo:
2828
start_i = start_pos
2929

3030
for i in range(start_pos, len(line), 1):
31-
if re.match("\W", line[i]):
31+
if re.match(r"\W", line[i]):
3232
break
3333
else:
3434
end_i = i
3535

3636
for i in range(start_pos, -1, -1):
37-
if re.match("\W", line[i]):
37+
if re.match(r"\W", line[i]):
3838
break
3939
else:
4040
start_i = i

0 commit comments

Comments
 (0)