-
I have a Windows text editor that currently uses the Gold parser to process my DSL. I want to replace this with the LSP functionality in Langium (with the Langium running as a server and my client communicating via http or stdio) I'm a newbie to Javascript and NodeJS, so struggling to follow the examples. I thought the closest example to what I'm trying to do is the "Monaco Editor". I tried to observe the JSON messages being passed between the client and the server, but without success. I think the LSP server is actually running within the browser, so there is no LSP traffic on the network. I feel like the answer will be obvious, but I just can't see how to run the "Hello-Word" example as a LSP server that my client can connect to. Thanks in advance for any help, and apologies if the answer is staring at me in the help files. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @ianh9999, I would recommend you to start with the yeoman generator for Langium (requires yeoman) and select the vscode extension option. That will generate you some setup that produces a Now you just need a language client that is capable of connecting to this language server. Note that not every editor library is automatically capable of communication within the language server protocol. |
Beta Was this translation helpful? Give feedback.
Hey @ianh9999,
I would recommend you to start with the yeoman generator for Langium (requires yeoman) and select the vscode extension option. That will generate you some setup that produces a
.js
bundle that contains the whole language server. You can start this file withnode <file> --stdio
to start the language server in stdio mode. Thevscode-languageclient
library used by the generated extension automatically does under the hood to start the language server.Now you just need a language client that is capable of connecting to this language server. Note that not every editor library is automatically capable of communication within the language server protocol.