提交 494e5e85 编写于 作者: M Matt Bierner

Fix bug for completing function name parameters if function name contained special snippet syntax

上级 75071898
......@@ -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();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册