Closed marslo closed 8 months ago
One more question I'm just curious, I've installed neovim/nvim-lspconfig
and also well configured the gralde_ls
, and it works in :LspInfo
, but seems coc still using the own groovy lsp instead of nvim-lspconfig
.
Here my gradlels
details:
# install gradlels in system
$ mkdir -p ~/.vim/lsp
$ git clone https://github.com/microsoft/vscode-gradle.git ~/.vim/lsp/vscode-gradle && cd $_
$ ./gradlew installDist
$ sudo ln -sf /opt/lsp/gradle-language-server/build/install/gradle-language-server/bin/gradle-language-server /usr/local/bin/
$ which -a gradle-language-server
/usr/local/bin/gradle-language-server
vim settings:
Plug 'neovim/nvim-lspconfig'
lua settings:
-- ~/.config/nvim/init.lua
require('config/lsp')
-- ~/.config/nvim/lua/config/lsp.lua
require'lspconfig'.gradle_ls.setup{
filetypes = { 'groovy', 'Jenkinsfile' }
}
cd .vim; nvim ~/a.groovy
In this case, coc uses your current folder as workspace root, here's .vim
, sends to groovy language server. But language server couldn't find your file in workspace, won't work. Most language server needs workspace to work, you should start vim in it.
coc still using the own groovy lsp instead of nvim-lspconfig
coc didn't use language server from nvim-lspconfig.
Hi @fannheyward , any suggestion to setup the global workspace root?
And will you considering have configurable lsp for filetype?
i.e.: I'm using groovy and Jenkinsfile most of time, I'd like to mapping Jenkinsfile to using groovy LSP as well, and using gradle_ls
( /usr/local/bin/gradle-language-server
) as first priority LSP ?
I'm kinda understand. So, coc.nvim is pretty much something similar with hrsh7th/nvim-cmp, another autocompletion engine. in coc.nvim all lsp are highly integrated via CocInstall coc-..
, so I don't have to investigate or manual install every single lsp how to enable/setup/install/configure.
So, pretty much coc.nvim = nvim-cmp + nvim-cmp-lsp + nvim-lspconfig ?
Will you considering have configurable lsp for filetype, I mean coc-xxx
as second priority, and using something manual installed as first priority.
pretty much coc.nvim = nvim-cmp + nvim-cmp-lsp + nvim-lspconfig ?
Yes, and more.
configurable lsp for filetype, I mean coc-xxx as second priority, and using something manual installed as first priority.
Can't understand, more informations please.
So, for example, I'd like to use gradle_ls
as LSP provider if coc-groovy
not been installed.
something pretty much like "language server setup"
And, how to mapping ft=Jenkinsfile
to using groovy LSP ?
pretty much something like:
{
"lspsettings" : {
"coc-groovy" : {
"filetype": { "groovy", "Jenkinsfile" },
"cmd" : { "/usr/local/bin/gradle-language-server", "coc-groovy" },
"autostart": true
}
}
}
so, coc will check /usr/local/bin/gradle-language-server
exists or not:
/usr/local/bin/gradle-language-server
, using /usr/local/bin/gradle-language-server
/usr/local/bin/gradle-language-server
cannot be found, use coc-groovy
btw: coc-groovy
can be any of commands like java -jar /path/to/groovy-language-server-all.jar
, or default
means coc-groovy
, or anything.
Result from CocInfo
LSP works:
LSP not work:
Describe the bug
if current path same with the
*.groovy
, LSP working in coc ( i.e.: file:~/a.groovy
, pwd:~
). it will show asf [LS]
However, when current path is not the file path ( i.e.:
cd .vim; nvim ~/a.groovy
), LSP won't work, it will show as[A]
details as below:
https://github.com/neoclide/coc.nvim/assets/5822057/a2d977f9-af80-48a0-9d34-16859763a8bf
Reproduce the bug
We will close your issue when you don't provide minimal vimrc and we can't reproduce it
Can be reproduced in mini.vim
mini rc configure files:
result:
https://github.com/neoclide/coc.nvim/assets/5822057/54677ca2-6c78-466c-a067-82afbc483d73
here my sample groovy file: