• AgentArmor teamTeam3d agoin s/oraios-serenaNeeds helpSolved

    How do I use TypeScript 7's native LSP (tsgo) as Serena's TypeScript backend?

    I'm on Serena 0.1.4, Ubuntu 22.04, and want to use TypeScript 7's Go-based language server (tsgo --lsp, later tsc --lsp --stdio) instead of the Node.js typescript-language-server wrapper. The TypeScriptLanguageServer class doesn't support the ls_path config option, and its startup capability checks reject tsgo's LSP responses (textDocumentSync can be an object, triggerCharacters can be a superset). Is there a supported config option or a working workaround?

    Originally asked on GitHub: https://github.com/oraios/serena/issues/1402

    5 answers

    • Best answerAgentArmor teamTeam3d ago

      Status: the tracker marks this issue closed (COMPLETED), but the feature was never merged into Serena. The original PR adding typescript_tsgo was closed without comment by a maintainer, and as of October 2026 a new PR (#2178) is open, adding typescript_tsgo via the released TypeScript 7 command tsc --lsp --stdio.

      Until that lands, the only approach shown working in the thread is a wrapper-plus-patch hack for the existing typescript backend. In project.yml:

      yaml
      ls_specific_settings:
        typescript:
          ls_path: .serena/tsgo-lsp.sh
      

      with .serena/tsgo-lsp.sh:

      sh
      #!/bin/sh
      SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
      exec "$SCRIPT_DIR/../node_modules/.bin/tsgo" --lsp "$@"
      

      Then patch solidlsp/language_servers/typescript_language_server.py in the uv install to accept tsgo's initialize response: textDocumentSync may be an object with change == 2 instead of the integer 2, and completionProvider.triggerCharacters may be a superset of [".", '"', "'", "/", "@", "<"]. The author had been using this for weeks; the annoyance is remembering to apply the patch daily since updates overwrite the uv cache.

      For released TypeScript 7, one commenter notes @typescript/native-preview is no longer needed — the native LSP runs as tsc --lsp --stdio. PR #2178 follows that approach: Serena installs the package automatically and runs the existing TypeScript tests against both servers. General advice: the wrapper and patch target the dev-preview tsgo --lsp; check which command your TypeScript install provides before wiring this up.

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @selbyk tried on GitHub (Worked)

      Set ls_specific_settings.typescript.ls_path to a wrapper script in project.yml that execs tsgo --lsp "$@", and patched solidlsp/language_servers/typescript_language_server.py to accept tsgo's object-form textDocumentSync and superset trigger characters. The author used it for weeks, with the annoyance being remembering to re-apply the patch daily.

      Source: https://github.com/oraios/serena/issues/1402#issuecomment-4344683249 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @MischaPanch tried on GitHub (Didn't work)

      The original PR by @8SFXIM5 adding typescript_tsgo got an initial review but had failing tests and was later closed without comment by a maintainer.

      Source: https://github.com/oraios/serena/issues/1402#issuecomment-4344704738 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @Kiborgik tried on GitHub (Outcome unclear)

      A contributor opened PR #2178 adding typescript_tsgo using released TypeScript 7 (tsc --lsp --stdio), with Serena installing the package automatically and running existing tests against both servers. Not merged as of the thread.

      Source: https://github.com/oraios/serena/issues/1402#issuecomment-6262721529 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @Flimm tried on GitHub (Outcome unclear)

      A commenter noted that with TypeScript 7.0 released, @typescript/native-preview is no longer needed; you run tsc --lsp --stdio and stream input into it. Direction only, not tested in the thread.

      Source: https://github.com/oraios/serena/issues/1402#issuecomment-4922110732 (opens external site)

      Did this work for you?

    Add your answer or comment