diff options
| author | Wuilliam Lacruz <wuilliam.lacruz@pedidosya.com> | 2020-09-17 13:28:05 -0300 |
|---|---|---|
| committer | Wuilliam Lacruz <wuilliam.lacruz@pedidosya.com> | 2020-09-17 13:28:05 -0300 |
| commit | 13e8e26043a99c562e3739047dd511e9820ae6ef (patch) | |
| tree | 098cb78cf4874395bada7d591f83708add842537 /lua/nvim_lsp | |
| parent | fix(groovyls) Now using the right paths (diff) | |
| download | nvim-lspconfig-13e8e26043a99c562e3739047dd511e9820ae6ef.tar nvim-lspconfig-13e8e26043a99c562e3739047dd511e9820ae6ef.tar.gz nvim-lspconfig-13e8e26043a99c562e3739047dd511e9820ae6ef.tar.bz2 nvim-lspconfig-13e8e26043a99c562e3739047dd511e9820ae6ef.tar.lz nvim-lspconfig-13e8e26043a99c562e3739047dd511e9820ae6ef.tar.xz nvim-lspconfig-13e8e26043a99c562e3739047dd511e9820ae6ef.tar.zst nvim-lspconfig-13e8e26043a99c562e3739047dd511e9820ae6ef.zip | |
feat(groovyls) now works, pending a little refactor
Diffstat (limited to 'lua/nvim_lsp')
| -rw-r--r-- | lua/nvim_lsp/groovyls.lua | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/lua/nvim_lsp/groovyls.lua b/lua/nvim_lsp/groovyls.lua index 33b6352a..fd188f19 100644 --- a/lua/nvim_lsp/groovyls.lua +++ b/lua/nvim_lsp/groovyls.lua @@ -2,18 +2,17 @@ local configs = require 'nvim_lsp/configs' local util = require 'nvim_lsp/util' local name = "groovyls" +local P = util.path.join +local install_dir = P{util.base_install_dir, name} +local bin = P{install_dir, "groovy-language-server", "build", "libs", "groovy-language-server-all.jar"} local function make_installer() - local P = util.path.join - local install_dir = P{util.base_install_dir, name} - - local bin = P{install_dir, "groovy-language-server", "build", "libs", "groovy-language-server.jar"} - local cmd = {"java", "-jar", bin} - local X = {} + function X.install() local install_info = X.info() if install_info.is_installed then + print("C") print(name, "is already installed.") return end @@ -35,23 +34,19 @@ cd groovy-language-server # build ./gradlew build ]=] - vim.fn.mkdir(install_info.install_dir, "p") util.sh(script, install_info.install_dir) end + function X.info() return { is_installed = util.path.exists(bin); install_dir = install_dir; - cmd = cmd; + cmd = { + "java", "-jar", bin, + }; } end - function X.configure(config) - local install_info = X.info() - if install_info.is_installed then - config.cmd = cmd - end - end return X end @@ -59,11 +54,14 @@ local installer = make_installer() configs[name] = { default_config = { - filetypes = {"groovy"}; - root_dir = util.root_pattern("build.gradle", "pom.xml", "grails-app", ".git"); - log_level = vim.lsp.protocol.MessageType.Warning; + cmd = { + "java", "-jar", bin, + }; + filetypes = {"groovy", "gsp"}; + root_dir = util.root_pattern("grails-app", ".git"); }; on_new_config = function(config) + print('custom config', vim.inpect(config)) installer.configure(config) end; docs = { @@ -86,8 +84,7 @@ require'nvim_lsp'.sumneko_groovylstmp.setup{ If you install via our installer, if you execute `:LspInstallInfo sumneko_groovylstmp`, you can know `cmd` value. ]]; default_config = { - filetypes = { "groovy" }; - root_dir = [[root_pattern("build.gradle", "pom.xml", "grails-app", ".git")]]; + root_dir = [[root_pattern("grails-app", ".git")]]; }; }; } |
