Giter VIP home page Giter VIP logo

Comments (7)

marslo avatar marslo commented on June 18, 2024

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' }
}

from coc.nvim.

fannheyward avatar fannheyward commented on June 18, 2024

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.

from coc.nvim.

marslo avatar marslo commented on June 18, 2024

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 ?

from coc.nvim.

fannheyward avatar fannheyward commented on June 18, 2024
  1. LSP always needs a workspace to work, no global one.
  2. Some language server can work in single file mode, this needs language server support.

from coc.nvim.

marslo avatar marslo commented on June 18, 2024

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.

from coc.nvim.

fannheyward avatar fannheyward commented on June 18, 2024

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.

from coc.nvim.

marslo avatar marslo commented on June 18, 2024

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:

  • if exist /usr/local/bin/gradle-language-server, using /usr/local/bin/gradle-language-server
  • if /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.

from coc.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.