feat: add typescript_tsgo language backend (TypeScript 7 native LSP)#1406
feat: add typescript_tsgo language backend (TypeScript 7 native LSP)#14068SFXIM5 wants to merge 3 commits intooraios:mainfrom
Conversation
MischaPanch
left a comment
There was a problem hiding this comment.
I did a shallow review, will re-review again once these comments are addressed and tests for tsgo run through in CI
| pytestmark = pytest.mark.typescript_tsgo | ||
|
|
||
|
|
||
| @pytest.mark.skipif(not _tsgo_servers, reason="tsgo not installed or tests disabled") |
There was a problem hiding this comment.
there's no need for the new test, instead tsgo should be added to the list of languages in the existing typescript tests. The adding can be conditional, but it always should be added in CI, so pls use the in_ci function which we already provide in conftest.
You should modify the pytest workflow to make sure tsgo is available
| import shutil | ||
|
|
||
| tsgo_path = shutil.which("tsgo") | ||
| if tsgo_path is None: |
There was a problem hiding this comment.
It should be installed on the fly, like other dependencies that are managed by npm. Pls check how other language servers do that and repeat the pattern here
| * **TypeScript** | ||
| * **Vue** | ||
| (by default, uses [typescript-language-server](https://github.com/typescript-language-server/typescript-language-server) (language `typescript`); | ||
| we also support [tsgo](https://github.com/nicolo-ribaudo/tc39-proposal-type-annotations) (language `typescript_tsgo`), the native Go-based TypeScript 7 compiler with built-in LSP — does not require Node.js, must be installed separately via `npm install -g @typescript/native-preview`) |
There was a problem hiding this comment.
pls adjust accordingly after addressing the other comments
Add support for tsgo as an alternative TypeScript language backend. tsgo is the native Go-based TypeScript 7 compiler with built-in LSP, which does not require Node.js. Closes oraios#1402
…into existing suite - Replace shutil.which() lookup with npm-based auto-install pattern (using RuntimeDependencyCollection like typescript_language_server) - Remove standalone test_typescript_tsgo.py; parametrize existing typescript tests with TYPESCRIPT_TSGO (always in CI via is_ci) - Add tsgo installation step to pytest CI workflow - Update docs to reflect automatic installation
aff66d9 to
a2eb8af
Compare
Summary
Adds
typescript_tsgoas a new experimental TypeScript language backend, using tsgo — the native Go-based TypeScript 7 compiler with built-in LSP support.Closes #1402
Motivation
typescript-language-server+tsserver.jswrappertsgo --lsp --stdioChanges
src/solidlsp/language_servers/tsgo_language_server.pyLanguageServerDependencyProviderSinglePathpattern (recommended approach)ls_pathcustom setting for user-specified binary pathprefer_non_node_modules_definitionfrom the existing TypeScript backendsrc/solidlsp/ls_config.pyTYPESCRIPT_TSGOenum member (marked as experimental)get_source_fn_matcher()andget_ls_class()test/solidlsp/typescript/test_typescript_tsgo.py_LANGUAGE_REPO_ALIASEStest/conftest.py,pyproject.toml(markers),CHANGELOG.md, docsUsage
Or with custom binary path:
Testing
Tested locally with tsgo
7.0.0-dev.20260421.2on Ubuntu 22.04. All three core LSP features verified:documentSymbol(symbol discovery)textDocument/definition(go-to-definition)textDocument/references(find references)