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

Update CompletionItemKind #1624

Merged
merged 1 commit into from
Apr 30, 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
7 changes: 5 additions & 2 deletions src/goSuggest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ import { getImportablePackages } from './goPackages';
function vscodeKindFromGoCodeClass(kind: string): vscode.CompletionItemKind {
switch (kind) {
case 'const':
return vscode.CompletionItemKind.Constant;
case 'package':
return vscode.CompletionItemKind.Module;
case 'type':
return vscode.CompletionItemKind.Keyword;
return vscode.CompletionItemKind.Class;
case 'func':
return vscode.CompletionItemKind.Function;
case 'var':
return vscode.CompletionItemKind.Field;
return vscode.CompletionItemKind.Variable;
case 'import':
return vscode.CompletionItemKind.Module;
}
Expand Down Expand Up @@ -293,6 +295,7 @@ export class GoCompletionItemProvider implements vscode.CompletionItemProvider {
command: 'go.import.add',
arguments: [pkgPath]
};
item.kind = vscode.CompletionItemKind.Module;
// Add same sortText to the unimported packages so that they appear after the suggestions from gocode
const isStandardPackage = !item.detail.includes('.');
item.sortText = isStandardPackage ? 'za' : 'zb';
Expand Down