Skip to content

bug: TSX files are opened with plain TypeScript language ID #148

@dergachoff

Description

@dergachoff

Problem

When one TypeScript LSP server is configured for both **/*.ts and **/*.tsx, mcpls derives the opened-file language ID from the server-level language_id = "typescript".

That opens TSX files as typescript instead of typescriptreact, so servers such as tsgo parse JSX as plain TS and report syntax errors like '>' expected.

Expected

TSX and JSX file patterns should derive React-aware LSP language IDs:

  • .tsx -> typescriptreact
  • .jsx -> javascriptreact

Existing overrides such as C/C++ *.h -> cpp should still work.

Repro signal

In a TS project with jsx: react-jsx, tsgo --noEmit passes, but textDocument/diagnostic through mcpls reports JSX parser errors for a .tsx test file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions