I try to write an extension for the Code Completion of a handmade framework but I got into trouble
this is my code
const provider2 = vscode.languages.registerCompletionItemProvider(
'javascript',
{
provideCompletionItems(document: vscode.TextDocument, position: vscode.Position) {
const linePrefix = document.lineAt(position).text.slice(0, position.character);
if (linePrefix.endsWith('core.')) {
return [
new vscode.CompletionItem('log', vscode.CompletionItemKind.Method),
];
}
return undefined;
}
},
'.'
);
The code works properly, but the problem is that the order of the suggestions is not correct
That is, the words used first (Keywords) are suggested then other extensions
And finally my extension offers
I tried using the Object and using SortText:“ 000 ”
but did not fix the problem
Mohammad-karimi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.