diff --git a/src/goSuggest.ts b/src/goSuggest.ts index b8aa4f7c6..8a70a7d4f 100644 --- a/src/goSuggest.ts +++ b/src/goSuggest.ts @@ -199,7 +199,11 @@ export class GoCompletionItemProvider implements vscode.CompletionItemProvider { paramSnippets.push('${' + (i + 1) + ':' + param + '}'); } } - item.insertText = new vscode.SnippetString(suggest.name + '(' + paramSnippets.join(', ') + ')'); + // Avoid adding snippet for function suggest when cursor is followed by () + // i.e: met() -> method()() + if (lineText.substr(position.character, 2) !== '()') { + item.insertText = new vscode.SnippetString(suggest.name + '(' + paramSnippets.join(', ') + ')'); + } } if (config['useCodeSnippetsOnFunctionSuggest'] && suggest.class === 'type' && suggest.type.startsWith('func(')) { let { params, returnType } = getParametersAndReturnType(suggest.type.substring(4));