diff options
| author | Wuilliam Lacruz <wuilliam.lacruz@pedidosya.com> | 2020-09-17 15:04:06 -0300 |
|---|---|---|
| committer | Wuilliam Lacruz <wuilliam.lacruz@pedidosya.com> | 2020-09-17 15:04:06 -0300 |
| commit | 5c47a5b712bdff6e565318bc1d9dd2268597fe92 (patch) | |
| tree | e79daa1651a997a1cf1c353579b0c77ab88e2ca0 | |
| parent | feat(groovyls) now works, pending a little refactor (diff) | |
| download | nvim-lspconfig-5c47a5b712bdff6e565318bc1d9dd2268597fe92.tar nvim-lspconfig-5c47a5b712bdff6e565318bc1d9dd2268597fe92.tar.gz nvim-lspconfig-5c47a5b712bdff6e565318bc1d9dd2268597fe92.tar.bz2 nvim-lspconfig-5c47a5b712bdff6e565318bc1d9dd2268597fe92.tar.lz nvim-lspconfig-5c47a5b712bdff6e565318bc1d9dd2268597fe92.tar.xz nvim-lspconfig-5c47a5b712bdff6e565318bc1d9dd2268597fe92.tar.zst nvim-lspconfig-5c47a5b712bdff6e565318bc1d9dd2268597fe92.zip | |
feat(groovyls) custom and default `cmd` works, readme updated
| -rw-r--r-- | README.md | 57 | ||||
| -rw-r--r-- | lua/nvim_lsp/groovyls.lua | 67 |
2 files changed, 94 insertions, 30 deletions
@@ -263,6 +263,7 @@ that config. - [gdscript](#gdscript) - [ghcide](#ghcide) - [gopls](#gopls) +- [groovyls](#groovyls) - [hie](#hie) - [hls](#hls) - [html](#html) @@ -2003,6 +2004,42 @@ require'nvim_lsp'.gopls.setup{} root_dir = root_pattern("go.mod", ".git") ``` +## groovyls + +https://github.com/prominic/groovy-language-server.git + +Requirements: + - Linux only (for now) + - Java 11+ + +`groovyls` can be installed via `:LspInstall groovyls` or by yourself by following the instructions [here](https://github.com/prominic/groovy-language-server.git#build). + +This language server does not provide a global binary, but must be installed manually. The command `:LspInstaller groovyls` makes an attempt at installing the binary by +Fetching the groovyls repository from GitHub, compiling it and then expose a binary. + +If you installed groovy language server by yourself, you can set the `cmd` custom path as follow: + +```lua +require'nvim_lsp'.groovyls.setup{ + -- Unix + cmd = { "java", "-jar", "path/to/groovyls/groovy-language-server-all.jar" }, + ... +} +``` + +Can be installed in Nvim with `:LspInstall groovyls` + +```lua +require'nvim_lsp'.groovyls.setup{} + + Commands: + + Default Values: + cmd = { "java", "-jar", "groovy-language-server-all.jar" } + filetypes = { "groovy" } + root_dir = root_pattern(".git") or vim.loop.os_homedir() +``` + ## hie https://github.com/haskell/haskell-ide-engine @@ -2194,7 +2231,7 @@ require'nvim_lsp'.jdtls.setup{} filetypes = { "java" } init_options = { jvm_args = {}, - workspace = "/home/runner/workspace" + workspace = "/home/wuilliam.lacruz/workspace" } root_dir = root_pattern(".git") ``` @@ -2286,7 +2323,7 @@ require'nvim_lsp'.jsonls.setup{} https://github.com/julia-vscode/julia-vscode `LanguageServer.jl` can be installed via `:LspInstall julials` or by yourself the `julia` and `Pkg`: ```sh -julia --project=/home/runner/.cache/nvim/nvim_lsp/julials -e 'using Pkg; Pkg.add("LanguageServer"); Pkg.add("SymbolServer")' +julia --project=/home/wuilliam.lacruz/.cache/nvim/nvim_lsp/julials -e 'using Pkg; Pkg.add("LanguageServer"); Pkg.add("SymbolServer")' ``` If you want to install the LanguageServer manually, you will have to ensure that the Julia environment is stored in this location: ```vim @@ -2523,7 +2560,7 @@ require'nvim_lsp'.julials.setup{} Commands: Default Values: - cmd = { "julia", "--project=/home/runner/.cache/nvim/nvim_lsp/julials", "--startup-file=no", "--history-file=no", "-e", ' using Pkg;\n Pkg.instantiate()\n using LanguageServer; using SymbolServer;\n depot_path = get(ENV, "JULIA_DEPOT_PATH", "")\n project_path = dirname(something(Base.current_project(pwd()), Base.load_path_expand(LOAD_PATH[2])))\n # Make sure that we only load packages from this environment specifically.\n empty!(LOAD_PATH)\n push!(LOAD_PATH, "@")\n @info "Running language server" env=Base.load_path()[1] pwd() project_path depot_path\n server = LanguageServer.LanguageServerInstance(stdin, stdout, project_path, depot_path);\n server.runlinter = true;\n run(server);\n ' } + cmd = { "julia", "--project=/home/wuilliam.lacruz/.cache/nvim/nvim_lsp/julials", "--startup-file=no", "--history-file=no", "-e", ' using Pkg;\n Pkg.instantiate()\n using LanguageServer; using SymbolServer;\n depot_path = get(ENV, "JULIA_DEPOT_PATH", "")\n project_path = dirname(something(Base.current_project(pwd()), Base.load_path_expand(LOAD_PATH[2])))\n # Make sure that we only load packages from this environment specifically.\n empty!(LOAD_PATH)\n push!(LOAD_PATH, "@")\n @info "Running language server" env=Base.load_path()[1] pwd() project_path depot_path\n server = LanguageServer.LanguageServerInstance(stdin, stdout, project_path, depot_path);\n server.runlinter = true;\n run(server);\n ' } filetypes = { "julia" } root_dir = <function 1> ``` @@ -3060,7 +3097,7 @@ require'nvim_lsp'.omnisharp.setup{} Commands: Default Values: - cmd = { "/home/runner/.cache/nvim/nvim_lsp/omnisharp/run", "--languageserver", "--hostPID", "2801" } + cmd = { "/home/wuilliam.lacruz/.cache/nvim/nvim_lsp/omnisharp/run", "--languageserver", "--hostPID", "4103" } filetypes = { "cs", "vb" } init_options = {} on_new_config = <function 1> @@ -3481,6 +3518,12 @@ This server accepts configuration via the `settings` key. Enable or disable the plugin\. +- **`pyls.plugins.pylint.executable`**: `string` + + Default: `vim.NIL` + + Executable to run pylint with\. Enabling this will run pylint on unsaved files via stdin\. Can slow down workflow\. Only works with python3\. + - **`pyls.plugins.rope_completion.enabled`**: `boolean` Default: `true` @@ -3954,6 +3997,12 @@ See [docs](https://github.com/rust-analyzer/rust-analyzer/tree/master/docs/user# This server accepts configuration via the `settings` key. <details><summary>Available settings:</summary> +- **`rust-analyzer.assist.importMergeBehaviour`**: `enum { "none", "full", "last" }` + + Default: `"full"` + + The strategy to use when inserting new imports or merging imports\. + - **`rust-analyzer.callInfo.full`**: `boolean` Default: `true` diff --git a/lua/nvim_lsp/groovyls.lua b/lua/nvim_lsp/groovyls.lua index fd188f19..de6447a8 100644 --- a/lua/nvim_lsp/groovyls.lua +++ b/lua/nvim_lsp/groovyls.lua @@ -2,17 +2,20 @@ 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 bin_name = "groovy-language-server-all.jar" local function make_installer() local X = {} + local P = util.path.join + local install_dir = P{util.base_install_dir, name} + local bin_path = P{install_dir, "groovy-language-server", "build", "libs", bin_name} + local cmd = { + "java", "-jar", bin_path, + }; function X.install() local install_info = X.info() if install_info.is_installed then - print("C") print(name, "is already installed.") return end @@ -40,13 +43,18 @@ cd groovy-language-server function X.info() return { - is_installed = util.path.exists(bin); + is_installed = util.path.exists(bin_path); install_dir = install_dir; - cmd = { - "java", "-jar", bin, - }; + cmd = cmd } end + + function X.configure(config) + local install_info = X.info() + if install_info.is_installed then + config.cmd = install_info.cmd + end + end return X end @@ -55,36 +63,43 @@ local installer = make_installer() configs[name] = { default_config = { cmd = { - "java", "-jar", bin, - }; - filetypes = {"groovy", "gsp"}; - root_dir = util.root_pattern("grails-app", ".git"); + "java", "-jar", bin_name + }, + filetypes = {"groovy"}; + root_dir = util.root_pattern(".git") or vim.loop.os_homedir(); }; on_new_config = function(config) - print('custom config', vim.inpect(config)) installer.configure(config) end; docs = { description = [[ -https://github.com/sumneko/groovylstmp-language-server +https://github.com/prominic/groovy-language-server.git -Lua language server. **By default, this doesn't have a `cmd` set.** This is -because it doesn't provide a global binary. We provide an installer for Linux -and macOS using `:LspInstall`. If you wish to install it yourself, [here is a -guide](https://github.com/sumneko/groovylstmp-language-server/wiki/Build-and-Run-(Standalone)). -So you should set `cmd` yourself like this. +Requirements: + - Linux only (for now) + - Java 11+ -```groovylstmp -require'nvim_lsp'.sumneko_groovylstmp.setup{ - cmd = {"path", "to", "cmd"}; - ... +`groovyls` can be installed via `:LspInstall groovyls` or by yourself by following the instructions [here](https://github.com/prominic/groovy-language-server.git#build). + +This language server does not provide a global binary, but must be installed manually. The command `:LspInstaller groovyls` makes an attempt at installing the binary by +Fetching the groovyls repository from GitHub, compiling it and then expose a binary. + +If you installed groovy language server by yourself, you can set the `cmd` custom path as follow: + +```lua +require'nvim_lsp'.groovyls.setup{ + -- Unix + cmd = { "java", "-jar", "path/to/groovyls/groovy-language-server-all.jar" }, + ... } ``` - -If you install via our installer, if you execute `:LspInstallInfo sumneko_groovylstmp`, you can know `cmd` value. ]]; default_config = { - root_dir = [[root_pattern("grails-app", ".git")]]; + cmd = { + "java", "-jar", bin_name + }, + filetypes = {"groovy"}; + root_dir = [[root_pattern(".git") or vim.loop.os_homedir()]]; }; }; } |
