vscode-error-lens
vscode-error-lens copied to clipboard
Feature Request: Select or Quickfix next problem by severity
Hello! Many users come from webstorm which has fix anything command (alt+enter) which focuses on the next problem and popups codefix UI. I could use the following keybinding for this:
"command": "runCommands",
"args": {
"commands": [
"editor.action.marker.next",
{
"command": "editor.action.codeAction",
"args": {
"kind": "quickfix",
"apply": "never"
}
}
]
}
it was truly awesome experience but I didn't like the fact that it always selected the closest problem (warning and info) ignoring the severity level (even with "problems.sortOrder": "severity")
On the other hand errorLens.selectProblem (instead of editor.action.marker.next) with "errorLens.selectProblemType": "closestSeverity" works just perfectly, but once you run this command it won't go to the next problem (cycle). I wonder whether it is possible to implement an internal tracking of already focused problems and ignore them until the position of the cursor is not changed by the user. WDYT?
I'm thinking of adding 2 commands (no settings). errorLens.nextProblem & errorLens.prevProblem.
But how would it even work?
1❌ 2❌ 3⚠️
4⚠️
5❌ 6⚠️
// 500 lines of code
7❌ 8⚠️
Is the order of next problem 1 2 5 7 3 4 6 8 or something else? Does it target current file or all files?
errorLens.nextProblem&errorLens.prevProblem
let's name them as errorLens.nextFileProblem & errorLens.prevFileProblem so it makes obvious
Is the order of the next problem
1 2 5 7 3 4 6 8
yes, you are absolutely right. and it doesn't matter what's your editor cursor position
hey! i think i can help implementing this
Can you implement it without adding new settings? Just 2 commands that accept arguments e.g.:
{
"key": "ctrl+shift+9",
"command": "errorLens.nextProblem",
"args": {
"scope": "",// "file" | "allFiles"
"sortOrder": "",// "problem" | "problemBySeverity"
"diagnosticSeverity": [
"error",
"warning"
],
}
},
Can you implement it without adding new settings? Just 2 commands that accept arguments
Sounds good to me 👌
I would also like errorLens.nextFileProblem and errorLens.previousFileProblem. I'm coming from Neovim + LazyVim where you can hit "] d" for "next diagnostic" and "[ d" for previous diagnostic. VS Code editor.action.marker.next and editor.action.marker.prev are annoying me because they pop open this "peek" mode. I don't think VS Code has a way to navigate to the next problem without the annoying peek mode, which means my error shows up twice,