I'd like to create a Typescript language service plugin (e.g. https://github.com/Microsoft/TypeScript/wiki/Writing-a-Language-Service-Plugin) and integrate this plugin with the Monaco editor, running in a browser.
Is it possible to integrate Typescript language service plugins with Monaco?
Looks like it's possible to extend the background worker. You can read all about it in this GitHub issue.
When you provide your own
customTSWorkerFactorythis code will be running to create your worker.Here you can monkey patch the worker instance with any additional method that you may want to expose that does something that you couldn't do without access to the TypeScript compiler APIs (they are passed as the second argument to your
customTSWorkerFactoryfunction).From here you should be able to accomplish anything really.