microsoft / vscode

Visual Studio Code

Home Page:https://code.visualstudio.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extensions can't work with large files

HookyQR opened this issue · comments

VS Code doesn't provide the document element of the editor when a large file is open. This means that extensions can't get any file information at all.

Editing still works fine, even a (large number of) find/replace functions work.

Using registerTextEditorCommand fails to enter the callback function at all (presumably the exception is thrown when the arguments to the callback are created) and trying to access the document via the activeTextEditor in registerCommand fails (throws) when attempting to access the .document getter of the TextEditor object. Inspecting the activeTextEditor object shows that _documentData is undefined

I've had this failure with a 6MB file. Yet editing, and highlighting (JSON) work on a 16MB file.

Indeed, this is our current strategy for handling large files:

  • files < 5 MB get synced everywhere
  • files < 20MB get only colorization and don't get synced to the extension host (invisible to extensions), nor to web workers (no diff)
  • files > 20MB don't get colorization and don't get synced.

closing this cos this it is by design.