-
Notifications
You must be signed in to change notification settings - Fork 29k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong highlight if there are duplicate strings in completion item #113404
Comments
(Experimental duplicate detection) |
@jrieken I'd like to open a PR to fix it, would you please give me some hints about where can I start? |
Steps to reproduce it:
import * as vscode from 'vscode';
export function activate(context: vscode.ExtensionContext) {
const provider1 = vscode.languages.registerCompletionItemProvider('plaintext', {
provideCompletionItems(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken, context: vscode.CompletionContext) {
const simpleCompletion = new vscode.CompletionItem('⭐div classname=""></div>');
return [simpleCompletion];
}
}, ' ', '.', '<');
context.subscriptions.push(provider1);
}
export function deactivate() {}
"activationEvents": [
"*"
], only the later "d" is highlighted |
Understood. Our fuzzy score function treats certain characters as separators, like vscode/src/vs/base/common/filters.ts Line 466 in 696dca7
|
@jrieken Thanks for the hint! Here is another case, the later match of It seems that just adding emoji or symbols to |
That is a different case. Having |
So the |
yes, see here #53715 |
Thanks, I'll open a PR to fix the emoji case ;D |
Add emojis and several more symbols as word separators, fix #113404
Can you try other emoji like ✨ ? It seems that '⭐' is not included by vscode/src/vs/base/common/strings.ts Lines 776 to 782 in 5da5495
|
@alexdima do you have any suggestions on it? I would like to fix |
Not critical for this release, moving to February |
I've created #115221 to track the |
I can verify it works with ✨, so I'll close this and mark as verified pending Alex's new issue |
If a suggestion contains two "div", the second "div" is wrongly highlighted after "di" is entered
Does this issue occur when all extensions are disabled?: No, with my customed completion extension
The text was updated successfully, but these errors were encountered: