Skip to content

Commit

Permalink
Merge 6a63bd0 into 66c168d
Browse files Browse the repository at this point in the history
  • Loading branch information
rwols committed Jun 8, 2019
2 parents 66c168d + 6a63bd0 commit 27d7693
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
2 changes: 1 addition & 1 deletion plugin/core/signature_help.py
Expand Up @@ -144,7 +144,7 @@ def render_signature_label(renderer: ScopeRenderer, sig_info: SignatureInformati
if param.range:
start, end = param.range
is_current = active_parameter_index == max_param_index - index
rendered_param = renderer.parameter(html.escape(label[start:end], quote=False), is_current)
rendered_param = renderer.parameter(content=label[start:end], emphasize=is_current)
label = label[:start] + rendered_param + label[end:]

# todo: highlight commas between parameters as punctuation.
Expand Down
11 changes: 0 additions & 11 deletions plugin/core/test_signature_help.py
Expand Up @@ -195,17 +195,6 @@ def test_params_no_parens(self):
\n<variable.parameter>foo</variable.parameter>\
\n<variable.parameter emphasize>foo</variable.parameter></entity.name.function>""")

def test_escape_content(self):
sig = create_signature("foobar<T>(foo: Option<i32>) -> List<T>", "foo: Option<i32>", activeParameter=0)
help = create_signature_help(dict(signatures=[sig]))
if help:
label = render_signature_label(renderer, help.active_signature(), 0)
self.assertEqual(label, """
<entity.name.function>foobar&lt;T&gt;
<punctuation>(</punctuation>
<variable.parameter emphasize>foo: Option&lt;i32&gt;</variable.parameter>
<punctuation>)</punctuation> -&gt; List&lt;T&gt;</entity.name.function>""")


class SignatureHelpTests(unittest.TestCase):

Expand Down

0 comments on commit 27d7693

Please sign in to comment.