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

internal: Migrate apply_demorgan to SyntaxEditor #19171

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ShoyuVanilla
Copy link
Member

Part of #18285

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 17, 2025
@ShoyuVanilla ShoyuVanilla marked this pull request as draft February 18, 2025 14:56
@ShoyuVanilla ShoyuVanilla marked this pull request as ready for review February 18, 2025 14:58
/// Take all of the tracked syntax mappings, leaving `SyntaxMapping::default()` in its place, if any.
pub fn take(&self) -> SyntaxMapping {
self.mappings.as_ref().map(|mappings| mappings.take()).unwrap_or_default()
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have many assists that need to capture the reference to SyntaxEditor into the closures that feeded into iterators, and once we do so, we cannot use its SyntaxMappings forever.
I tried this dance but while working on other assists, I found that there are many assists that require it, so instead of it, I'm adding this new method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants