-
Notifications
You must be signed in to change notification settings - Fork 1.7k
add more completion about "impl" #19447
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
Conversation
I wonder if these should be without spaces/angle brackets, since users cannot type them to filter the completions list? |
That;s a good thing to check, I would not be surprised if editors have differing behavior for spaces here (though its also relevant what our capabilities register for completion characters iirc) |
Any definitive naming scheme? |
I'm not convinced it's worth adding more of these. Especially for the |
Although not strictly enforced (e.g., impl<T, U> Foo<T> {
fn convert<U>(&self) -> Foo<U> {}
} Moreover, if we don't use impl<T: PartialEq, A: Allocator> PartialEq for LinkedList<T, A> If we do need to specify bounds in |
This PR is based on the following observations:
Thus, what I chose to add is I don’t think With the current approach:
Maybe change Additionally, adjusting the cursor jump order? for example, changing:
I wonder if my argument is persuasive? |
I feel like a better workflow (that we should enable) would be the following maybe?:
That is, I feel like the user shouldn't even need to jump back to the generic parameter listing in the first place. If you create a generic parameter there, you will have to use it anyways and so typing out the reference to it first and then have r-a just create the definition for you sounds more ergonomic to me? To be clear, I do agree there is an ergonomics gap here. Its just tabstop snippet completions can be a lot more annoying than helpful depending on how they are designed, and duplicating completions to accomodate for a variety of snippet setups can be more confusing than helpful which is why I (and presumably Florian) are a bit wary of this here. |
I fully understand the caution from you and other members—those would be new perspectives for me to consider (and they are usually better and more comprehensive). So, at this stage, would just adding the "impl for" be acceptable? |
Just the |
By the way, I found some "inconsistency problem" here, and its author seems to use rust-analyzer/crates/ide-completion/src/completions/expr.rs Lines 376 to 384 in 2e1ff25
|
Those probably want to use snippets as well yes |
Completed: #19442