Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat(linter): Add a fixer for redundant parentheses
  • Loading branch information
dotdash committed Mar 31, 2026
commit cff0d06cd5c8fd9f967f687c0c4a9146c3829354
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use indoc::indoc;
use mago_text_edit::TextEdit;
use schemars::JsonSchema;
use serde::Deserialize;
use serde::Serialize;
Expand Down Expand Up @@ -203,6 +204,9 @@ impl LintRule for NoRedundantParenthesesRule {
)
.with_help("Remove the redundant inner parentheses.");

ctx.collector.report(issue);
ctx.collector.propose(issue, |edits| {
edits.push(TextEdit::delete(parenthesized.left_parenthesis));
edits.push(TextEdit::delete(parenthesized.right_parenthesis));
});
}
}
Loading