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

Disable bracket pair colorization via color theme #148859

Open
jusmarks opened this issue May 6, 2022 · 13 comments
Open

Disable bracket pair colorization via color theme #148859

jusmarks opened this issue May 6, 2022 · 13 comments
Assignees
Labels
bracket-pair-colorization feature-request Request for new features or functionality
Milestone

Comments

@jusmarks
Copy link

jusmarks commented May 6, 2022

I know this can be disabled via settings.json with "editor.bracketPairColorization.enabled": false,, but I need to disable it via my color theme such that it is only disabled when my theme is active.

The only solution I can find for now is to explicitly set colors for

editorBracketHighlight.foreground1
editorBracketHighlight.foreground2
editorBracketHighlight.foreground3
editorBracketHighlight.foreground4
editorBracketHighlight.foreground5
editorBracketHighlight.foreground6

but this is cumbersome...

@jusmarks
Copy link
Author

jusmarks commented May 6, 2022

P.S. I hope this new feature is just an experiment... it really ought to be disabled by default.

@renxzen
Copy link

renxzen commented May 6, 2022

Thank you, i was able to "fix" my vscode. It was really troublesome. I can see how this feature could help people but it should be disabled by default. Made me think that my theme was broken.

@michael-etzkorn
Copy link

michael-etzkorn commented May 6, 2022

P.S. I hope this new feature is just an experiment... it really ought to be disabled by default.

I was looking to see if anyone else was saying the same thing. SystemVerilog (which "brackets" with class endclass function endfunction) with this on looks like an ugly christmas tree. Plus, words like interface endinterface sometimes don't have the end pair but are still valid syntax. Doesn't stop this bracket highlighter from marking them red. Glad you pointed out how to turn it off. This isn't even to mention how the default dark theme's gold highlighting looks off putting.

@dsrkafuu
Copy link

dsrkafuu commented May 6, 2022

Agree that. The default bracket color looks really bad when using certain themes.
There should be options for theme makers to disable this feature or specific tokens to customize it.

20220506131655

@hediet
Copy link
Member

hediet commented May 6, 2022

Maybe we can check if a theme sets all bracket colors to #000000 and disable the feature automatically if that is the case.

@hediet hediet added feature-request Request for new features or functionality bracket-pair-colorization labels May 6, 2022
@hediet hediet added this to the May 2022 milestone May 6, 2022
@stijnherreman
Copy link

P.S. I hope this new feature is just an experiment... it really ought to be disabled by default.

See the release notes for 1.67:

Given the positive feedback of the new bracket pair colorization feature introduced in the 1.60 release, we enabled bracket pair colorization by default.

@michael-etzkorn
Copy link

michael-etzkorn commented May 6, 2022

P.S. I hope this new feature is just an experiment... it really ought to be disabled by default.

See the release notes for 1.67:

Given the positive feedback of the new bracket pair colorization feature introduced in the 1.60 release, we enabled bracket pair colorization by default.

Perhaps this merits a new issue, but there should at least be an easier way to disable it then if it's going to be on by default. I doubt there was much negative feedback when it was default disabled.

@jusmarks
Copy link
Author

jusmarks commented May 6, 2022

Closing this issue because it seems the real issue is whether this feature should even be enabled by default to begin with.

@hediet
Copy link
Member

hediet commented May 9, 2022

I actually think this feature request is reasonable and might be a good compromise between enabling the feature by default and not ruining themes.

@hediet hediet reopened this May 9, 2022
@AjayChambers
Copy link

AjayChambers commented May 20, 2022

The Default Activation of the bracketPairColorization Feature did not Fuel the Negative Response Alone


The link below is an answer that I authored on Stack Overflow. I was completely unaware of the response it would get at the time. VS Code had activated the bracketPairColorization by default, and before I even installed the new release (which I always do within 1-12 hours of each release) this question was asked. I was surprised to see the first few people shrug the question of as not being important enough to answer with anything more than a brief comment. Because I was a fan of the new feature (though I don't use it in its fullness) I thought I would answer the question with the sort of answer it deserved. The answer I authored took me nearly 2 hours. Shortly after, it started getting up-votes. Since then it has gotten at-least one, sometimes 4 or 5, up-votes a day. For stack overflow, that is really good.

Disabling bracketPairColorization

I soon noticed that my answer wasn't the only one floating around, there were 2 others, however, the response they got was not nearly as warm. One of them sat at -1 before the author deleted it. After a short while I realized why people were up-voting the answer I gave.



In the answer, I suggested turning of the colorization of the bracket-pairs via "editor.bracketPairColorization.enabled": false, however; I continued to denounce the following:

After the editor.bracketPairColorization feature was released, two other features, that were part of the same group, were released. All of the settings for that group is as follows:

  • "editor.bracketPairColorization.enabled"
  • "editor.guides.bracketPairsHorizontal": false
  • "editor.guides.highlightActiveBracketPair": false

This is not the end of the story though. Before the three features released, the following two settings already existed.

  • "editor.guides.indentation": false
  • "editor.guides.highlightActiveIndentation": false

If you fail to disable them all, it may seem like parts of the bracketPairColorization feature are remaining on, despite disabling them, therefore, I suggest the following configuration for those who want the feature completely disabled.

  {
      // Bracket-pair colorization
      "editor.bracketPairColorization.enabled": false, 

      // Bracket-pair guides
      "editor.guides.bracketPairsHorizontal": false,
      "editor.guides.highlightActiveBracketPair": false,

       // Indentation guides
      "editor.guides.indentation": false,
      "editor.guides.highlightActiveIndentation": false
  }

The Purpose for Authoring this...

...is because, I feel that the negative reaction was magnified by how hard it was to configure the editor back to its normal state. The fact that there are 4 different settings for activating editor.guides, that there are editor.guides.indentation and editor.guides.BracketPairs, and that the bracket-pair guides were activated by default along-side the bracketPairColorization feature was what frustrated people.

When it was just activated by default, people looked for a single setting to disable the feature. When they set "editor.bracketPairColorization.enabled" to false, many were confused why there were lines still being highlighted in the editor.

Another thing that was not good, happened to people like myself. I knew about the feature, I read about it in all of the new release statements, and any documentation added to the docs, therefore; I new what settings to enable, which settings had values that could be set to something other than true or false, and had the features all set in my user settings.json such that the feature rendered as I desired. Then the feature was enabled by default, consequently; the settings that I wanted to be set to there default value, were not in my settings.json file. They were not there, not because I removed them, but because VS Code removed them by default. Then, from my perspective, VS Code switched what the default values for those settings were, and it screwed up my entire configuration for the feature. I had to stop working to figure out how to fix it, because in truth, when the feature isn't what you want, it can feel very invasive, which is another problem.

This would also lead me to argue that if I use the VS Code settings explorer (rather than manually authoring my user settings.json file to configure vscode), it should not remove any settings that I manually added to the settings.json file. My justification for this is that the default changes you guys made, would not have affected me if that were the case.

Anyways, that's how I feel about the issue.


@awiebe
Copy link

awiebe commented May 25, 2022

Maybe it's just not easy to choose appropriate bracket pair color easily based on theme. I think it should at least be off and at least ask me if I want it on.

When I upgraded and this feature was automatically on, I thought MS had just broken the default dark theme by choosing insane colorization for my brackets.

Against the dark background the choice of neon magentas and oranges not only did not help me find my bracket pairs, it was an absolute assault on the eyes.

I think a much better solution would just to be to highlight the region which corresponds to a closure in an overlay box.

@hediet hediet modified the milestones: May 2022, June 2022 Jun 2, 2022
@hediet hediet modified the milestones: June 2022, July 2022 Jul 1, 2022
@surfinzap
Copy link

as a theme creator, I would welcome an option to enable/disable/customize bracket colorization for specific languages.

@hediet hediet modified the milestones: July 2022, On Deck Jul 14, 2022
@jusmarks
Copy link
Author

jusmarks commented Apr 19, 2023

For preexisting themes that are negatively affected by this feature, I believe the best solution that doesn't require them to be updated is to have bracket pair colorization enabled by default but have the six editorBracketHighlight.foreground properties be transparent by default, and editorBracketHighlight.unexpectedBracket.foreground be unset. Themes would need to set these properties explicitly or else inherit the transparent values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bracket-pair-colorization feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

9 participants