skip to Main Content

Began occurring only a week ago.

I have been utilizing Visual Studio for modifying my entire my source code.
For months now, my .swift code file has exceeded 10,000 lines. Abruptly, everything starting from the 10,000th line is in black and white, while everything preceding that is in color.

I recently upgraded VS.

2

Answers


  1. This issue is similar to Javascript Files Lose Color Coding after 10000 lines of code,

    the Editor team changed this behavior in 17.11 to avoid excessive UI delays in certain files. JavaScript, TypeScript, and Razor all use textmate grammars for syntax classification, and VS triggers extra garbage collections when processing more than 10,000 lines for these files.

    Looks like this limitation is by design at this moment.

    You can try out these workarounds(Feature Flags extension/Set VsRegEdit) in above ticket to see it they help. As this similar question is reported and marked as Fixed – Pending Release, we can focus on this to see if there is any update.

    Besides, you can consider breaking up large source code files into smaller, more manageable pieces. This can help improve performance and maintain color formatting if it is convenient for you.

    Login or Signup to reply.
  2. The issue referenced by Dou Xu-MSFT has been updated, and a fix has been implemented in the latest release (17.12.0). You can update the line limit by going to Tools -> Options -> Text Editor -> Advanced, and update "TextMate parser line limit (required restart)".

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search