0

In VSCode, is there a way to show the current scope or closure in the scrollbar, e.g. by a decoration or opacity change?

I'm looking for a way to see whether my find widget matches fall within the current scope, which is often larger than screen height.

As far as I can tell, there's nothing in settings.json for this, but perhaps I'm searching for the wrong terms.

I'd be open to an extension, but again, unless I'm searching for the wrong thing, this doesn't exist.

isherwood
  • 58,414
  • 16
  • 114
  • 157
ultraGentle
  • 5,084
  • 1
  • 19
  • 45
  • This is not a question that belongs on stack overflow, but I would still like an answer to this question – there are tons of extensions that do this though. – Viraj Shah Jun 05 '23 at 14:00
  • 1
    VSCode settings seem to be grey area -- there are tons of "how do I configure VSCode to do X" here. – ultraGentle Jun 05 '23 at 14:10
  • Yeah. I mean a lot of the questions are pretty stupid, but this question actually contributes to the site – Viraj Shah Jun 05 '23 at 14:39

2 Answers2

1

In the scrollbar? No (not that I know of).

But at the top under the tabs it does show this information for me, but perhaps not in the way you are hoping for

enter image description here


Edit

Using VSCode today I thought about this and noticed that matching braces on a function will highlight in the scrollbar when clicked, as well as any search result matches. This might do what you want with no tweaks at all.

enter image description here

Chris Barr
  • 29,851
  • 23
  • 95
  • 135
  • Thanks, yes, I do use that, but I'm looking for a way to see whether my find-widget matches fall within the current scope, which is often larger than screen height. – ultraGentle Jun 05 '23 at 14:08
  • @ultraGentle see my edit. I noticed this today while working on something. – Chris Barr Jun 05 '23 at 22:22
  • That would do it, yes -- but it doesn't happen on my installation. I searched settings for `brackets` `braces` `scope` -- any chance you know what setting has enabled this? – ultraGentle Jun 05 '23 at 23:49
  • Check out all settings related to `minimap` I think that might be what you're after – Chris Barr Jun 06 '23 at 01:52
0

The answer is to do the opposite of How can I remove symbols on right scrollbar of vscode? :

  • settings.json
  • "workbench.colorCustomizations": {
  • "editorOverviewRuler.bracketMatchForeground" (Overview ruler marker color for matching brackets)

Unfortunately, this only happens when the cursor is touching an opening/closing bracket, not when the cursor is in the interior somewhere.

ultraGentle
  • 5,084
  • 1
  • 19
  • 45