Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css][html] Publish language servers modules on npm #77582

Open
mickaelistria opened this issue Jul 18, 2019 · 11 comments

Comments

@mickaelistria
Copy link
Contributor

commented Jul 18, 2019

We'd like to reuse more easily language servers from VSCode (HTML, CSS, JSon...), On npm.js we can see the related "languageservice" which provide some part of the logic, but those don't talk LSP.
Could the language server modules be published on npm.js for easier reuse? Or merged with the languageservice modules directly?

@aeschli

This comment has been minimized.

Copy link
Contributor

commented Jul 19, 2019

We publish the JSON language server as https://www.npmjs.com/package/vscode-json-languageserver.

Doing the same for CSS and HTML is in the backlog, but there hasn't been much (or any, except of this request) demand for it.
The alternative is to take it form the sources or from a VSCode build.

@aeschli aeschli changed the title Publish language servers modules on npm [css][html] Publish language servers modules on npm Jul 19, 2019

@aeschli aeschli added this to the Backlog milestone Jul 19, 2019

@akurtakov

This comment has been minimized.

Copy link

commented Jul 19, 2019

Just did:
npm install vscode-json-languageserver
./node_modules/vscode-json-languageserver/bin/vscode-json-languageserver
and it failed with :
internal/modules/cjs/loader.js:638
throw err;
^

Error: Cannot find module '../out/jsonServerMain'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (/home/akurtakov/tmp/vscode-json-languageserver/node_modules/vscode-json-languageserver/bin/vscode-json-languageserver:6:1)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)

@aeschli

This comment has been minimized.

Copy link
Contributor

commented Jul 22, 2019

Sorry for that, published again (v1.2.1)

@mickaelistria

This comment has been minimized.

Copy link
Contributor Author

commented Jul 22, 2019

We publish the JSON language server as https://www.npmjs.com/package/vscode-json-languageserver.

Thanks for that, I wasn't aware of it!

The alternative is to take it form the sources or from a VSCode build.

We basically already do it, but it makes maintenance harder overall (build script is harder, potential versioning issues...)

@mtangoo

This comment has been minimized.

Copy link

commented Jul 29, 2019

Hi @aeschli ,
May I request the language servers as @mickaelistria asked. If there is no much interest, at least instructions on how to build it yourself independent of VSCode will suffice. Then we the community will publish it to npm as part of contribution and maintain an updated package.

I can take on it if you can guide me how to do it (never have before published anything to NPM though I use a lot of packages from there)

@mtangoo

This comment has been minimized.

Copy link

commented Jul 29, 2019

@mickaelistria can you post the procedures to publish the servers? I can take on myself to update them with every new VSCode version!

@mickaelistria

This comment has been minimized.

Copy link
Contributor Author

commented Jul 29, 2019

We use this: https://github.com/eclipse/wildwebdeveloper/tree/master/org.eclipse.wildwebdeveloper/language-servers (and the relative path point to a local copy of VSCode) and then npm install

@mtangoo

This comment has been minimized.

Copy link

commented Jul 30, 2019

(and the relative path point to a local copy of VSCode)
can you explain this one?
I downloaded the packages.json and run npm install and I got errors. I understand what errors complain but I don't know how to fix it, sing it is clear I did it wrong. But dunno how to get it right!

I have node installed so I don't understand why all those archives in packages.json

$ npm install
npm ERR! path /Users/me/Projects/LangServerProtocol/Packaged/node-debug2-1.25.5.tgz
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall stat
npm ERR! enoent ENOENT: no such file or directory, stat '/Users/me/LangServerProtocol/Packaged/node-debug2-1.25.5.tgz'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/me/.npm/_logs/2019-07-30T10_43_41_492Z-debug.log
@jabby

This comment has been minimized.

Copy link

commented Jul 30, 2019

In fact we build our packaging in several steps.

  • First we download a vscode tar.gz archive.
  • Then we pack each needed server via npm pack.
  • Finally we install dependencies.

All steps are managed by our pom.xml.
Please have a look herehttps://github.com/eclipse/wildwebdeveloper/blob/master/org.eclipse.wildwebdeveloper/pom.xml

@mtangoo

This comment has been minimized.

Copy link

commented Jul 31, 2019

Thanks for the info. It's long since I messed up with Java build scripts. I guess I will have to write bash or python scripts to automate the build if I will be able to do that

@mtangoo

This comment has been minimized.

Copy link

commented Jul 31, 2019

Downloaded the repo and run mvn package and it ended in errors. My plan was to compile it get the LS build for me. I tried to search build instructions but no one was found. Can you publish it to npm at least for major releases of VSCode?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.