forcedotcom / lightning-language-server

LWC and Aura Language Servers - shipped as part of the Salesforce VSCode Extensions
https://forcedotcom.github.io/salesforcedx-vscode/
BSD 3-Clause "New" or "Revised" License
31 stars 48 forks source link

Make LWC & Aura language servers available as executables #581

Open WuggyX2 opened 9 months ago

WuggyX2 commented 9 months ago

Is your feature request related to a problem? Please describe. I've been looking into integrating Neovim's lsp client with lwc language server. Neovim's lsp client uses stdio to communicate with language servers. In my understanding this requires that the language server can be started with a terminal command.

Describe the solution you'd like Add executable files for lwc and aura language servers. Which would be installed automatically when installing the language servers using npm. This is also the way other language servers written in TypeScript work. This would allow any editor with a lsp client to integrate with aura and lwc language servers, not just neovim

Describe alternatives you've considered I do not think there are any alternative ways to to this.

Additional context I've created a PR that should implement the required changes. Neovim LSP docs

gbockus-sf commented 8 months ago

transferred to LSP repo to make the PR build happy.

asknet commented 2 weeks ago

@WuggyX2 Thanks for this PR. I was able to set up in my nvim. However, LSP works only for html tags, and doesn't see lwc tags. May I know if you were able to set up successfully in nvim, If yes can you share your working configuration? Thank you!

WuggyX2 commented 4 days ago

@WuggyX2 Thanks for this PR. I was able to set up in my nvim. However, LSP works only for html tags, and doesn't see lwc tags. May I know if you were able to set up successfully in nvim, If yes can you share your working configuration? Thank you!

Just installing the lwc lsp through mason should do the trick. I do not have anything Salesforce specific in my config and I'm not currently using Neovim to do Salesforce stuff. Starting the language server should generate some common typings into a .sfdx folder. Make sure it has been generated. As for sobject completions, the vscode extensions have a command "Refresh SObject definitions" to generate mock typings. Use that to generate types for Sobjects. After that you should be good to go.