Skip to content

getOutliningSpans hangs on large, json-like file #27960

Closed

Description

@mjbvz

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:

Activity

  1. added
    BugA bug in TypeScript
    CrashFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad output
    on Nov 1, 2018
  2. DanielRosenwasser commented on Dec 1, 2018

    @DanielRosenwasser
    Member

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

  3. weswigham commented on Dec 1, 2018

    @weswigham
    Member

    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.

  4. sheetalkamat commented on Dec 1, 2018

    @sheetalkamat
    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.

  5. weswigham commented on Dec 1, 2018

    @weswigham
    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.

  6. weswigham commented on Dec 1, 2018

    @weswigham
    Member

    cc Anders Hejlsberg (@ahejlsberg) this case is a 6MB array literal.

  7. juozhe commented on Jul 5, 2019

    @juozhe

    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.

  8. locked as resolved and limited conversation to collaborators on Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugA bug in TypeScriptCrashFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad outputDomain: LS: TSServerIssues related to the TSServer

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions