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

Use code snippets for completion of vars of func type. #1673

Merged
merged 1 commit into from
May 13, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/goSuggest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ export class GoCompletionItemProvider implements vscode.CompletionItemProvider {
);
}
let conf = vscode.workspace.getConfiguration('go', vscode.window.activeTextEditor ? vscode.window.activeTextEditor.document.uri : null);
if ((conf.get('useCodeSnippetsOnFunctionSuggest') || conf.get('useCodeSnippetsOnFunctionSuggestWithoutType')) && suggest.class === 'func') {
if ((conf.get('useCodeSnippetsOnFunctionSuggest') || conf.get('useCodeSnippetsOnFunctionSuggestWithoutType'))
&& (suggest.class === 'func' || suggest.class === 'var' && suggest.type.startsWith('func('))) {
let params = parameters(suggest.type.substring(4));
let paramSnippets = [];
for (let i = 0; i < params.length; i++) {
Expand Down Expand Up @@ -327,4 +328,3 @@ export class GoCompletionItemProvider implements vscode.CompletionItemProvider {
}
}
}