fix: remove angle brackets if all lifetime args removed in inline type alias code assist.#21784
Open
80avin wants to merge 1 commit intorust-lang:masterfrom
Open
fix: remove angle brackets if all lifetime args removed in inline type alias code assist.#2178480avin wants to merge 1 commit intorust-lang:masterfrom
80avin wants to merge 1 commit intorust-lang:masterfrom
Conversation
8a5706a to
d181b85
Compare
A4-Tacks
reviewed
Mar 9, 2026
| && ws.kind() == SyntaxKind::WHITESPACE | ||
| { | ||
| removals.push(ws); | ||
| } |
Member
There was a problem hiding this comment.
When deleting multiple parameters but the list is not cleared, the comma has not been deleted yet
Similar code (needs removals.unique()):
removals.extend(next_prev().find_map(|dir| {
let tokens = syntax.siblings_with_tokens(dir)
.take_while(|it| it.is_token())
.take_while_inclusive(|it| it.kind() != T![,])
.collect::<Vec<_>>();
tokens.iter().any(|it| it.kind() == T![,]).then_some(tokens)
}).flatten())
Author
There was a problem hiding this comment.
Fixed. Also added one more test case.
Please resolve if it seems right.
| .syntax() | ||
| .parent() | ||
| .and_then(ast::GenericArgList::cast) | ||
| .is_some() |
Author
There was a problem hiding this comment.
Didn't know that LifetimeArg is always a child of GenericArgList.
Fixed. Please resolve if it appears right.
d181b85 to
286402c
Compare
286402c to
c6912a1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #21769
In
Inline type alias into all usescode assist,