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

sort completions based on the result location type at the current cursor position #1845

Open
Techatrix opened this issue Mar 30, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Techatrix
Copy link
Member

In the following code snippet, in which order should the completions be ordered?

const large_number: u64 = 0;
const small_number: u32 = 0;
const byte: u8 = 0;
const string: []const u8 = "";
fn foo(_: u32) u32 {}
test {
    foo(<cursor>);
}

byte, small_number and foo() should come first because only they can coerce to the result location type u32.
I can imagine many possible sorting rules on how to use RLS to improve completion and this example is just one of many.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant