Skip to content
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

getOutliningSpans hangs on large, json-like file #27960

Closed
mjbvz opened this issue Oct 18, 2018 · 6 comments
Closed

getOutliningSpans hangs on large, json-like file #27960

mjbvz opened this issue Oct 18, 2018 · 6 comments
Assignees
Labels
Bug A bug in TypeScript Crash For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output Domain: TSServer Issues related to the TSServer
Milestone

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Oct 18, 2018

From microsoft/vscode#60677

TypeScript Version: 3.2.0-dev.20181017

Search Terms:

  • getOutliningSpans
  • fold / folding

Code

  1. Open this file javaScript file in VS Code: dict_en.txt

  2. Notice that intellisense and other features do not work.

Bug
This is caused by the getOutliningSpans request never returning. We do try to cancel the request on the VS Code side when you switch away from that file but it seems the TS Server does not pick up the cancellation

Playground Link:

Related Issues:

@mjbvz mjbvz added the VS Code Tracked There is a VS Code equivalent to this issue label Oct 18, 2018
@mjbvz mjbvz removed VS Code Tracked There is a VS Code equivalent to this issue labels Nov 1, 2018
@weswigham weswigham added Bug A bug in TypeScript Domain: TSServer Issues related to the TSServer Crash For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output labels Nov 1, 2018
@weswigham weswigham added this to the TypeScript 3.2.2 milestone Nov 29, 2018
@DanielRosenwasser
Copy link
Member

We can possibly pick an aribtrary high count of nodes to traverse and check the cancellation token ever n nodes traversed.

@weswigham
Copy link
Member

weswigham commented Dec 1, 2018

The cancellation token disk access is already throttled. We don't need to meter when we check it, we just need to check it more.

@sheetalkamat
Copy link
Member

While at it I noticed that before carrying out operation we check for cancellation token and that is not throttled. (https://github.com/Microsoft/TypeScript/blob/master/src/server/session.ts#L556) we should use throttled cancellation token there as well.

@weswigham
Copy link
Member

So I think this is actually a dupe of #28540, because I'm tracking us as being stuck inside subtype reduction in the checker most of the time. If that's so, we have two candidate fixes up already, #28707 and #28727.

@weswigham
Copy link
Member

cc @ahejlsberg this case is a 6MB array literal.

@juozhe
Copy link

juozhe commented Jul 5, 2019

The problem with original file (dict-en.txt, or .js) is fixed for me in VS Code 1.36. I reported the original bug microsoft/vscode#60677.

Thanks. If no other related problems are tracked under this ticket, it can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Crash For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output Domain: TSServer Issues related to the TSServer
Projects
None yet
Development

No branches or pull requests

6 participants