Skip to content

fix(config): preserve React language IDs for TSX/JSX#149

Open
dergachoff wants to merge 3 commits into
bug-ops:mainfrom
dergachoff:fix/tsx-language-id
Open

fix(config): preserve React language IDs for TSX/JSX#149
dergachoff wants to merge 3 commits into
bug-ops:mainfrom
dergachoff:fix/tsx-language-id

Conversation

@dergachoff
Copy link
Copy Markdown
Contributor

@dergachoff dergachoff commented May 7, 2026

Summary

Fixes #148.

This keeps React document language IDs intact for TSX/JSX files and still lets the common single TypeScript or JavaScript server configuration handle them.

  • typescript + .tsx file patterns now map to typescriptreact
  • javascript + .jsx file patterns now map to javascriptreact
  • when no exact react LSP client is configured, typescriptreact routes to the typescript server and javascriptreact routes to the javascript server
  • if an exact react server is configured, it wins over the fallback

The existing C/C++ file-pattern override behavior is unchanged.

Validation

  • cargo +nightly fmt --check
  • cargo +1.95 clippy -p mcpls-core --all-targets --all-features -- -D warnings
  • cargo +1.95 test -p mcpls-core
  • cargo +1.95 nextest run -p mcpls-core
  • cargo +1.95 test -p mcpls-core get_client_for_file
  • Built a local release binary from a combined branch containing this PR plus fix(lsp): omit null diagnostic request fields #147, then ran a standalone MCP stdio probe against a real TSX project using tsgo. get_diagnostics returned empty diagnostics for both a TSX source file and a TSX test file, with no typescriptreact no-server error and no identifier:null protocol error.

@github-actions github-actions Bot added documentation Improvements or additions to documentation rust Rust code changes mcpls-core mcpls-core crate changes labels May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation mcpls-core mcpls-core crate changes rust Rust code changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: TSX files are opened with plain TypeScript language ID

1 participant