-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
Performant Bracket Pair Colorization #129231
Conversation
So this is getting built in instead of being in an extension? Have we thought about using dynamic imports for optional features like this so the bundle size doesn't keep growing? |
Yes, see discussion here. Properly exposing tokens to the extension host is a very hard problem - basically, the tokens would need to be recomputed by the extension host. This implemenation in the editor core solves both problems by efficiently reusing the existing token information and synchronously providing the decorations when the view requests them.
That is a nice idea! (In this case, I would rather match the two outer parentheses, as |
This looks related to issue: #96899 |
0676fbe
to
9fd6956
Compare
@rebornix I think this is ready for review. The last details took me quite a while. I will iterate on the performance. I had it at 50ms for checker.ts, but now it is 160ms again after I made it more correct and supported nested languages. I think the most important points for the review are:
Also, I will add more tests. Thanks! |
@@ -0,0 +1,104 @@ | |||
/*--------------------------------------------------------------------------------------------- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe move utilities that are editor agnostic into base
with some tests? I.e. we have map.ts
.
db047da
to
1c7e585
Compare
33bef27
to
8bbb559
Compare
Limit is 50k lines with an average of 100 characters per line, so that it just accepts |
@KROSF It's better to create separate issue as this is PR that already merged. |
is |
@sanket-bhalerao better to discuss it in #131001 |
microsoft/vscode#96899 microsoft/vscode#129231 Built-in bracket pair colorization will be released in VSCode 1.60. This commit will disable bracket pair colorization, because colors do not match the editor theme.
How to change colorsUp to 6 colors can be specified, according to the code in this PR. "workbench.colorCustomizations": {
"editorBracketHighlight.foreground1": "#896c74",
"editorBracketHighlight.foreground2": "#6c8289",
"editorBracketHighlight.foreground3": "#736c89",
"editorBracketHighlight.foreground4": "#74896c",
"editorBracketHighlight.foreground5": "#896c82",
"editorBracketHighlight.foreground6": "#89736c"
} |
Hello how are you. |
@carlosmgilp did you try the instructions at https://code.visualstudio.com/docs/getstarted/themes#_customizing-a-color-theme ? |
Hello, how are you? Thank you for your answer. These are the errors it shows me. Thanks. |
@carlosmgilp you need to remove the extra brackets on line 96 & 105: |
Hello brother, how are you? Thank you so much for your help and everyone's. |
See #132249. |
Hi @hediet thanks for your help. |
Before with some extension (~10.000ms):
After:
(<1 ms, more than 10k times faster)
More ToDos: #130767
"editor.bracketPairColorization.enabled": true
will enable this new feature!