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

Feature Request: Select or Quickfix next problem by severity #208

Open
zardoy opened this issue May 10, 2024 · 6 comments
Open

Feature Request: Select or Quickfix next problem by severity #208

zardoy opened this issue May 10, 2024 · 6 comments

Comments

@zardoy
Copy link

zardoy commented May 10, 2024

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?

@usernamehw
Copy link
Owner

usernamehw commented May 15, 2024

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?

@zardoy
Copy link
Author

zardoy commented May 15, 2024

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

@zardoy
Copy link
Author

zardoy commented Jun 1, 2024

hey! i think i can help implementing this

@usernamehw
Copy link
Owner

usernamehw commented Jun 1, 2024

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"
		],
	}
},

@zardoy
Copy link
Author

zardoy commented Jun 1, 2024

Can you implement it without adding new settings? Just 2 commands that accept arguments

Sounds good to me 👌

@aguynamedben
Copy link

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,

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants