Skip to content
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

Feature Request: Use LSP preselect field of CompletionItem to preselect most likely item with the same prefix #13227

Open
Colengms opened this issue Feb 4, 2025 · 0 comments

Comments

@Colengms
Copy link
Contributor

Colengms commented Feb 4, 2025

With typing in the body of a function (not member completion), when I type e, the most likely thing I want to type is else. What I'm offered is:

Image

ecvt is a function in stdlib.h. The others are macros from dlgs.h in Windows SDK.

It seems much more likely that what I want to type is a keyword, and not a specific global function name or macro.

It looks like LSP provides a way to present the most likely candidate instead of always navigating to the alphabetically first option with the same prefix.

The right way to decide a best candidate is debatable. It seems like it'd at least be possible to assume keywords (or certain keywords, such as else and if) are more likely than function or macro names, etc., in the body of a function. Perhaps else would be preselected only if the previous lexical token is a close curly brace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

1 participant