microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.33k stars 28.59k forks source link

Stable Action of "Select Indentation" (for shortcut key registration) as `workbench.action.editor.*` #220135

Closed a4lg closed 3 days ago

a4lg commented 2 months ago

Current Status

On the bottom right side of the editor window, we normally have those status controls.

image

Many of those display the current information and clicking enables changing them.

Note that, many of such "changing" actions are available as actions (which shortcut keys can be assigned) so that we don't need to move a hand out from the keyboard (even if "choosing menu" is displaying, it can be selected purely from keyboard).

... But we cannot change the indentation settings (current: Tab Size: 4) in a stable way.

It currently has an action per window (changeEditorIndentation1, changeEditorIndentation2...) and setting a shortcut key will work on some windows but not others.

NOT a solution

We already have

but I don't consider those actions as the solution because... why do we have to register multiple separate shortcut keys when we have a nice menu like this when we click the current indentation?

image

Request

Can we have a stable action to change current indentation settings under workbench.action.editor (like workbench.action.editor.changeIndentation), not unstable changeEditorIndentation*?

It seems VSCode changed changeEditorIndentation to changeEditorIndentation{num} to fix a bug (#205169) so there may be an obstacle to implement it. Still, I'd be happy this feature to be implemented and at least I'm good to hear why this is difficult/different from other actions.

hediet commented 2 months ago

@bpasero Should https://github.com/microsoft/vscode/commit/74724fbcb07547ade4c8602a3bf2cbb29172c738 not register a command per window, but instead look up in the command handler which is the focused window?

VSCodeTriageBot commented 2 months ago

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

vs-code-engineering[bot] commented 1 week ago

This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

ljorring commented 1 week ago

I frequently used the changeEditorIndentation command, so when it suddenly broke, it impacted my workflow. In my confusion I made this stackoverflow post before stumbling upon this thread.

Thanks for reporting the issue. Since it doesn't look like it will be accepted, let me please know, if someone finds a workaround.

vs-code-engineering[bot] commented 3 days ago

:slightly_frowning_face: In the last 60 days, this feature request has received less than 20 community upvotes and we closed it. Still a big Thank You to you for taking the time to create this issue! To learn more about how we handle feature requests, please see our documentation.

Happy Coding!