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
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: 4 additions & 0 deletions src/goSuggest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.

item.sortText = 'a';
suggestions.push(item);
};
}
Expand Down Expand Up @@ -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;
Expand Down