You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Observe the slowness. Takes like 10s to highlight the code.
Does this issue occur when all extensions are disabled?: Yes
Reacted by Francisco Lourenço, Adam Żaczek, Stanislav Denisov, Jason Williams, Ashutosh Kumar, Molly Wang, Max Sysoev, Aryan Pathania, Berend Klein Haneveld, Korijn van Golen and 29 more
Today, syntax highlighting is running on the main thread and is implemented by constantly yielding in order to keep the thread responsive. The speed is further influenced by the grammar. This can be improved if we move the tokenization to a separate thread.
Reacted by Zulfikar, Nevrai and Allan Leander Rostock Hansen
@optomux After processing the 223k loc sqlite.c There does not seem to be much that can be done on the grammar side. While it did take 11.7 seconds to evaluate the patterns inside the grammar, no individual pattern took an unexpectedly long amount of time.
If you are having similarly long times on significantly shorter files, there may still be an issue in the grammar, however.
Today, syntax highlighting is running on the main thread and is implemented by constantly yielding in order to keep the thread responsive. The speed is further influenced by the grammar. This can be improved if we move the tokenization to a separate thread.
Is there a plan to fix this problem?
If so, how long will it take?
Is it a hard problem to solve or a design problem?
As I mentioned in my comment above it looks like the work to fix this was moved to this thread #77140 it might be worth asking there. It looks to have gone dark.
If I'm not mistaken VS Code extended syntax coloring behaviour by including the extension "Better C++ Syntax" to the base program. Well, I have observed that this problem only occurs with tokens that are not colorised with the standard VS Code syntax highlighting. In the next gif one can observed how the Strings in the cout get quickly green color when the line gets commented but, on the other hand, the rest of the tokens in the line take much longer.
Thus, I think this issue is strongly related to the way "Better C++ Syntax" extension works internally so the fix goes by adding the behaviour the extension provides to the base program in the way it is done with the base syntax highlighting.
Is there a solution yet? i really like my custom theme.
Since this thread was created tokenization has been made asynchronous, this may help somewhat, I haven't tried the sqlite.c example above so I don't know how different performance is today compared to then.
Secondly, TreeSitter should help with tokenization and syntax highlighting but faces some challenges, you can follow the thread here: #50140
as roch (@ebkgne) mentioned: turning off the enhanced color ( form setting Ctrl +, ) And search for enhanced colorization. disable that.
If enhanced colorization is so damn necessary consider increasing the IntelliSense speed . in setting search for Intelli Sense Update Delay and make it 500 (minimum possible)
The issue for me started when I tweaked some token color parameter manually
to customize the look of the code. If you just use the default color scheme
or any theme extensions, without manually changing the token color then it
may resolve the issue.
Activity
alexdima commentedon Dec 11, 2018
Today, syntax highlighting is running on the main thread and is implemented by constantly yielding in order to keep the thread responsive. The speed is further influenced by the grammar. This can be improved if we move the tokenization to a separate thread.
ci70 commentedon Dec 11, 2018
Excellent. Hope to see it implemented ASAP.
ci70 commentedon Dec 12, 2018
Is fix coming? Benjamin Pasero (@bpasero)
https://www.youtube.com/watch?v=nDRBxtEUOFE
ci70 commentedon Aug 8, 2019
Has this been fixed?! It's been almost 9 freaking months!!!
matter123 commentedon Aug 8, 2019
@optomux I co-maintain the C++ grammar if this still appears broken, could you create an issue in https://github.com/jeff-hykin/cpp-textmate-grammar with an example file that reproduces. Alternatively, if the file is confidential, I can provide steps to collect performance information without revealing the file.
ci70 commentedon Aug 8, 2019
Open sqlite3 which is pretty large.
matter123 commentedon Aug 8, 2019
@optomux After processing the 223k loc
sqlite.cThere does not seem to be much that can be done on the grammar side. While it did take 11.7 seconds to evaluate the patterns inside the grammar, no individual pattern took an unexpectedly long amount of time.If you are having similarly long times on significantly shorter files, there may still be an issue in the grammar, however.
jasonwilliams commentedon Dec 11, 2019
Alexandru Dima (@alexdima) are there plans to do this?
6 remaining items
ebkgne commentedon Jul 19, 2021
The highlighting starts doing like in Balrrach's GIF for me when I activate CPP intelisense
Balrrach commentedon Jul 22, 2021
Is there a plan to fix this problem?
If so, how long will it take?
Is it a hard problem to solve or a design problem?
jasonwilliams commentedon Jul 22, 2021
As I mentioned in my comment above it looks like the work to fix this was moved to this thread #77140 it might be worth asking there. It looks to have gone dark.
ebkgne commentedon Aug 13, 2021
Baltasar del Sol de Haro (@Balrrach) & others with this problem
because this latency really bothered me while coding, I prefer to use standard code colorization for the time being.
Go to settings (ctrl + ,) look for "C_cpp: Enhanced Colorization" and set it to "Disabled" .
I also found the extension "Syntax Highlighter" wich does a good job at better colorizing with much more managable latency.
SebiTimeWaster commentedon Dec 14, 2021
a 78KB HTML file takes FIFTEEN MINUTES to color code in which VSCode is completely unresponsive and my OS wants to kill the task.
ARE YOU FOR REAL.
shubhamvermaa commentedon Jul 1, 2023
Is there a solution yet? i really like my custom theme.
bpGusar commentedon Dec 6, 2023
Has anyone managed to fix this?
jasonwilliams commentedon Dec 6, 2023
Since this thread was created tokenization has been made asynchronous, this may help somewhat, I haven't tried the
sqlite.cexample above so I don't know how different performance is today compared to then.Secondly, TreeSitter should help with tokenization and syntax highlighting but faces some challenges, you can follow the thread here: #50140
RabiulAwalOvi commentedon Dec 30, 2023
2 (somewhat works) approach
Ctrl+,) And search for enhanced colorization. disable that.Intelli Sense Update Delayand make it 500 (minimum possible)d-strygwyr commentedon Mar 28, 2024
how to fix this issue 😭, happened to me too
2024-03-28.19-07-44.mp4
need to scroll first then the color changes to gray (comment color)
shubhamvermaa commentedon Mar 28, 2024
d-strygwyr commentedon Mar 28, 2024
where ? i can't found it 😭
d-strygwyr commentedon Mar 28, 2024
i'm work with javascript btw
shubhamvermaa commentedon Mar 28, 2024
shubhamvermaa commentedon Mar 28, 2024