feat: add max_ts_server_memory initialization option#91
Open
ShayanAbbas1 wants to merge 1 commit into
Open
Conversation
In large workspaces (e.g. Nx monorepos) the Angular language server can exceed node's default heap limit (~4 GB) while loading the project graph, causing it to crash and restart in a loop (request timeouts followed by 'server shut down' in Zed's logs). Add an opt-in max_ts_server_memory initialization option (in MB), passed to node as --max-old-space-size, following the same pattern as the existing version options. Left unset, behavior is unchanged.
Collaborator
|
your pr has conflicts, pleaes resolve them thanks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In large workspaces (e.g. Nx monorepos), the Angular language server exceeds node's default heap limit (~4 GB) while loading the project graph and crashes. Zed restarts it, it crashes again — an endless loop where template navigation and completions never work. In Zed's logs this shows up as escalating request timeouts followed by:
On my Angular 19 monorepo (~10 apps, ~20 libs) the server died every ~3 minutes, 11 restarts in a day, and was effectively unusable. Other node-based servers in Zed already handle this — e.g. Zed launches eslint with
--max-old-space-size=8192, and vtsls exposesmaxTsServerMemory.Change
Adds an opt-in
max_ts_server_memoryinitialization option (in MB), passed to node as--max-old-space-size, following the same pattern as the existingangular_language_server_version/typescript_versionoptions:{ "lsp": { "angular": { "initialization_options": { "max_ts_server_memory": 8192 } } } }Left unset, behavior is unchanged.
Testing
cargo buildandcargo fmt -- --checkpass.--max-old-space-size=8192and stays alive well past the point where it previously OOM-crashed; template go-to-definition works.