Skip to content

API over LSP implementation#2302

Open
aleksei-berezkin wants to merge 1 commit intomicrosoft:mainfrom
JetBrains:lsp-api-impl
Open

API over LSP implementation#2302
aleksei-berezkin wants to merge 1 commit intomicrosoft:mainfrom
JetBrains:lsp-api-impl

Conversation

@aleksei-berezkin
Copy link

Hi! This is our attempt to implement a TS-Go API over the LSP protocol using custom messages. We are already actively using it to query types from the tsgo server, so we think it could be of interest to you. Here are the key points of this implementation:

  • It uses LSP as the transport layer rather than a custom protocol. We find this much easier to maintain. In terms of performance, the transport has never been a bottleneck for us.
  • Types and Symbols are loaded lazily. For example, for an ObjectType, properties are loaded only when accessed, and their types are also requested on demand. This helps minimize traffic and maintain good performance.
  • While this code is fully functional, we understand that the implementation is not complete. Only a subset of fields and types is supported, but we believe it can be developed further into a production-ready solution.

Thank you.

@aleksei-berezkin
Copy link
Author

@microsoft-github-policy-service agree company="JetBrains"

@microsoft-github-policy-service

@aleksei-berezkin the command you issued was incorrect. Please try again.

Examples are:

@microsoft-github-policy-service agree

and

@microsoft-github-policy-service agree company="your company"

@aleksei-berezkin
Copy link
Author

@microsoft-github-policy-service agree company="JetBrains"

@nnnnoel
Copy link

nnnnoel commented Feb 20, 2026

Hello @aleksei-berezkin , I'm WebStorm user that really hope to support typescript-go 100% compatibility in WebStorm.
Would this PR be helpful to your works?

@aleksei-berezkin
Copy link
Author

Hi @nnnnoel, thank you for your comment. You can already use TypeScript-Go in WebStorm: just declare a @typescript/native-preview in your dependencies, and make npm install, and WebStorm will use it as an LSP server.

The only thing which is not implemented yet is the new "Service-Powered Type Engine" (available in Settings | Languages and Frameworks | TypeScript) because this requires the integration with TypeScript compiler via plugin API. We're following closely the progress of the API implementation; right now it looks very promising, yet some crucial methods are missing. Once they are ready, and we observe some stability, we'll reimplement it for TypeScript-Go. Until then, you can use our fork (available via the same settings), where we implemented the needed API subset for Service-Powered Type Engine to work properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants