divyenduz
divyenduz

Reputation: 2027

VSCode TypeScript Plugin and workspaces API

I am writing a TypeScript language plugin for GraphQL and I need to access the project root at some places. I want to use the workspaces API to make this workspace ready.

I tried including vscode directly and that doesn't work

Is it possible to pass information like this from extension to language plugin or is there a way to access workspace API in language plugin?

Upvotes: 1

Views: 278

Answers (1)

Matt Bierner
Matt Bierner

Reputation: 65273

This is not possible. TypeScript server plugins run in a separate process from normal VS Code extensions and cannot access the normal VS code api.

This feature request would add a basic channel so that VS Code extensions to communicate with TS server plugins.

The other option that could work today is to open a communications pipe from your plugin to a vscode extension.

Upvotes: 1

Related Questions