Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I enable syntax highlighting for a large C# file in Visual Studio Code?

I'm used to using Visual Studio 2017, but need to view, and possibly edit, a large generated C# file which crashes Visual Studio (both 2015 and 2017) if I open it.

The VS crash is a separate issue, but I have found I can open the file in Visual Studio Code and at least view the source without Code crashing.

However, the normal syntax highlighting seems to be turned off, although I have the recommended "C# for Visual Studio Code (powered by OmniSharp)" extension from Microsoft installed and smaller files correctly show syntax highlighting.

As almost a complete novice in using VSCode, how do I enable highlighting when it doesn't get turned on by default? For info, the generated file is about 1.1 million lines of C#.

like image 681
StarNamer Avatar asked Oct 24 '25 03:10

StarNamer


1 Answers

This could work:

"editor.largeFileOptimizations": false,
"files.maxMemoryForLargeFilesMB": 16384,
like image 67
Alex Avatar answered Oct 25 '25 15:10

Alex



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!