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

Commit

Permalink
Support multiple parameters declared with same type when using useCod…
Browse files Browse the repository at this point in the history
…eSnippetsOnFunctionSuggestWithoutType. Fixes #1279. (#1284)
  • Loading branch information
Alex Kohler authored and ramya-rao-a committed Oct 18, 2017
1 parent fa59f78 commit b6ddbfa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/goSuggest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,10 @@ export class GoCompletionItemProvider implements vscode.CompletionItemProvider {
if (param) {
param = param.replace('${', '\\${').replace('}', '\\}');
if (conf.get('useCodeSnippetsOnFunctionSuggestWithoutType')) {
if (param.includes(' ')) {
// Separate the variable name from the type
param = param.substr(0, param.indexOf(' '));
}
}
paramSnippets.push('${' + (i + 1) + ':' + param + '}');
}
Expand Down

0 comments on commit b6ddbfa

Please sign in to comment.