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

Opening too large file crashes Viper IDE #285

Closed
Pointerbender opened this issue Jun 10, 2022 · 1 comment
Closed

Opening too large file crashes Viper IDE #285

Pointerbender opened this issue Jun 10, 2022 · 1 comment

Comments

@Pointerbender
Copy link

When opening files in Viper IDE that are (too) large, the Viper server throws an exception and this breaks Viper IDE so that it gives up permanently and a VS code restart is required.

The error that I'm getting is:

node:events:368
      throw er; // Unhandled 'error' event
      ^

Error: Parser cannot parse input: expected a value
    at c._processBuffer (~/.vscode/extensions/viper-admin.viper-2.4.2/server/index.js:2:625603)
    at c._transformBuffer (~/.vscode/extensions/viper-admin.viper-2.4.2/server/index.js:2:637101)
    at c._transform (~/.vscode/extensions/viper-admin.viper-2.4.2/server/index.js:2:637011)
    at c.Transform._write (node:internal/streams/transform:184:23)
    at writeOrBuffer (node:internal/streams/writable:389:12)
    at _write (node:internal/streams/writable:330:10)
    at c.Writable.write (node:internal/streams/writable:334:10)
    at h._write (~/.vscode/extensions/viper-admin.viper-2.4.2/server/index.js:2:620610)
    at writeOrBuffer (node:internal/streams/writable:389:12)
    at _write (node:internal/streams/writable:330:10)
Emitted 'error' event on h instance at:
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
[Info  - 12:38:07 PM] Connection to server got closed. Server will restart.
~/.vscode/extensions/viper-admin.viper-2.4.2/server/index.js:2
(()=>{var e={8327:(e,t,a)=>{"use strict";function r(){return"object"==typeof navigator&&"userAgent"in navigator?navigator.userAgent:"object"==typeof process&&"version"in process?`Node.js/${process.version.substr(1)} 

// -- SNIP -- this part is just the minified `index.js` inlined in the error message

[Error - 12:38:08 PM] Connection to server got closed. Server will not be restarted.

It looks like the default (internal) buffer used by vscode-languageserver/node-ipc to store IPC messages is not large enough to hold the file contents. I tried adjusting the viperSettings.advancedFeatures.verificationBufferSize to something larger, but this didn't help, because this buffer isn't instantiated until after the IPC message has been fully received, it seems.

Server.connection = createConnection(new IPCMessageReader(process), new IPCMessageWriter(process));

@ArquintL
Copy link
Member

ArquintL commented Oct 4, 2022

Seems to be fixed by #113. Please reopen and attach such a file if the problem persists with the latest pre-release

@ArquintL ArquintL closed this as completed Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants