-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
A-completionautocompletionautocompletionS-actionableSomeone could pick this issue up and work on it right nowSomeone could pick this issue up and work on it right now
Description
When implementing a trait, I sometimes write comments and attributes before adding the actual method or associated type. I've encountered a bug, where if you use auto completion, then the comments and attribute prior are removed.
I can recall this issue having existed for a long time. So thought I might as well finally report it.
Steps to reproduce
- Create a trait, which has any amount of methods and/or associated types
- Start implementing the trait for a type
- Write comments and/or attributes
- Start typing the name of a method or associated type
- Press Enter to auto complete
- Now the method/type has been auto completed, while the previous comments and/or attributes have been removed
Example
I think a code snippet is less sufficient in this case, so I'll include screenshots.
- Before shows the comments and attributes, with the auto complete prompt open
- After is after having pressed Enter enter on the auto complete suggestion
| Before | After |
|---|---|
![]() |
![]() |
| Before | After |
|---|---|
![]() |
![]() |
It also happens for associated types.
| Before | After |
|---|---|
![]() |
![]() |
rust-analyzer version: 6175353 2021-04-26 stable
Metadata
Metadata
Assignees
Labels
A-completionautocompletionautocompletionS-actionableSomeone could pick this issue up and work on it right nowSomeone could pick this issue up and work on it right now





