-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Completion sortText and preselect is ignored when typed identifier is an exact match with completion label #71660
Comments
I'm experiencing a similar issue where I expected the order to be [ [
{
"label": "intNumber: Int",
"preselect": true,
"sortText": "00000",
"filterText": "intNumber"
},
{
"label": "toInt: Int",
"sortText": "00001",
"filterText": "toInt"
},
{
"label": "instance: Int",
"sortText": "00002",
"filterText": "instance"
},
{
"label": "asInstanceOf[T0]: T0",
"sortText": "00003",
"filterText": "asInstanceOf"
},
{
"label": "isInstanceOf[T0]: Boolean",
"sortText": "00004",
"filterText": "isInstanceOf"
}
] |
Yes, that's the design and honestly unlikely to change. The match-score with the current prefix (which the user typed) is stronger than the preselect property that the language brain computed. Only with equal scores, preselect comes to play. The reasoning is that user-input is worth more and I still think that's a good idea. |
Commenting on the other question here: the same is true for sort text, that's used for the initial (prefix-less) sorting and to resolve score-conflicts but not to overrule user-input. |
Thank you for the explanation. I agree the current behavior is a good default. Would it be possible to introduce an option similar to In the examples above, I hadn't typed additional characters after triggering the completion so the language server sees the same user-input as VS Code. Either way, I'm fine closing this ticket with "working as intended". This is not a critical issue, the completion experience in VS Code is already one of the best I have experienced 👏 |
Closing since this is unlikely to change, thank you for the explanation! |
Alright, there is an issue which is about disabling fuzzy scoring and using something more 'traditional' like prefix match. I didn't find it right away but that then might be interesting for you |
Steps to Reproduce:
concurrentString
item to be pre-selected and appear at the top of the completion resultsconcurrent
result even if it has a lowersortText
Even if
concurrent
is an exact match with the typed identifier, I think it's undesirable to move it to the top becauseconcurrentString
is more likely to be selectedconcurrent
in the code, I don't save keystrokes by selectingconcurrent
.Does this issue occur when all extensions are disabled?: No, you need the Metals language server extension.
The text was updated successfully, but these errors were encountered: