问题
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
npm install -g vsce
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