We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Given a struct with some impls, the LSP suggests autocompletion with fns that are not available in the current context.
impl
Consider the following program
struct Foo<T> { t: T, } impl Foo<Field> { fn bar(_self: Self) -> Field { 5 } } impl Foo<u32> { fn bar(_self: Self) -> Field { 5 } fn baz(_self: Self) -> Field { 6 } } fn main() -> pub Field { let foo: Foo<Field> = Foo { t: 5 }; foo.bar() }
In the last line, only bar() can be called on foo.
bar()
foo
The LSP suggests incorrect autocompletes:
Note that two versions of bar are suggested, one for each impl. However, the second one cannot be called since I have Foo<Field> and not Foo<u32>.
bar
Foo<Field>
Foo<u32>
baz is also suggested as an alternative, but this is invalid: that method is not available on the type since it belongs to the other specialization.
baz
Finally, t is suggested even though it is not public (and currently results in a warning).
t
The text was updated successfully, but these errors were encountered:
asterite
Successfully merging a pull request may close this issue.
Aim
Given a struct with some
impl
s, the LSP suggests autocompletion with fns that are not available in the current context.Expected Behavior
Consider the following program
In the last line, only
bar()
can be called onfoo
.Bug
The LSP suggests incorrect autocompletes:
Note that two versions of
bar
are suggested, one for eachimpl
. However, the second one cannot be called since I haveFoo<Field>
and notFoo<u32>
.baz
is also suggested as an alternative, but this is invalid: that method is not available on the type since it belongs to the other specialization.Finally,
t
is suggested even though it is not public (and currently results in a warning).The text was updated successfully, but these errors were encountered: