microsoft / vscode

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

Feature Request: Bracket Pair Guides - Hover #134888

Open hediet opened 2 years ago

hediet commented 2 years ago

It would be quite useful if bracket pair/indentation guides would support mouse interaction.

I can imagine that a hover shows when the mouse is on a guide an ctrl is pressed.

This hover would show the line of the opening and closing bracket. When clicking on the line, the cursor would jump to it.

Maybe something like this could also be supported:

(from here)

mtsh1000 commented 2 years ago

Opening bracket line(s) could be shown in extended breadcrumbs area maybe?

Z-E-D commented 2 years ago

I really like the idea of using the indent lines, especially in combination with the mentioned #55075 issue.

Having the tooltip on the top of editor that shows the first line of block would be great, but suggestion on the #55075 requires that you have displayed the closing bracket, which could be also outside of the screen when you are inside a very long block.

Because of that I think it is much better if that toolip is displayed if we hover or click on the indent guide.

Trass3r commented 2 years ago

It would be quite useful if bracket pair/indentation guides would support mouse interaction.

Not just with mouse, also when you place the cursor next to the closing brace. Or even when the cursor is in a line that consists only of a closing brace (excluding whitespace). But of course only if the line isn't already visible.

jglick commented 3 weeks ago

Here is an example from NetBeans: Screenshot from 2024-08-24 09-32-19 While the viewport only starts at line 22, when you move the caret next to a closing brace (from the keyboard—no mouse involved) and the opening brace is outside the current viewport, you are shown a hover tip with the matching opening brace, in this case a method definition on line 5.

When the opening brace is inside the viewport, it is merely highlighted.