Skip to content

feat: add max_ts_server_memory initialization option#91

Open
ShayanAbbas1 wants to merge 1 commit into
nathansbradshaw:mainfrom
ShayanAbbas1:add-max-ts-server-memory-option
Open

feat: add max_ts_server_memory initialization option#91
ShayanAbbas1 wants to merge 1 commit into
nathansbradshaw:mainfrom
ShayanAbbas1:add-max-ts-server-memory-option

Conversation

@ShayanAbbas1

Copy link
Copy Markdown

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:

Get definition via angular failed: Server reset the connection
Broken pipe (os error 32)
... via angular failed: server shut down

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 exposes maxTsServerMemory.

Change

Adds 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 angular_language_server_version / typescript_version options:

{
  "lsp": {
    "angular": {
      "initialization_options": {
        "max_ts_server_memory": 8192
      }
    }
  }
}

Left unset, behavior is unchanged.

Testing

  • cargo build and cargo fmt -- --check pass.
  • Installed as a dev extension and verified against the monorepo that exposed the problem: the server launches with --max-old-space-size=8192 and stays alive well past the point where it previously OOM-crashed; template go-to-definition works.
  • README section added documenting the option.

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.
@jpike88

jpike88 commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

your pr has conflicts, pleaes resolve them thanks

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

Successfully merging this pull request may close these issues.

2 participants