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

Provide assistance for writing an impl block #17590

Open
RalfJung opened this issue Jul 13, 2024 · 7 comments
Open

Provide assistance for writing an impl block #17590

RalfJung opened this issue Jul 13, 2024 · 7 comments
Assignees
Labels
A-assists A-completion autocompletion C-feature Category: feature request

Comments

@RalfJung
Copy link
Member

RalfJung commented Jul 13, 2024

When I am at a type, I can select a "generate impl" assist and it will generate a block right below the type. That's useful, but often I am somewhere else in the project (might not even be the same file), and I want to generate an impl block here. Would be great if there was some way to get the assist there as well. :)

What I usually try is to write impl TypeName, and then my hope would be that (a) I get auto-complete (including auto-import) for the type name, and (b) I can then select an assist to generate an impl block, and it will turn this into

impl<'a, T: Bound> TypeName<'a, T> {
  /* cursor here */
}
@RalfJung RalfJung added the C-feature Category: feature request label Jul 13, 2024
@lnicola
Copy link
Member

lnicola commented Jul 13, 2024

A better UX might be to write impl TypeName and get a completion for the whole thing 🙂.

@ShoyuVanilla
Copy link
Member

I'll give this a try
@rustbot claim

@ChayimFriedman2
Copy link
Contributor

@ShoyuVanilla Are you still working on this?

@ShoyuVanilla
Copy link
Member

No, I was just waiting for #18032 to effectively work on assist things. You could work on this if you like 😄

@ShoyuVanilla ShoyuVanilla removed their assignment Sep 16, 2024
@ChayimFriedman2
Copy link
Contributor

@rustbot claim

@ChayimFriedman2
Copy link
Contributor

@rustbot release-assignment

I still intend to work on this, but as a diagnostic with quick fix, and this diagnostic requires #18074 and follow-ups, which is quite big work. So in order to not create false hopes and not block anyone who would like to want on this, I'm unassigning for now.

@ChayimFriedman2
Copy link
Contributor

Now after we have diagnostics for type, I can come back to work on this.

@rustbot claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-assists A-completion autocompletion C-feature Category: feature request
Projects
None yet
Development

No branches or pull requests

4 participants