mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 10:38:59 +01:00
@@ -117,4 +117,12 @@ suite('typescript function call snippets', () => {
|
||||
'\\$abc()$0');
|
||||
});
|
||||
|
||||
test('Should not include object key signature in completion, #66297', async () => {
|
||||
assert.strictEqual(
|
||||
snippetForFunctionCall(
|
||||
{ label: 'foobar', },
|
||||
[{ "text": "function", "kind": "keyword" }, { "text": " ", "kind": "space" }, { "text": "foobar", "kind": "functionName" }, { "text": "(", "kind": "punctuation" }, { "text": "param", "kind": "parameterName" }, { "text": ":", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "{", "kind": "punctuation" }, { "text": "\n", "kind": "lineBreak" }, { "text": " ", "kind": "space" }, { "text": "[", "kind": "punctuation" }, { "text": "key", "kind": "parameterName" }, { "text": ":", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "string", "kind": "keyword" }, { "text": "]", "kind": "punctuation" }, { "text": ":", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "string", "kind": "keyword" }, { "text": ";", "kind": "punctuation" }, { "text": "\n", "kind": "lineBreak" }, { "text": "}", "kind": "punctuation" }, { "text": ")", "kind": "punctuation" }, { "text": ":", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "void", "kind": "keyword" }]
|
||||
).snippet.value,
|
||||
'foobar(${1:param})$0');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -68,7 +68,7 @@ function getParameterListParts(
|
||||
break;
|
||||
|
||||
case PConst.DisplayPartKind.parameterName:
|
||||
if (parenCount === 1 && isInMethod) {
|
||||
if (parenCount === 1 && braceCount === 0 && isInMethod) {
|
||||
// Only take top level paren names
|
||||
const next = displayParts[i + 1];
|
||||
// Skip optional parameters
|
||||
|
||||
Reference in New Issue
Block a user