Skip to content

Commit c3d34b8

Browse files
committed
display built in attributes at the bottom of the list #184
1 parent 6c44a14 commit c3d34b8

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/client/providers/completionProvider.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ export class PythonCompletionItemProvider implements vscode.CompletionItemProvid
1313
private static parseData(data: proxy.ICompletionResult): vscode.CompletionItem[] {
1414
if (data && data.items.length > 0) {
1515
return data.items.map(item => {
16-
var completionItem = new vscode.CompletionItem(item.text);
16+
let completionItem = new vscode.CompletionItem(item.text);
1717
completionItem.documentation = item.description;
18+
// ensure the built in memebers are at the bottom
19+
completionItem.sortText = (completionItem.label.startsWith("__") ? "z" : (completionItem.label.startsWith("_") ? "y" : "__")) + completionItem.label;
1820
return completionItem;
1921
});
2022
}

0 commit comments

Comments
 (0)