zed icon indicating copy to clipboard operation
zed copied to clipboard

"typescript.tsserver.maxTsServerMemory" VSCode equivalent

Open maschwenk opened this issue 11 months ago • 2 comments

Check for existing issues

  • [X] Completed

Describe the feature

VSCode recently opened up support for spawning a separate Typescript Language Server for really large projects so that you can set higher memory limits. Without this, my large Typescript monorepo is frequently hitting a 4GiB memory limit and hitting:

[lspserver] [tsclient] [tsserver] Exited. Code: null. Signal: SIGABRT

If applicable, add mockups / screenshots to help present your vision of the feature

No response

maschwenk avatar Mar 04 '24 12:03 maschwenk

This is actually already possible in the LSP settings since it passes the JSON you sent over through to the LSP - https://github.com/zed-industries/zed/blob/main/crates/languages/src/typescript.rs#L156-L173

And based on the ts language server settings, we can set that - https://github.com/typescript-language-server/typescript-language-server/blob/master/docs/configuration.md#initializationoptions

So doing this in the settings worked

  "lsp": {
    "typescript-language-server": {
      "initialization_options": {
        "maxTsServerMemory": 8192
       }
     }
   }

rgoomar avatar Mar 04 '24 16:03 rgoomar

Excellent, I’ll leave this open for a moment just in case maintainers might want to make this more of a first class thing, but I think this is enough of a fringe issue having this Issue googleable is pretty sufficient.

maschwenk avatar Mar 04 '24 17:03 maschwenk

Just wrote about my performance issue (#8884).

I tried to increase maxTsServerMemory to 8192 but that doesn't seem to fix my tsserver speed issue.

baptisteArno avatar Mar 05 '24 14:03 baptisteArno

Going to close because that fixed our issue, so really just a matter of discoverability. Feel free to reopen!

maschwenk avatar Mar 05 '24 16:03 maschwenk

thank you! same problem, i used nvim-lspconfig tsserver, it's worked.

pphboy avatar Apr 30 '24 13:04 pphboy

omg, finally figured it out, thanks!

dimuuu avatar Jun 26 '24 09:06 dimuuu