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

Unable to open an untitled document with large size content (approximate > 5MB) #32608

Closed
Huachao opened this issue Aug 16, 2017 · 2 comments
Closed
Assignees
Labels
api *duplicate Issue identified as a duplicate of another issue(s)

Comments

@Huachao
Copy link
Contributor

Huachao commented Aug 16, 2017

  • VSCode Version: 1.15.0
  • OS Version: macOS 10.12.2

Steps to Reproduce:

  1. Call the API workspace.openTextDocument({ 'language': language, 'content': content }) to open a new untitled document. If content is larger than 5MB, our code receives following error expected URI untitled:Untitled-1 to have come to LIFE

image

@Huachao
Copy link
Contributor Author

Huachao commented Aug 16, 2017

Maybe the cause is that the file content is larger than the sync limit https://github.com/Microsoft/vscode/blob/ae58b6765beca28c621aa6b4a3ba48630d58daff/src/vs/editor/common/model/textModel.ts#L115-L118

So in mainThreadDocument.ts won't add this to _modelIsSynced. https://github.com/Microsoft/vscode/blob/ae58b6765beca28c621aa6b4a3ba48630d58daff/src/vs/workbench/api/electron-browser/mainThreadDocuments.ts#L151-L154

Which finally caused the sync model check failed https://github.com/Microsoft/vscode/blob/ae58b6765beca28c621aa6b4a3ba48630d58daff/src/vs/workbench/api/electron-browser/mainThreadDocuments.ts#L238-L240

So if so, is this a right behavior for opening a large file size content? Maybe we should also check if it's larger than size limit, if larger, no error should be thrown.

@Huachao Huachao changed the title Unable to open an untitled document with large size content (approximate > 7MB) Unable to open an untitled document with large size content (approximate > 5MB) Aug 16, 2017
@alexdima
Copy link
Member

Yes, that constant is the root cause. Let's continue discussion in #32118, we should probably simply increase the constant.

@alexdima alexdima added the *duplicate Issue identified as a duplicate of another issue(s) label Aug 19, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api *duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

2 participants