VSCode TypeScript Plugin and workspaces API

247 views Asked by At

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

  • I get the error vscode not found
  • I have to install vscode engine and that looks like the wrong API.

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?

1

There are 1 answers

3
Matt Bierner On BEST ANSWER

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.