Do not change visibility of macro_rules in the "Extract module" assist

See https://github.com/rust-analyzer/ungrammar/pull/46#issuecomment-1049801890.
This commit is contained in:
Chayim Refael Friedman 2022-02-25 01:23:15 +00:00 committed by GitHub
parent 2df7a1af17
commit 3149e69247

View File

@ -781,7 +781,6 @@ fn get_replacements_for_visibilty_change(
ast::Item::Fn(it) => replacements.push((it.visibility(), it.syntax().clone())), ast::Item::Fn(it) => replacements.push((it.visibility(), it.syntax().clone())),
//Associated item's visibility should not be changed //Associated item's visibility should not be changed
ast::Item::Impl(it) if it.for_token().is_none() => impls.push(it), ast::Item::Impl(it) if it.for_token().is_none() => impls.push(it),
ast::Item::MacroRules(it) => replacements.push((it.visibility(), it.syntax().clone())),
ast::Item::MacroDef(it) => replacements.push((it.visibility(), it.syntax().clone())), ast::Item::MacroDef(it) => replacements.push((it.visibility(), it.syntax().clone())),
ast::Item::Module(it) => replacements.push((it.visibility(), it.syntax().clone())), ast::Item::Module(it) => replacements.push((it.visibility(), it.syntax().clone())),
ast::Item::Static(it) => replacements.push((it.visibility(), it.syntax().clone())), ast::Item::Static(it) => replacements.push((it.visibility(), it.syntax().clone())),