You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Probably the most irritating paper cut I have when using RA is the first (few) suggestions requiring a new import when something that would match perfectly (and generally what I want) is already in scope.
Here the 4th suggestion I would think is most appropriate (no imports required). Whether the crate::... match should be next is debatable (my first reaction would be yes but there's probably a good example to counter it)
Particularly when jumping in from another language I tend to assume the top suggestion will be the one in scope and often end up with extra imports I didn't want while typing quickly
<...>.as_slice() importing slice::SlicePattern (and requires an unstable language feature) is a particularly common offender for causing this. I can't recall a simple example where it comes up first but it has definitely happened (the number of times I've had to remove that particular import...)
Not 100% sure what the best resolution is here, but there are several issues in this particular case
Duplication of an existing suggestion requiring no import
Useful for feature discovery maybe, but creates clutter that obstructs progress
Perhaps an option to remove duplicates that require imports when there is an exact match already in scope? Alternatively, send them to the bottom of the suggested list (i.e. you may also be looking for...)
Suggestion of an unstable feature for a project using a stable compiler
even on nightly I would probably prefer it wasn't presented unless I had already enabled the feature gate but presenting it on a stable project just feels outright incorrect behaviour
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Rust analyser version: 0.2.1022 (current stable)
VSCode version: 1.66.2 (current stable)
Probably the most irritating paper cut I have when using RA is the first (few) suggestions requiring a new import when something that would match perfectly (and generally what I want) is already in scope.
Here the 4th suggestion I would think is most appropriate (no imports required). Whether the

crate::...
match should be next is debatable (my first reaction would be yes but there's probably a good example to counter it)Particularly when jumping in from another language I tend to assume the top suggestion will be the one in scope and often end up with extra imports I didn't want while typing quickly
<...>.as_slice()
importingslice::SlicePattern
(and requires an unstable language feature) is a particularly common offender for causing this. I can't recall a simple example where it comes up first but it has definitely happened (the number of times I've had to remove that particular import...)Not 100% sure what the best resolution is here, but there are several issues in this particular case
The text was updated successfully, but these errors were encountered: