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

feat: support volar 1.0 #2181

Merged
merged 1 commit into from Oct 9, 2022
Merged

feat: support volar 1.0 #2181

merged 1 commit into from Oct 9, 2022

Conversation

adalessa
Copy link
Contributor

@adalessa adalessa commented Oct 8, 2022

Volar has updated the options for the language server. see vuejs/language-tools#1916
In order to support this I have update the configuration.
this also has been reported to neovim neovim/neovim#20010 but is more related to the config not the core.

Thanks in advance.

@glepnir glepnir merged commit 87c8c7b into neovim:master Oct 9, 2022
@adalessa adalessa deleted the volar-fix-config branch October 9, 2022 08:29
williamboman pushed a commit to williamboman/mason-lspconfig.nvim that referenced this pull request Oct 9, 2022
Volar introduced some breaking changes in version 1.0 vuejs/language-tools#1916.
Also see neovim/nvim-lspconfig#2181.
Decodetalkers pushed a commit to Decodetalkers/nvim-lspconfig that referenced this pull request Oct 22, 2022
@mikehaertl
Copy link
Contributor

@adalessa With volar 1.0.9 it's missing many capabilities for me now:

method textDocument/definition is not supported by any of the servers registered for the current buffer
method textDocument/hover is not supported by any of the servers registered for the current buffer
method textDocument/codeAction is not supported by any of the servers registered for the current buffer

Do these work for you?

@polyzen
Copy link
Contributor

polyzen commented Oct 27, 2022

Those all work for me, tested on https://github.com/archlinux-de/pkgstats.archlinux.de.

@mikehaertl
Copy link
Contributor

@polyzen Thanks. What's your neovim version?

I use the latest nvim-lspconfig and volar versions with neovim 0.8.0.

@polyzen
Copy link
Contributor

polyzen commented Oct 28, 2022

0.8.0

@pwang2
Copy link

pwang2 commented Nov 15, 2022

same as @mikehaertl , latest nvim-lspconfig, volar(1.0.9)+neovim 0.8.1. looks like something still wrong.

@polyzen
Copy link
Contributor

polyzen commented Nov 15, 2022

@Lilja
Copy link

Lilja commented Nov 15, 2022

If you are experiencing issues, have you downloaded both:

  • @volar/vue-language-server
  • typescript-language-server

If you still are experiencing issues, set the tsdk:

require('lsp-config')['volar'].setup{
  on_attach = on_attach,
  capabilities = capabilities,
  init_options = {
    typescript = {
      tsdk = "/global/npm/install/path/to/node_modules/typescript/lib"
    }
  }
}

@mikehaertl
Copy link
Contributor

@pwang2 See the latest comment here: vuejs/language-tools#1916 (comment)

@mikehaertl It should be resolved by vuejs/language-tools@8daa162

So the issue should hopefully be fixed in the next volar release.

@pwang2
Copy link

pwang2 commented Nov 18, 2022

Thank you @mikehaertl , I also resulted at that comments. :) waiting for 1.0.10.

@mmoya
Copy link

mmoya commented Dec 1, 2022

For the record, still getting the issue with 1.0.10:

$ nvim --version
NVIM v0.8.1
Build type: Release
LuaJIT 2.1.0-beta3
...
$ .local/share/nvim/mason/packages/vue-language-server/node_modules/.bin/vue-language-server --version
1.0.10
$ git -C .local/share/nvim/site/pack/packer/opt/nvim-lspconfig show --name-only 
commit d346335af862ede0cece75739d789cfdc46c4454 (HEAD -> master, origin/master, origin/HEAD)
...

Solved by setting tsdk = "/usr/lib/node_modules/typescript/lib" (following Lilja's suggestion).

@mikehaertl
Copy link
Contributor

@mmoya Could it be that you're using volar on a project with workspaces? There's a script in https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#volar which required an update, too, to change from serverPath to tdsk.

With that in place 1.0.10 works fine for me.

@mmoya
Copy link

mmoya commented Dec 14, 2022

@mmoya Could it be that you're using volar on a project with workspaces? There's a script in https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#volar which required an update, too, to change from serverPath to tdsk.

I don't know if I have workspaces or not, which probably means I don't have it. Anyway I solved the issue by setting the tsdk property.

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

Successfully merging this pull request may close these issues.

None yet

7 participants