vscode-languageserver-node | Language server protocol implementation for VSCode
kandi X-RAY | vscode-languageserver-node Summary
kandi X-RAY | vscode-languageserver-node Summary
Language server protocol implementation for VSCode. This allows implementing language services in JS/TS running on node.js
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of vscode-languageserver-node
vscode-languageserver-node Key Features
vscode-languageserver-node Examples and Code Snippets
Community Discussions
Trending Discussions on vscode-languageserver-node
QUESTION
I am working on "run code" actions using code lenses in Metals (Scala Language Server). In our use case, we can provide those code lenses only once the compilation finishes. If the user is not modifying the source file during or after the compilation, vscode won't send a request for code lenses. This can lead to an ugly state of "stale code lenses" from before the compilation.
Digging into the internals of vscode-languageserver-node I have noticed that the CodeLensProvider can emit an onDidChangeCodeLenses event but it is not reflected in the LSP (https://github.com/microsoft/language-server-protocol/issues/192), hence I cannot send this event to vscode.
The other thing which would probably force reloading code lenses is the ICodeEditor::setModel method but I am not sure if this can be done directly from the vscode extension, since I cannot get a reference to the code editor.
How can this be done from either the Language Server or vscode extension? Or is there another, preferred way?
...ANSWER
Answered 2019-Aug-13 at 20:28Unfortunately, the language server protocol indeed doesn't support this yet. The corresponding feature request I opened a while ago can be found here.
I was able to work around this by implementing a dummy CodeLensProvider
on the extension side for the same language ID (the VSCode API generally allows registering multiple providers for language features). It does nothing but call the onDidChangeCodeLenses
event when necessary, the actual implementation is still on the language server side.
QUESTION
I have made a custom language extension and I would like to enable the "Go To Symbol" feature. I have tried to follow the guidelines here, but I'm still kind of lost.
I think all I need to do is implement a DocumentSymbolProvider
, but I'm not really sure how to go about it.
UPDATE
The example language server docs point to a repo that is deprecated. It is replaced with this one, which is much more complex. I think the simplest example I can find there is the lsp-sample, but it doesn't use a DocumentSymbolProvider
.
I've found other repos that do use symbol providers, but they are a bit overwhelming. I can't figure out what needs to go where (for example, do I need both a client and a server? Some packages only seem to use an extension.ts
without both client and server folders).
All I really want to do in my language is detect lines that start with @
and show them in the Go to Symbol pane. I'd love to see a simple tutorial of this.
ANSWER
Answered 2017-Sep-05 at 15:56Do I need both a client and a server?
Not necessarily. As the language support docs you linked show, there's usually two options: a "direct implementation" and one using the Language Server Protocol. For the former, you don't need a client / server architecture. Language Servers have the advantage of being editor-agnostic, you can theoretically use them in any editor that implements the protocol. A direct implementation is limited to usage in VSCode.
All I really want to do in my language is detect lines that start with
@
and show them in the Go to Symbol pane.
Here's the extension.ts
for a very simple example of a "direct implementation" for this:
QUESTION
Have been through official site, the whole process is very well documented for publishing extension : vscode publish extension
My doubt is regarding publish Language server(LSP) in vscode as file structure for LSP is different from that of Extension i.e extension just have Client but LSP has both Client and server directory separately as in LSP Code and Extension code.
Do i need to run vsce publish
separately in client
and server
directory ?
Have been through various answers in stackoverflow as here.
Any help would be highly appreciated.
...ANSWER
Answered 2017-Aug-01 at 18:19You should only need to publish the extension itself (the client) and not the server.
The LSP example is a little weird because it shows the client and server folders side by side, whereas the server is actually a dependency of the client. You can either pull in the server as a node module or copy the server JS into the client like the example does. Then just run vsce publish
in the client to push everything up to the marketplace
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install vscode-languageserver-node
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page