Expand ItemDecorator extensions in all contexts#12258
Closed
sfackler wants to merge 2 commits intorust-lang:masterfrom
Closed
Expand ItemDecorator extensions in all contexts#12258sfackler wants to merge 2 commits intorust-lang:masterfrom
sfackler wants to merge 2 commits intorust-lang:masterfrom
Conversation
The old method of building up a list of items and threading it through all of the decorators was unwieldy and not really scalable as non-deriving ItemDecorators become possible. The API is now that the decorator gets an immutable reference to the item it's attached to, and a callback that it can pass new items to. If we want to add syntax extensions that can modify the item they're attached to, we can add that later, but I think it'll have to be separate from ItemDecorator to avoid strange ordering issues.
Contributor
|
Closes #4913. |
Now that fold_item can return multiple items, this is pretty trivial. It also recursively expands generated items so ItemDecorators can generate items that are tagged with ItemDecorators! Closes rust-lang#4913
bors
pushed a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 25, 2022
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 25, 2022
…kril feat: escape format specifier(close: rust-lang#12258) solve rust-lang/rust-analyzer#12258
flip1995
pushed a commit
to flip1995/rust
that referenced
this pull request
Feb 26, 2024
…xendoo [`similar_names`]: don't raise if the first character is different A lot of cases of the "noise" cases of `similar_names` come from two idents with a different first letter, which is easy enough to differentiate visually but causes this lint to be raised. Do not raise the lint in these cases, as long as the first character does not have a lookalike. Helps with rust-lang/rust-clippy#10926 (does not fix) This is per-commit reviewable, the first commit is just refactoring. changelog: [`similar_names`]: don't raise if the first character is different
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.
Now that fold_item can return multiple items, this is pretty trivial. It
also recursively expands generated items so ItemDecorators can generate
items that are tagged with ItemDecorators!
Closes #4913
NB: This depends on #12234.