fix snippet for function call
This commit is contained in:
parent
ae4f8410f2
commit
71fa0e5ef9
1 changed files with 4 additions and 0 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue