Skip to content

Feature request: Support TypeScript 7 native LSP (tsgo) as a language backend #1402

@8SFXIM5

Description

@8SFXIM5

Summary

TypeScript 7.0 introduces a native Go-based compiler and language server called tsgo (@typescript/native-preview). It implements the standard LSP protocol directly via tsgo --lsp, without requiring Node.js or the traditional typescript-language-server wrapper.

I'd like to request support for tsgo as an alternative TypeScript language backend in Serena (e.g., as a new language option like typescript_native or typescript_tsgo).

Motivation

  • Performance: tsgo is written in Go and starts significantly faster than the Node.js-based tsserver. Memory usage is also much lower.
  • Headless/agent use case: Serena runs as a background MCP service. The faster startup and lower resource footprint of tsgo makes it ideal for this scenario.
  • Standard LSP: Unlike tsserver (which uses its own protocol and requires a wrapper like typescript-language-server or vtsls), tsgo implements the LSP protocol natively. This should simplify integration.
  • Future-proof: TypeScript 7.0 is the direction the TypeScript team is heading. Early support would benefit users who adopt it.

Current State

  • Serena currently supports two TypeScript backends: typescript (via typescript-language-server + tsserver.js) and typescript_vts (via vtsls). Both depend on Node.js.
  • The TypeScriptLanguageServer class does not support the ls_path configuration option, so there's no way to point it at tsgo.
  • tsgo's LSP mode is invoked simply as tsgo --lsp (stdio transport), which is similar to how many other language servers in solidlsp are started.

Proposed Approach

Add a new language option (e.g., typescript_native) that:

  1. Launches tsgo --lsp via stdio
  2. Uses standard LSP initialization (no custom wrapper needed)
  3. Optionally allows configuring the tsgo binary path via ls_specific_settings

Environment

  • tsgo version: 7.0.0-dev.20260421.2 (installed via @typescript/native-preview)
  • Serena version: 0.1.4
  • OS: Ubuntu 22.04

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions