Allow configuring exec args (e.g. --max-old-space-size) for ESLint LSP #40330
reekystive
started this conversation in
Language Support
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The Issue
Currently, the Node.js argument
--max-old-space-size=8192is hardcoded in crates/languages/src/typescript.rs for launching the ESLint language server.For large repositories, 8 GB of memory may not be sufficient, and there is no existing way for users to adjust Node.js arguments used by the ESLint LSP process.
Zed already supports a global Node configuration at the top level:
This applies to all Node-based LSP servers such as ESLint and vtsls.
For vtsls, users can further configure Node.js-related settings via:
This allows users to fine-tune the TypeScript server’s memory usage and runtime path, with the specified runtime path taking precedence over the global
node.pathsetting.However, there is currently no equivalent configuration for the ESLint LSP, making it impossible to adjust its Node.js memory limit. While the global runtime can be changed via the node.path setting, there is no way to modify the memory limit — either globally or locally.
Proposal
Add support for per-server Node.js configuration for ESLint (and potentially other Node-based LSPs), for example:
Proposed keys
execArgv: Allows specifying arbitrary Node.js arguments (e.g. memory limits or debug flags).runtime: Allows specifying the Node.js executable path (useful for environments managed by nvm, Volta, etc.).Benefits
Motivation
Relevant code location:
zed/crates/languages/src/typescript.rs
Lines 592 to 598 in 35f5eb1
Beta Was this translation helpful? Give feedback.
All reactions