9478: show imported trait on autocompletion of associated items r=matklad a=mahdi-frms
Fixes: #7456
The thing is however, due to the trait being already imported, the path to the trait is just the name of the trait itself.
I also updated the test concerning the labels.
Co-authored-by: mahdi-frms <mahdif1380@outlook.com>
Note that, while we don't currently have a fuzzy-matching score, it
makes sense to special-case postfix templates -- it's very annoying when
`.not()` gets sorted before `.not`. We might want to move this infra to
fuzzy matching, once we have that!
Before this PR, SourceChange used a bool and CompletionItem used an enum
to signify if edit is a snippet. It makes sense to use the same pattern
in both cases. `bool` feels simpler, as there's only one consumer of
this API, and all producers are encapsulated anyway (we check the
capability at the production site).
One source completion can produce up to two lsp completions.
Additionally, `preselct` and `sort_text` are global properties of the
whole set of completions, so the right granularity here is to convert
many completions.
As a side-benefit, we no loger allocate intermediate vec.
Moving tests to `rust-analyzer` crate allows removing walkdir dependency
from `xtask`. It does seem more reasonable to keep tidy tests outside of
the "build system" and closer to other integration tests.
9479: `replace_qualified_name_with_use` insert qualified import paths r=Veykril a=Veykril
Also prevents the assist from triggering on associated items.
Fixes#9472.
This PR gets rid of a lot of tests that only really test the `insert_use` infra which already has its own tests, so these tests are of no use.
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
* Keep codegen adjacent to the relevant crates.
* Remove codgen deps from xtask, speeding-up from-source installation.
This regresses the release process a bit, as it now needs to run the
tests (and, by extension, compile the code).
9465: feat: `replace_match_with_if_let` works on more 2-arm matches r=Veykril a=Veykril
Now it works on pretty much on all 2-arm matches where only up to 1 arm binds a name instead of requiring either a sad or wildcard pattern to be present.
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>