dotnet / csharp-tmLanguage

Syntax grammar used for C# colorization
MIT License
69 stars 34 forks source link

VSCode hangs with 100% CPU in Code Helper process when viewing specific file #76

Open aeschli opened 7 years ago

aeschli commented 7 years ago

From @akoeplinger on June 23, 2017 12:8

Extension Author Version
vscode-markdownlint DavidAnson 0.9.1
vscode-docker PeterJausovec 0.0.16
sort-lines Tyriar 1.3.0
githistory donjayamanne 0.2.0
python donjayamanne 0.6.5
cpptools ms-vscode 0.11.4
csharp ms-vscode 1.10.0
mono-debug ms-vscode 0.15.6
Ruby rebornix 0.12.1 ;

Steps to Reproduce:

  1. mkdir vscodehang && cd vscodehang
  2. wget https://raw.githubusercontent.com/mono/mono/c7b19b52fd671233cf2daab451f09c7591c859b1/mcs/class/Mono.Security/Mono.Xml/MiniParser.cs
  3. code .
  4. Open MiniParser.cs
  5. VSCode gets unresponsive and offers to reopen window

Copied from original issue: Microsoft/vscode#29319

aeschli commented 7 years ago

From @jens1o on June 23, 2017 12:18

Can reproduce this in latest insider, even when only pasting the file contents from https://raw.githubusercontent.com/mono/mono/c7b19b52fd671233cf2daab451f09c7591c859b1/mcs/class/Mono.Security/Mono.Xml/MiniParser.cs

aeschli commented 7 years ago

From @isidorn on June 23, 2017 14:31

I can also repro, vscode crashes, might be a text mate grammer going inffinite. Adding important since we crash

aeschli commented 7 years ago

Reproduced with

private static readonly ushort[] tbl = {
        (ushort)(((ushort)CharKind.LEFT_BR << 12) | ((ushort)ActionCode.STATE_CHANGE << 8) | 1),

and adding additional

(ushort)(((ushort)CharKind.LEFT_BR << 12) | ((ushort)ActionCode.STATE_CHANGE << 8) | 1),

array items brings TextMate to a standstill.

DustinCampbell commented 7 years ago

@aeschli: I can reproduce this as well. Any tips on how to debug this sort of issue?

DustinCampbell commented 7 years ago

Note: I can reproduce it by adding array items on the same line, but not by adding them on separate lines.