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

Indent Guide Coloring #130379

Closed
sooxt98 opened this issue Aug 9, 2021 · 10 comments
Closed

Indent Guide Coloring #130379

sooxt98 opened this issue Aug 9, 2021 · 10 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s)
Milestone

Comments

@sooxt98
Copy link

sooxt98 commented Aug 9, 2021

Is it possible to archive this? I saw both intellij and vs2017 are able to archive it with plugins
image
image

@gjsjohnmurray
Copy link
Contributor

pinging @hediet because of #129231

@hediet hediet self-assigned this Aug 9, 2021
@hediet hediet added the feature-request Request for new features or functionality label Aug 9, 2021
@hediet
Copy link
Member

hediet commented Aug 9, 2021

I will explore this after #129231 landed.

However, I'm sure there are some extensions that do this (although they might be slow)!

@hediet hediet modified the milestones: Backlog Candidates, Backlog Aug 9, 2021
@microsoft microsoft deleted a comment Aug 9, 2021
@ArturoDent
Copy link

Some info here: https://stackoverflow.com/questions/47942390/how-to-change-indent-guide-line-color-between-brackets-in-vscode

I am sure I have seen an extension that does what you seek but I can't find it now.

@sooxt98
Copy link
Author

sooxt98 commented Aug 12, 2021 via email

@jjspace
Copy link

jjspace commented Sep 3, 2021

I use indent-rainbow to acheive a similar effect, it's not the guides themselves but it still gives each indent level a color which is helpful https://marketplace.visualstudio.com/items?itemName=oderwat.indent-rainbow

@thoroc
Copy link

thoroc commented Oct 23, 2021

Would be nice to see the functionality of the extension folded into vscode proper. one less extension to load.

@smdsbz
Copy link

smdsbz commented May 23, 2022

I currently use settings for the native bracket pair feature to achieve such visual. However, I found the colors too distracting and configured it so it shows no color only contrast 😂 , effectively as a bracket-aware indent guide.

Here's the config I use, you may apply whatever color scheme you prefer
image

Which gives me such result
image


Limitations

  1. It seems that it only supports 6 levels thou, the 7th will cycle back to the 1st level.

  2. A downside of this approach is that bracket pair does not work for languages that do not use bracket, e.g. Python, HTML.

  3. Cascaded non-active indent guides will result in a mix of colors (since background must be transparent, explained later). In my case they are just slightly brighter than others since I only use one color (see the guide under pmem::obj::transaction, which is an addition of transaction::run() and a lambda body [&] {}).

Hack for cascaded guides

Note that the color for background must be transparent, otherwise cascaded brackets that share the same indentation level (e.g. C++ lambda as callback parameter, non-indented switch-case format) will not highlight correctly, as if background is on top of activeBackground.

switch (...) {
|   | <-- here is your cursor
| <-- this will highlight as `activeBackground`, which is of course
case XXXX: {
|
| <-- this will highlight as `background` (i.e. the case's `{}` level),
|     **NOT** `activeBackground` (i.e. the switch's `{}` level),
|     which will probably be a dimmed color and not what you want
|
}
break;
}
image
This is what will happen if you use solid colors (background = #333333 and activeBackground = #777777). The indent guide pointed to by red arrow really should adopt activeBackground, but instead it just shows background.

Therefore background must be transparent, so activeBackground can shine through. Unfortunately, it also allows other levels' background shine through, and can end up with a disastrous color mix if you rely on different colors to distinguish between indent levels.

@hediet hediet added *duplicate Issue identified as a duplicate of another issue(s) and removed feature-request Request for new features or functionality labels Dec 7, 2022
@vscodenpa
Copy link

Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for similar existing issues. See also our issue reporting guidelines.

Happy Coding!

@vscodenpa vscodenpa closed this as not planned Won't fix, can't repro, duplicate, stale Dec 7, 2022
@0x5c
Copy link

0x5c commented Dec 7, 2022

What is the issue this one is a duplicate of?

@hediet
Copy link
Member

hediet commented Dec 8, 2022

These are bracket pair guides.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

10 participants