How should I package my Language Server with my client?

ⅰ亾dé卋堺 提交于 2019-12-12 20:10:00

问题


I'm trying to create a language server for VSCode. It's made up of a client and a server, communicating over RPC.

The official docs have a working example, with the language-server split into in two directories, the client and the server.

What I want to do is to package both into a VSIX file, so I can install them together.

In their example, they say cd to the client directory and run vsce package. However, If I do that and install the resultant package, VSCode says

"Error: Cannot find module '/home/blah/vscode.language-client-example-0.0.1/server/server.js"

I can't run vsce package in the server directory, as it complains

"Error: Missing publisher name"

How do I package it?


回答1:


You can publish extension and try. Official doc for publishing extensions

In short for publishing, follow below steps

  1. npm install -g vsce
  2. vsce publish



回答2:


Both for packaging as well as publishing you need to register a publisher.

In the docs they explain how to create a publisher for yourself: https://code.visualstudio.com/api/working-with-extensions/publishing-extension#create-a-publisher

Then in your (root) package.json add your publisher id: "publisher": "my-publisher"

After that both package and publish should work with vsce.



来源:https://stackoverflow.com/questions/44813802/how-should-i-package-my-language-server-with-my-client

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!