-
Notifications
You must be signed in to change notification settings - Fork 29.2k
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
Slow syntax highlighting #64681
Comments
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. |
Excellent. Hope to see it implemented ASAP. |
Is fix coming? @bpasero |
Has this been fixed?! It's been almost 9 freaking months!!! |
@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. |
Open sqlite3 which is pretty large. |
@optomux After processing the 223k loc If you are having similarly long times on significantly shorter files, there may still be an issue in the grammar, however. |
@alexdima are there plans to do this? |
It would be great to improve this with multi-threading, quite annoying to wait for syntax update in large amalgamated source code after every tiny change by an external application. |
I have the same issue after updating the C++ extension to version 0.28.*. I reinstall it back to version 0.27.1 and it fixes the issue partly. The color isn't still rendered too fast but at least version 0.27 is much better. |
It looks like the work in #77140 may help solve this but I’m not 100% sure |
for me still not working here ... |
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. |
I just installed VS Code to try it. |
The highlighting starts doing like in Balrrach's GIF for me when I activate CPP intelisense |
Is there a plan to fix this 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. |
@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. |
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. |
Is there a solution yet? i really like my custom theme. |
Has anyone managed to fix this? |
Since this thread was created tokenization has been made asynchronous, this may help somewhat, I haven't tried the Secondly, TreeSitter should help with tokenization and syntax highlighting but faces some challenges, you can follow the thread here: #50140 |
2 (somewhat works) approach
|
how to fix this issue 😭, happened to me too 2024-03-28.19-07-44.mp4need to scroll first then the color changes to gray (comment color) |
Turn off enhanced colonization.
…On Thu, Mar 28, 2024, 6:02 PM xhttp.res ***@***.***> wrote:
how to fix this issue 😭, happened to me too
https://github.com/microsoft/vscode/assets/49369600/bf23e52b-7839-4461-8e47-532815cad1df
—
Reply to this email directly, view it on GitHub
<#64681 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXHBODQCNKZZF2AHCF4LTSDY2QEWBAVCNFSM4GJIENV2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBSGUYDONRVGIZQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
i'm work with javascript btw |
I am working with C++, and the option to disable enhanced colonization is
available under the C/C++ extension.
…On Thu, Mar 28, 2024, 6:32 PM xhttp.res ***@***.***> wrote:
i'm work with javascript btw
—
Reply to this email directly, view it on GitHub
<#64681 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXHBODRGLWYCHHFBCCT7XTLY2QIFBAVCNFSM4GJIENV2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBSGUYTGMBTGU2A>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
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.
…On Thu, Mar 28, 2024, 6:32 PM xhttp.res ***@***.***> wrote:
i'm work with javascript btw
—
Reply to this email directly, view it on GitHub
<#64681 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXHBODRGLWYCHHFBCCT7XTLY2QIFBAVCNFSM4GJIENV2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBSGUYTGMBTGU2A>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Steps to Reproduce:
Does this issue occur when all extensions are disabled?: Yes
The text was updated successfully, but these errors were encountered: