fix snippet for function call

This commit is contained in:
chemzqm 2018-12-28 17:54:02 +08:00
parent ae4f8410f2
commit 71fa0e5ef9

View file

@ -356,6 +356,10 @@ export default class TypeScriptCompletionItemProvider implements CompletionItemP
const parameterListParts = getParameterListParts(displayParts) const parameterListParts = getParameterListParts(displayParts)
let { parts, hasOptionalParameters } = parameterListParts let { parts, hasOptionalParameters } = parameterListParts
let idx = 1 let idx = 1
if (parts.length == 0 && hasOptionalParameters) {
item.insertText = snippet + '${1})$0'
return
}
for (let part of parts) { for (let part of parts) {
snippet += '${' + idx + ':' + part.text + '}' // tslint:disable-line snippet += '${' + idx + ':' + part.text + '}' // tslint:disable-line
if (idx == parts.length) { if (idx == parts.length) {