Add severity argument to GoToDiagnostic actions (#33995)
This PR adds a `severity` argument so severity can be defined when
navigating through diagnostics. This allows keybinds like the following:
```json
{
"] e": ["editor::GoToDiagnostic", { "severity": "error" }],
"[ e": ["editor::GoToDiagnostic", { "severity": "error" }]
}
```
I've added test comments and a test. Let me know if there's anything
else you need!
Release Notes:
- Add `severity` argument to `editor::GoToDiagnostic`,
`editor::GoToPreviousDiagnostic`, `project_panel::SelectNextDiagnostic`
and `project_panel::SelectPrevDiagnostic` actions
This commit is contained in:
@@ -199,8 +199,11 @@ pub fn app_menus() -> Vec<Menu> {
|
||||
MenuItem::action("Go to Type Definition", editor::actions::GoToTypeDefinition),
|
||||
MenuItem::action("Find All References", editor::actions::FindAllReferences),
|
||||
MenuItem::separator(),
|
||||
MenuItem::action("Next Problem", editor::actions::GoToDiagnostic),
|
||||
MenuItem::action("Previous Problem", editor::actions::GoToPreviousDiagnostic),
|
||||
MenuItem::action("Next Problem", editor::actions::GoToDiagnostic::default()),
|
||||
MenuItem::action(
|
||||
"Previous Problem",
|
||||
editor::actions::GoToPreviousDiagnostic::default(),
|
||||
),
|
||||
],
|
||||
},
|
||||
Menu {
|
||||
|
||||
@@ -255,8 +255,11 @@ impl Render for QuickActionBar {
|
||||
.action("Go to Symbol", Box::new(ToggleOutline))
|
||||
.action("Go to Line/Column", Box::new(ToggleGoToLine))
|
||||
.separator()
|
||||
.action("Next Problem", Box::new(GoToDiagnostic))
|
||||
.action("Previous Problem", Box::new(GoToPreviousDiagnostic))
|
||||
.action("Next Problem", Box::new(GoToDiagnostic::default()))
|
||||
.action(
|
||||
"Previous Problem",
|
||||
Box::new(GoToPreviousDiagnostic::default()),
|
||||
)
|
||||
.separator()
|
||||
.action_disabled_when(!has_diff_hunks, "Next Hunk", Box::new(GoToHunk))
|
||||
.action_disabled_when(
|
||||
|
||||
Reference in New Issue
Block a user