question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

use in nodejs environment

See original GitHub issue

Hi, I want to use the lsp server & client in the nodejs environment for some semantics analysis tasks. I was redirected to here from this document https://microsoft.github.io/language-server-protocol/implementors/sdks/ .

I find that if I use the vscode-languageclient it will throw error Cannot find module 'vscode' under the nodejs environment. I can use the vscode-jsonrpc to communicate with lsp server but I am not sure if it is the best choice. So my question is what’s the recommended way to use the lsp client under nodejs environment? Thank you!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
dbaeumercommented, Sep 2, 2021

vscode-languageclient doesn’t work in a pure Node environment since it depends on VS Code API. What does work in a node environment is vscode-languageserver-protocol. There are test cases demonstrating that here: https://github.com/microsoft/vscode-languageserver-node/blob/main/protocol/src/node/test/connection.test.ts#L7

0reactions
dbaeumercommented, Sep 2, 2021

I will close the issue. Please ping if you need further help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to read environment variables from Node.js
The process core module of Node.js provides the env property which hosts all the environment variables that were set at the moment the...
Read more >
Node.js Everywhere with Environment Variables! - Medium
This post walks you through creating and using environment variables, leading to a Node.js app you can run anywhere.
Read more >
How to use environment variables in Node.js | by Ali Kamalizade
How to use custom environment variables in Node · Create an . · Install the dotenv library: npm install dotenv . · Require...
Read more >
Working with Environment Variables in Node.js - Twilio
You can access environment variables in Node.js right out of the box. When your Node.js process boots up, it'll automatically provide access to ......
Read more >
Setting up a Node development environment - MDN Web Docs
Node can be run on Windows, macOS, many flavors of Linux, Docker, etc. There is a full list on the Node.js Downloads page....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found