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

pkg suggestions to appear after gocode suggestions #603

Merged
merged 1 commit into from
Nov 4, 2016

Conversation

ramya-rao-a
Copy link
Contributor

@ramya-rao-a ramya-rao-a commented Nov 4, 2016

Ever since we introduced importable packages as suggestions in the auto-complete, people have found it annoying that these package suggestions are interspersed among variables/function names etc.

Excerpt from Gitter:

After last plugin update in autocompletion list I got list of all available packages, it's pretty cool but little annoying because variables with corresponding names appears in the end of a list. It would be nice to sort this list and show variables on top

This PR is to group all the package suggestions and make them appear AFTER the usual/normal suggestions from gocode.

@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will they still be in the right order within the 'a' and 'z' groups, or should it be like 'a' + item.name?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roblourens The completion items are sorted first by the sortText and then by Label. So we are good.

@ramya-rao-a ramya-rao-a merged commit 786abb6 into microsoft:master Nov 4, 2016
@ramya-rao-a ramya-rao-a deleted the order-suggestions branch January 22, 2017 07:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants