Fix bug for completing function name parameters if function name contained special snippet syntax
parent
75071898dc
commit
494e5e8509
|
@ -107,4 +107,14 @@ suite('typescript function call snippets', () => {
|
|||
).snippet.value,
|
||||
'methoda(${1:x})$0');
|
||||
});
|
||||
|
||||
test('Should escape snippet syntax in method name', async () => {
|
||||
assert.strictEqual(
|
||||
snippetForFunctionCall(
|
||||
{ label: '$abc', },
|
||||
[]
|
||||
).snippet.value,
|
||||
'\\$abc()$0');
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
@ -16,7 +16,8 @@ export function snippetForFunctionCall(
|
|||
}
|
||||
|
||||
const parameterListParts = getParameterListParts(displayParts);
|
||||
const snippet = new vscode.SnippetString(`${item.insertText || item.label}(`);
|
||||
const snippet = new vscode.SnippetString();
|
||||
snippet.appendText(`${item.insertText || item.label}(`);
|
||||
appendJoinedPlaceholders(snippet, parameterListParts.parts, ', ');
|
||||
if (parameterListParts.hasOptionalParameters) {
|
||||
snippet.appendTabstop();
|
||||
|
|
Loading…
Reference in New Issue