Skip to content

Commit

Permalink
use regex word boundary when looking for labels
Browse files Browse the repository at this point in the history
related to #1694
  • Loading branch information
predragnikolic committed Sep 27, 2022
1 parent 75b59d2 commit 0539dd7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugin/core/signature_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from .views import minihtml
import functools
import html
import re
import sublime


Expand Down Expand Up @@ -115,7 +116,8 @@ def _render_label(self, view: sublime.View, signature: SignatureInformation) ->
# route relies on the client being smart enough to figure where the parameter is inside of
# the signature label. The above case where the label is a tuple of (start, end) positions is much
# more robust.
start = label[prev:].find(rawlabel)
label_match = re.search(r"\b{}\b".format(rawlabel), label[prev:])
start = label_match.start() if label_match else -1
if start == -1:
debug("no match found for {}".format(rawlabel))
continue
Expand Down

0 comments on commit 0539dd7

Please sign in to comment.