-
Notifications
You must be signed in to change notification settings - Fork 37.4k
Closed
Labels
*dev-questionVS Code Extension Development QuestionVS Code Extension Development Question
Description
Given a language that takes named args with colons:
myFunc(foo: 1);
It seems sensible to set : as a trigger character to open completion. This works fine:
context.subscriptions.push(vscode.languages.registerCompletionItemProvider("markdown", {
provideCompletionItems(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken, context: vscode.CompletionContext): vscode.CompletionItem[] {
return [
new vscode.CompletionItem("test"),
];
}
}, ":"));However, if you type a space (as shown above, to have whitespace between : and the value), the completion list gets filtered and disappears. While it's possible to set <space> as a trigger character, that results in the completion provider being called a lot (for example on every space inside comments) which then need to be filtered out by the extension.
Is it reasonable to ignore leading whitespace when filtering the completion list to simplify things? It seems almost certain that no provider is ever going to return completion items with leading spaces expecting them to be precisely filtered?
Metadata
Metadata
Assignees
Labels
*dev-questionVS Code Extension Development QuestionVS Code Extension Development Question
