-
Notifications
You must be signed in to change notification settings - Fork 676
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
Editor and file list stops responding #1086
Comments
Hmmm... this happens without a C# project, so it's like a problem in the syntax grammar. |
It seems like there's some sort of exponential performance issue in the VS Code syntax highlighting that is exposed by our current C# syntax grammar. This is easily reproduced like so:
class C
{
Type1<Type2<object> field;
} It should be pretty much instantaneous.
class C
{
Type1<Type2<object, object> field;
} It'll take longer, but the paste will succeed after a few seconds.
class C
{
Type1<Type2<object, object, object> field;
} Now it takes so long that the window stops responding. |
@jrieken, @alexandrudima, this clearly an issue with the syntax grammar. Do either of you have any ideas for how to diagnose this problem? Is it a VS Code issue or a problem with the grammar itself? |
The troublesome regular expression appears to be:
|
cc @ivanz |
Looking at the TypeScript grammar it appears that type names are handled quite a bit differently. First, there's "type-name", which just has two patterns:
Then, there's "type-parameters", which has several patterns that reference This seems a better approach than using |
FWIW, I won't be able to look at this until the holiday is over. However, @pmatyja and @NinoFloris, to workaround the issue (for now), please do the following:
That should address the performance issue though it'll leave some minor colorization issues in your code. |
I'm going to tweak the grammar in the release branch with that change and upload a new release. |
@ivanz: I've checked in the workaround for this issue. It's not great, and it required updating the test baselines, but the effect on the user-visible syntax highlighting isn't too bad. Essentially, there are now cases where outer |
Sorry about this gents. I will have a look at this after the holidays as well. The recursive regex should selectively be applied to very small sections of texts. Smells like it's not terminating when it should. Will have a look. Thanks for the quick workaround @DustinCampbell |
I had a scan through your branch and it looks fantastic 👍 - great work @DustinCampbell ! Looking forward to seeing this merged :) Happy New Year everyone! |
Problem
Editor and file list stops responding.
One of the task has 12% CPU utilization.
Environment data
.NET Command Line Tools (1.0.0-preview2-1-003177)
Product Information:
Version: 1.0.0-preview2-1-003177
Commit SHA-1 hash: a2df9c2576
Runtime Environment:
OS Name: Windows
OS Version: 10.0.14393
OS Platform: Windows
RID: win10-x64
VS Code version: 1.8.1
C# Extension version: 1.6.1
Steps to reproduce
Create new C# code file and paste code below.
Then try to remove '>' character from this line
The text was updated successfully, but these errors were encountered: