Home > Software engineering >  is there a way to bundle files with an lsp-client in vscode
is there a way to bundle files with an lsp-client in vscode

Time:10-07

I'm following the guide at https://code.visualstudio.com/api/language-extensions/language-server-extension-guide to create an LSP Client for vscode (I already have a server, it's written in a different language).

I would like to know if it is possible to do either of these things:

  1. bundle an external file with my VSIX file (bundled by the vsce tool) and then reference it in the command (e.g. bundling my server as a binary, thus not requiring user installation)
  2. include a pre-check condition that would alert the user with a popup that they have not installed the server or some other system dependencies.

I do not have any experience with Typescript, so please be gentle with code snippets!

CodePudding user response:

If you use vsix it should by default include the files in your main directory.

You can later access them for example using path.join(context.extensionPath, "mybinary")

At least it does work for us this way in https://github.com/scalameta/metals-vscode

  • Related