Closed bernatp3rs closed 1 year ago
Thanks for reporting! Do you have a lot of code on your path? This is typically reported when the language server runs out of memory which happens between 1-2 million lines of code. If you view machine resources, it will be hovering around 3-4 GB and then it will crash.
To help troubleshoot more, I'll need more information about the logs to see if anything is reported there. You can easily access them from here:
Additionally, there might be another "IDL" output channel with more information that can be found in the outputs section (Ctrl + ` to open up, then navigate to "OUTPUT"):
Without logs, it's going to be tricky to identify what is going on.
My library is indeed quite extensive, but I've never experienced any issues before. Please find below the content of the Extension Log. It appears that there is a memory issue. Any ideas on how to fix this?
<--- JS stacktrace --->
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: 0x118d0a275 node::FatalException(v8::Isolate, v8::TryCatch const&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
2: 0x118d0a394 node::OnFatalError(char const, char const) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
3: 0x113391b90 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate, char const, v8::OOMDetails const&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
4: 0x113391b31 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate, char const, v8::OOMDetails const&) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
5: 0x11356b21e v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
6: 0x113542fb8 v8::internal::Factory::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [/Applications/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework]
7: 0x1121adccd v8::internal::FactoryBase
Thanks for the extra detail!
There's a few ways that you can work around this. I'm working on getting a basic troubleshooting doc and a better error message in the UI to help point users to what they need to do. We will likely explore additional ways to help reduce memory usage as we move forward, but it might be a few weeks before we have anything official, depending on what else might come up.
In the meantime, here is the content of that document to help get you up and running. If you have questions, feel free to add them to this thread!
This doc is a basic guide to walk through known issues with the language server and how you can work around them.
If you see errors such as " Connection to the language server got closed" or "The connection unexpectedly closed" means that there was a hard crash for the language server that requires a refresh of VSCode to start again.
At the time of writing this doc, the only known cause for this error is the server running out-of-memory.
There are two ways to work around the language server memory errors.
When the IDL extension starts, if it finds node.js on your path, it will automatically start the language server using node, which should remove this limitation. If you still see memory errors, then reach out to us on GitHub and let us know.
To install node.js, get the latest v18 release from https://nodejs.org/en/download/releases.
Once you install node.js, completely close and re-start VSCode (you may need to restart your computer so that it appears on your path).
We added an experimental feature which changes the way that we parse code on language server startup.
If you disable the "Language Server: Full Parse" setting then you should have much lower memory usage and faster startup times for large repositories or search paths.
However, it is experimental and you won't receive full diagnostics for a file until you start editing. But basic functionality such as go-to definition and hover help should work just fine.
I already have node.js installed on my computer (via brew):
brew list node /usr/local/Cellar/node/20.4.0/bin/node /usr/local/Cellar/node/20.4.0/etc/bash_completion.d/npm /usr/local/Cellar/node/20.4.0/include/node/ (63 files) /usr/local/Cellar/node/20.4.0/libexec/bin/ (2 files) /usr/local/Cellar/node/20.4.0/libexec/lib/ (2284 files) /usr/local/Cellar/node/20.4.0/share/doc/ (2 files) /usr/local/Cellar/node/20.4.0/share/man/man1/node.1
And I disabled the "Language Server: Full Parse" setting. However I keep having the same problems. Any other ideas?
I'm not very familiar with brew, but what happens if you run "node --version" from a terminal window? It might be best if you try this from a terminal in VSCode to see if it is found.
One more question, how much RAM does your computer have?
Another indicator is, on startup, you'll see output at the top of the log that let's you know what we start the language server using. Here's what this looks like for me:
node --version v20.4.0
My computer has 16Gb of RAM
idl-client info Starting the language server using: VSCode
It seems that node is not being loaded on startup
I also tried, downgrading node to version 18 node --version v18.16.1
But still the same problems: idl-client info Starting the language server using: VSCode
Actually, it looks like this might be a bug. I can reproduce on my Mac and I'm guessing there might be something odd about how we are trying to spawn node that work on Windows and not Mac (probably linux too).
Let me see if I can't figure out what's going on here.
Edit: Forgot to add that I published a new version of the extension as 3.0.6
which is live.
Alright, it should be fixed and working now. I made a small change and was able to verify that Windows and Mac will pick things up correctly.
I'm going to close this, and if the fix doesn't work, let me know and I'll re-open!
Current Behavior
The following 2 errors happen very often:
It's quite annoying because without the server we cannot use the "Go to definition" shortcut and we have to restart the editor.
Expected Behavior
This is something that was not happening before
GitHub Repo
No response
Steps to Reproduce
Failure Logs
No response
Operating System
IDL Version
8.5.1
Additional Information
No response