Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
Do not suggest function parameters if passing it as an argument (#1788)
Browse files Browse the repository at this point in the history
* do not suggest function parameters if passing it as an argument

* perform check only when suggestion class is variable
  • Loading branch information
kaskavalci authored and ramya-rao-a committed Jul 17, 2018
1 parent 81e7053 commit 43613e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/goSuggest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export class GoCompletionItemProvider implements vscode.CompletionItemProvider {
);
}
if ((config['useCodeSnippetsOnFunctionSuggest'] || config['useCodeSnippetsOnFunctionSuggestWithoutType'])
&& (suggest.class === 'func' || suggest.class === 'var' && suggest.type.startsWith('func('))) {
&& (suggest.class === 'func' || suggest.class === 'var' && suggest.type.startsWith('func(') && lineText.substr(position.character, 1) !== ')' && lineText.substr(position.character, 1) !== ',')) {
let { params, returnType } = getParametersAndReturnType(suggest.type.substring(4));
let paramSnippets = [];
for (let i = 0; i < params.length; i++) {
Expand Down Expand Up @@ -398,4 +398,4 @@ export class GoCompletionItemProvider implements vscode.CompletionItemProvider {
return matchingPackages[0];
}
}
}
}

0 comments on commit 43613e0

Please sign in to comment.