From 3679242b6d72d8ca60b27006410e1e0bc8fb0214 Mon Sep 17 00:00:00 2001 From: Ramya Achutha Rao Date: Fri, 4 Nov 2016 11:32:07 -0700 Subject: [PATCH] pkg suggestions to appear after gocode suggestions --- src/goSuggest.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/goSuggest.ts b/src/goSuggest.ts index cca80a134..d4ac20c6d 100644 --- a/src/goSuggest.ts +++ b/src/goSuggest.ts @@ -184,6 +184,8 @@ export class GoCompletionItemProvider implements vscode.CompletionItemProvider { } item.insertText = suggest.name + '(' + paramSnippets.join(', ') + ') {{}}'; } + // Add same sortText to all suggestions from gocode so that they appear before the unimported packages + item.sortText = 'a'; suggestions.push(item); }; } @@ -240,6 +242,8 @@ export class GoCompletionItemProvider implements vscode.CompletionItemProvider { command: 'go.import.add', arguments: [pkgInfo.path] }; + // Add same sortText to the unimported packages so that they appear after the suggestions from gocode + item.sortText = 'z'; return item; }); return completionItems;