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

Expose @volar/server/out/index.js as executable in $NPM_PREFIX/bin #458

Closed
sethidden opened this issue Sep 5, 2021 · 9 comments
Closed
Labels
enhancement New feature or request

Comments

@sethidden
Copy link
Contributor

sethidden commented Sep 5, 2021

I was trying to add Volar as a language server for nvim-lspconfig and I got hung up for a second on the part where you need to tell neovim which executable to launch. I later figured it out and this issue is a nitpick, but still it removes a tiny hurdle.

After you run npm i -g @volar/server there's no binary added to the NPM bin/ folder, so you can't easily launch it. On the other hand with Vetur's language server, after global install you have the vuels command.

The Vim LSP integrations for Volar work around this by creating wrapper scripts. They just execute the server/out/index.js with Node and passthrough any arguments.

Examples:
https://github.com/ouuan/AUR-packages/blob/master/volar-server/wrapper.sh
https://github.com/mattn/vim-lsp-settings/blob/1fdda7d3493f086b5e28446f8daa6a9d6dc1325c/installer/install-volar.sh#L16

I'm not familiar with are the executable files created but Vetur's LS has this: https://github.com/vuejs/vetur/blob/master/server/package.json#L9

Basically, the intended effect is that you can run volar-server from the command line after running npm i -g @volar/server. Which is not possible now.

@johnsoncodehk
Copy link
Member

Thank you for your suggestion. What is the expected cli command? volar-server / @volar/server / volar?

@ouuan, @tsukkee do you agree add this?

@johnsoncodehk johnsoncodehk added the enhancement New feature or request label Sep 5, 2021
@sethidden
Copy link
Contributor Author

sethidden commented Sep 5, 2021

I'm not sure if @volar/server will work though - even npm i -g @vue/cli expoes a vue (eg vue create) executable.

Whatever is more aesthetically pleasing to you all :P May be worth considering volar-vue-ls (or anything that has the words "vue" and "volar") so nobody gets the idea that "hmm what's this new 'Volar' language", since languageservers are conventionally named simiarly to [languagename]-language-server.

@johnsoncodehk
Copy link
Member

I decide use vue-server command for now, could you test @volar/server@0.27.14-alpha.1?

@tsukkee
Copy link
Contributor

tsukkee commented Sep 5, 2021

Sorry for my late reply.

7734d1e looks fine.
It makes the volar setting on vim-lsp-settings simpler. I'll try @volar/server@0.27.14-alpha.1 later.

@ouuan
Copy link

ouuan commented Sep 5, 2021

I decide use vue-server command for now, could you test @volar/server@0.27.14-alpha.1?

I think it's confusing with vetur, whose command is vls (Vue Language Server).

@johnsoncodehk
Copy link
Member

I think it's confusing with vetur, whose command is vls (Vue Language Server).

It's no problem I think. 🤔

@johnsoncodehk
Copy link
Member

Change command vue-server to volar-server, because I want to rename @volar/server on version 1.0 or earlier, use volar-server for @volar/server is easier to replace it. And we have more time to decide the official command.

@tsukkee
Copy link
Contributor

tsukkee commented Sep 6, 2021

It makes the volar setting on vim-lsp-settings simpler. I'll try @volar/server@0.27.14-alpha.1 later.

I confirmed it works fine with vim-lsp and sent PR to vim-lsp-settings with it ( mattn/vim-lsp-settings#458 ).

@johnsoncodehk
Copy link
Member

Please note #876. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants