[Feature] Allow for custom path to a language server binary (#1043)

This commit is contained in:
ichigo-gyuunyuu 2021-07-21 01:03:15 +05:30 committed by GitHub
parent 9e640fa4d9
commit 0064b446a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 150 additions and 45 deletions

View file

@ -165,7 +165,9 @@ require("core.which-key").config()
require("core.nvimtree").config() require("core.nvimtree").config()
require("lang.clang").config() require("lang.clang").config()
require("lang.clojure").config()
require("lang.cmake").config() require("lang.cmake").config()
require("lang.cs").config()
require("lang.css").config() require("lang.css").config()
require("lang.dart").config() require("lang.dart").config()
require("lang.dockerfile").config() require("lang.dockerfile").config()
@ -194,3 +196,4 @@ require("lang.vim").config()
require("lang.vue").config() require("lang.vue").config()
require("lang.yaml").config() require("lang.yaml").config()
require("lang.zig").config() require("lang.zig").config()
require("lang.zsh").config()

View file

@ -25,6 +25,9 @@ M.config = function()
}, },
stop_on_entry = false, stop_on_entry = false,
}, },
lsp = {
path = DATA_PATH .. "/lspinstall/cpp/clangd/bin/clangd",
},
} }
end end
@ -69,7 +72,7 @@ M.lsp = function()
table.insert(clangd_flags, "--header-insertion=" .. O.lang.clang.header_insertion) table.insert(clangd_flags, "--header-insertion=" .. O.lang.clang.header_insertion)
require("lspconfig").clangd.setup { require("lspconfig").clangd.setup {
cmd = { DATA_PATH .. "/lspinstall/cpp/clangd/bin/clangd", unpack(clangd_flags) }, cmd = { O.lang.clang.lsp.path, unpack(clangd_flags) },
on_attach = require("lsp").common_on_attach, on_attach = require("lsp").common_on_attach,
handlers = { handlers = {
["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { ["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {

View file

@ -1,7 +1,11 @@
local M = {} local M = {}
M.config = function() M.config = function()
O.lang.erlang = {} O.lang.erlang = {
lsp = {
path = DATA_PATH .. "/lspinstall/clojure/clojure-lsp",
},
}
end end
M.format = function() M.format = function()
@ -20,7 +24,7 @@ M.lsp = function()
end end
require("lspconfig").clojure_lsp.setup { require("lspconfig").clojure_lsp.setup {
cmd = { DATA_PATH .. "/lspinstall/clojure/clojure-lsp" }, cmd = { O.lang.erlang.lsp.path },
on_attach = require("lsp").common_on_attach, on_attach = require("lsp").common_on_attach,
} }
end end

View file

@ -6,6 +6,9 @@ M.config = function()
exe = "clang-format", exe = "clang-format",
args = {}, args = {},
}, },
lsp = {
path = DATA_PATH .. "/lspinstall/cmake/venv/bin/cmake-language-server",
},
} }
end end
@ -25,7 +28,7 @@ M.lsp = function()
end end
require("lspconfig").cmake.setup { require("lspconfig").cmake.setup {
cmd = { DATA_PATH .. "/lspinstall/cmake/venv/bin/cmake-language-server" }, cmd = { O.lang.cmake.lsp.path },
on_attach = require("lsp").common_on_attach, on_attach = require("lsp").common_on_attach,
filetypes = { "cmake" }, filetypes = { "cmake" },
} }

View file

@ -1,8 +1,11 @@
local M = {} local M = {}
M.config = function() M.config = function()
-- TODO: implement config for language O.lang.csharp = {
return "No config available!" lsp = {
path = DATA_PATH .. "/lspinstall/csharp/omnisharp/run",
},
}
end end
M.format = function() M.format = function()
@ -23,7 +26,7 @@ M.lsp = function()
-- C# language server (csharp/OmniSharp) setup -- C# language server (csharp/OmniSharp) setup
require("lspconfig").omnisharp.setup { require("lspconfig").omnisharp.setup {
on_attach = require("lsp").common_on_attach, on_attach = require("lsp").common_on_attach,
cmd = { DATA_PATH .. "/lspinstall/csharp/omnisharp/run", "--languageserver", "--hostPID", tostring(vim.fn.getpid()) }, cmd = { O.lang.csharp.lsp.path, "--languageserver", "--hostPID", tostring(vim.fn.getpid()) },
} }
end end

View file

@ -7,6 +7,9 @@ M.config = function()
exe = "prettier", exe = "prettier",
args = {}, args = {},
}, },
lsp = {
path = DATA_PATH .. "/lspinstall/css/vscode-css/css-language-features/server/dist/node/cssServerMain.js",
},
} }
end end
@ -57,7 +60,7 @@ M.lsp = function()
require("lspconfig").cssls.setup { require("lspconfig").cssls.setup {
cmd = { cmd = {
"node", "node",
DATA_PATH .. "/lspinstall/css/vscode-css/css-language-features/server/dist/node/cssServerMain.js", O.lang.css.lsp.path,
"--stdio", "--stdio",
}, },
on_attach = require("lsp").common_on_attach, on_attach = require("lsp").common_on_attach,

View file

@ -1,7 +1,11 @@
local M = {} local M = {}
M.config = function() M.config = function()
O.lang.docker = {} O.lang.docker = {
lsp = {
path = DATA_PATH .. "/lspinstall/dockerfile/node_modules/.bin/docker-langserver",
},
}
end end
M.format = function() M.format = function()
@ -21,7 +25,7 @@ M.lsp = function()
-- npm install -g dockerfile-language-server-nodejs -- npm install -g dockerfile-language-server-nodejs
require("lspconfig").dockerls.setup { require("lspconfig").dockerls.setup {
cmd = { DATA_PATH .. "/lspinstall/dockerfile/node_modules/.bin/docker-langserver", "--stdio" }, cmd = { O.lang.docker.lsp.path, "--stdio" },
on_attach = require("lsp").common_on_attach, on_attach = require("lsp").common_on_attach,
root_dir = vim.loop.cwd, root_dir = vim.loop.cwd,
} }

View file

@ -7,6 +7,9 @@ M.config = function()
args = { "format" }, args = { "format" },
stdin = true, stdin = true,
}, },
lsp = {
path = DATA_PATH .. "/lspinstall/elixir/elixir-ls/language_server.sh",
},
} }
end end
@ -38,7 +41,7 @@ M.lsp = function()
end end
require("lspconfig").elixirls.setup { require("lspconfig").elixirls.setup {
cmd = { DATA_PATH .. "/lspinstall/elixir/elixir-ls/language_server.sh" }, cmd = { O.lang.elixir.lsp.path },
on_attach = require("lsp").common_on_attach, on_attach = require("lsp").common_on_attach,
} }
end end

View file

@ -1,7 +1,16 @@
local M = {} local M = {}
M.config = function() M.config = function()
O.lang.elm = {} local elm_bin = DATA_PATH .. "/lspinstall/elm/node_modules/.bin"
O.lang.elm = {
lsp = {
path = elm_bin .. "/elm-language-server",
format = elm_bin .. "/elm-format",
root = elm_bin,
test = elm_bin .. "/elm-test",
},
}
end end
M.format = function() M.format = function()
@ -20,13 +29,13 @@ M.lsp = function()
end end
require("lspconfig").elmls.setup { require("lspconfig").elmls.setup {
cmd = { DATA_PATH .. "/lspinstall/elm/node_modules/.bin/elm-language-server" }, cmd = { O.lang.elm.lsp.path },
on_attach = require("lsp").common_on_attach, on_attach = require("lsp").common_on_attach,
init_options = { init_options = {
elmAnalyseTrigger = "change", elmAnalyseTrigger = "change",
elmFormatPath = DATA_PATH .. "/lspinstall/elm/node_modules/.bin/elm-format", elmFormatPath = O.lang.elm.lsp.format,
elmPath = DATA_PATH .. "/lspinstall/elm/node_modules/.bin/elm", elmPath = O.lang.elm.lsp.root,
elmTestPath = DATA_PATH .. "/lspinstall/elm/node_modules/.bin/elm-test", elmTestPath = O.lang.elm.lsp.test,
}, },
} }
end end

View file

@ -11,6 +11,9 @@ M.config = function()
"golangcilint", "golangcilint",
"revive", "revive",
}, },
lsp = {
path = DATA_PATH .. "/lspinstall/go/gopls",
},
} }
end end
@ -40,7 +43,7 @@ end
M.lsp = function() M.lsp = function()
if not require("lv-utils").check_lsp_client_active "gopls" then if not require("lv-utils").check_lsp_client_active "gopls" then
require("lspconfig").gopls.setup { require("lspconfig").gopls.setup {
cmd = { DATA_PATH .. "/lspinstall/go/gopls" }, cmd = { O.lang.go.lsp.path },
settings = { gopls = { analyses = { unusedparams = true }, staticcheck = true } }, settings = { gopls = { analyses = { unusedparams = true }, staticcheck = true } },
root_dir = require("lspconfig").util.root_pattern(".git", "go.mod"), root_dir = require("lspconfig").util.root_pattern(".git", "go.mod"),
init_options = { usePlaceholders = true, completeUnimported = true }, init_options = { usePlaceholders = true, completeUnimported = true },

View file

@ -1,7 +1,11 @@
local M = {} local M = {}
M.config = function() M.config = function()
O.lang.graphql = {} O.lang.graphql = {
lsp = {
path = "graphql-lsp",
},
}
end end
M.format = function() M.format = function()
@ -20,7 +24,10 @@ M.lsp = function()
end end
-- npm install -g graphql-language-service-cli -- npm install -g graphql-language-service-cli
require("lspconfig").graphql.setup { on_attach = require("lsp").common_on_attach } require("lspconfig").graphql.setup {
cmd = { O.lang.graphql.lsp.path, "server", "-m", "stream" },
on_attach = require("lsp").common_on_attach,
}
end end
M.dap = function() M.dap = function()

View file

@ -7,6 +7,9 @@ M.config = function()
-- https://docs.errata.ai/vale/scoping#html -- https://docs.errata.ai/vale/scoping#html
"vale", "vale",
}, },
lsp = {
path = DATA_PATH .. "/lspinstall/html/vscode-html/html-language-features/server/dist/node/htmlServerMain.js",
},
} }
end end
@ -30,7 +33,7 @@ M.lsp = function()
require("lspconfig").html.setup { require("lspconfig").html.setup {
cmd = { cmd = {
"node", "node",
DATA_PATH .. "/lspinstall/html/vscode-html/html-language-features/server/dist/node/htmlServerMain.js", O.lang.html.lsp.path,
"--stdio", "--stdio",
}, },
on_attach = require("lsp").common_on_attach, on_attach = require("lsp").common_on_attach,

View file

@ -12,6 +12,9 @@ M.config = function()
args = { "-m", "json.tool" }, args = { "-m", "json.tool" },
stdin = true, stdin = true,
}, },
lsp = {
path = DATA_PATH .. "/lspinstall/json/vscode-json/json-language-features/server/dist/node/jsonServerMain.js",
},
} }
end end
@ -46,7 +49,7 @@ M.lsp = function()
require("lspconfig").jsonls.setup { require("lspconfig").jsonls.setup {
cmd = { cmd = {
"node", "node",
DATA_PATH .. "/lspinstall/json/vscode-json/json-language-features/server/dist/node/jsonServerMain.js", O.lang.json.lsp.path,
"--stdio", "--stdio",
}, },
on_attach = require("lsp").common_on_attach, on_attach = require("lsp").common_on_attach,

View file

@ -1,7 +1,11 @@
local M = {} local M = {}
M.config = function() M.config = function()
O.lang.julia = {} O.lang.julia = {
lsp = {
path = CONFIG_PATH .. "/lua/lsp/julia/run.jl",
},
}
end end
M.format = function() M.format = function()
@ -30,7 +34,7 @@ M.lsp = function()
"--startup-file=no", "--startup-file=no",
"--history-file=no", "--history-file=no",
-- vim.fn.expand "~/.config/nvim/lua/lsp/julia/run.jl", -- vim.fn.expand "~/.config/nvim/lua/lsp/julia/run.jl",
CONFIG_PATH .. "/lua/lsp/julia/run.jl", O.lang.julia.lsp.path,
} }
require("lspconfig").julials.setup { require("lspconfig").julials.setup {
cmd = cmd, cmd = cmd,

View file

@ -1,7 +1,11 @@
local M = {} local M = {}
M.config = function() M.config = function()
O.lang.kotlin = {} O.lang.kotlin = {
lsp = {
path = DATA_PATH .. "/lspinstall/kotlin/server/bin/kotlin-language-server",
},
}
end end
M.format = function() M.format = function()
@ -29,7 +33,7 @@ M.lsp = function()
local util = require "lspconfig/util" local util = require "lspconfig/util"
local bin_name = DATA_PATH .. "/lspinstall/kotlin/server/bin/kotlin-language-server" local bin_name = O.lang.kotlin.lsp.path
if vim.fn.has "win32" == 1 then if vim.fn.has "win32" == 1 then
bin_name = bin_name .. ".bat" bin_name = bin_name .. ".bat"
end end

View file

@ -13,6 +13,9 @@ M.config = function()
stdin = false, stdin = false,
}, },
linters = { "luacheck" }, linters = { "luacheck" },
lsp = {
path = DATA_PATH .. "/lspinstall/lua/sumneko-lua-language-server",
},
} }
end end
@ -43,11 +46,10 @@ end
M.lsp = function() M.lsp = function()
if not require("lv-utils").check_lsp_client_active "sumneko_lua" then if not require("lv-utils").check_lsp_client_active "sumneko_lua" then
-- https://github.com/sumneko/lua-language-server/wiki/Build-and-Run-(Standalone) -- https://github.com/sumneko/lua-language-server/wiki/Build-and-Run-(Standalone)
local sumneko_root_path = DATA_PATH .. "/lspinstall/lua" local sumneko_main = string.gsub(O.lang.lua.lsp.path, "sumneko-lua-language-server", "main.lua")
local sumneko_binary = sumneko_root_path .. "/sumneko-lua-language-server"
require("lspconfig").sumneko_lua.setup { require("lspconfig").sumneko_lua.setup {
cmd = { sumneko_binary, "-E", sumneko_root_path .. "/main.lua" }, cmd = { O.lang.lua.lsp.path, "-E", sumneko_main },
on_attach = require("lsp").common_on_attach, on_attach = require("lsp").common_on_attach,
settings = { settings = {
Lua = { Lua = {

View file

@ -21,6 +21,9 @@ M.config = function()
args = { "--standard=PSR12", vim.api.nvim_buf_get_name(0) }, args = { "--standard=PSR12", vim.api.nvim_buf_get_name(0) },
stdin = false, stdin = false,
}, },
lsp = {
path = DATA_PATH .. "/lspinstall/php/node_modules/.bin/intelephense",
},
} }
end end
@ -53,7 +56,7 @@ M.lsp = function()
end end
require("lspconfig").intelephense.setup { require("lspconfig").intelephense.setup {
cmd = { DATA_PATH .. "/lspinstall/php/node_modules/.bin/intelephense", "--stdio" }, cmd = { O.lang.php.lsp.path, "--stdio" },
on_attach = require("lsp").common_on_attach, on_attach = require("lsp").common_on_attach,
handlers = { handlers = {
["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { ["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {

View file

@ -25,6 +25,9 @@ M.config = function()
"pylint", "pylint",
"mypy", "mypy",
}, },
lsp = {
path = DATA_PATH .. "/lspinstall/python/node_modules/.bin/pyright-langserver",
},
} }
end end
@ -58,7 +61,7 @@ M.lsp = function()
-- npm i -g pyright -- npm i -g pyright
require("lspconfig").pyright.setup { require("lspconfig").pyright.setup {
cmd = { cmd = {
DATA_PATH .. "/lspinstall/python/node_modules/.bin/pyright-langserver", O.lang.python.lsp.path,
"--stdio", "--stdio",
}, },
on_attach = require("lsp").common_on_attach, on_attach = require("lsp").common_on_attach,

View file

@ -14,6 +14,9 @@ M.config = function()
stdin = true, stdin = true,
}, },
linters = { "ruby" }, linters = { "ruby" },
lsp = {
path = DATA_PATH .. "/lspinstall/ruby/solargraph/solargraph",
},
} }
end end
@ -48,7 +51,7 @@ M.lsp = function()
if not require("lv-utils").check_lsp_client_active "solargraph" then if not require("lv-utils").check_lsp_client_active "solargraph" then
-- If you are using rvm, make sure to change below configuration -- If you are using rvm, make sure to change below configuration
require("lspconfig").solargraph.setup { require("lspconfig").solargraph.setup {
cmd = { DATA_PATH .. "/lspinstall/ruby/solargraph/solargraph", "stdio" }, cmd = { O.lang.ruby.lsp.path, "stdio" },
on_attach = require("lsp").common_on_attach, on_attach = require("lsp").common_on_attach,
handlers = { handlers = {
["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { ["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {

View file

@ -19,6 +19,9 @@ M.config = function()
signs = true, signs = true,
underline = true, underline = true,
}, },
lsp = {
path = DATA_PATH .. "/lspinstall/rust/rust-analyzer",
},
} }
end end
@ -118,14 +121,14 @@ M.lsp = function()
-- these override the defaults set by rust-tools.nvim -- these override the defaults set by rust-tools.nvim
-- see https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#rust_analyzer -- see https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#rust_analyzer
server = { server = {
cmd = { DATA_PATH .. "/lspinstall/rust/rust-analyzer" }, cmd = { O.lang.rust.lsp.path },
on_attach = require("lsp").common_on_attach, on_attach = require("lsp").common_on_attach,
}, -- rust-analyser options }, -- rust-analyser options
} }
require("rust-tools").setup(opts) require("rust-tools").setup(opts)
else else
require("lspconfig").rust_analyzer.setup { require("lspconfig").rust_analyzer.setup {
cmd = { DATA_PATH .. "/lspinstall/rust/rust-analyzer" }, cmd = { O.lang.rust.lsp.path },
on_attach = require("lsp").common_on_attach, on_attach = require("lsp").common_on_attach,
filetypes = { "rust" }, filetypes = { "rust" },
root_dir = require("lspconfig.util").root_pattern("Cargo.toml", "rust-project.json"), root_dir = require("lspconfig.util").root_pattern("Cargo.toml", "rust-project.json"),

View file

@ -16,6 +16,9 @@ M.config = function()
stdin = false, stdin = false,
}, },
linters = { "shellcheck" }, linters = { "shellcheck" },
lsp = {
path = DATA_PATH .. "/lspinstall/bash/node_modules/.bin/bash-language-server",
},
} }
end end
@ -47,7 +50,7 @@ M.lsp = function()
if not require("lv-utils").check_lsp_client_active "bashls" then if not require("lv-utils").check_lsp_client_active "bashls" then
-- npm i -g bash-language-server -- npm i -g bash-language-server
require("lspconfig").bashls.setup { require("lspconfig").bashls.setup {
cmd = { DATA_PATH .. "/lspinstall/bash/node_modules/.bin/bash-language-server", "start" }, cmd = { O.lang.sh.lsp.path, "start" },
on_attach = require("lsp").common_on_attach, on_attach = require("lsp").common_on_attach,
filetypes = { "sh", "zsh" }, filetypes = { "sh", "zsh" },
} }

View file

@ -1,7 +1,11 @@
local M = {} local M = {}
M.config = function() M.config = function()
O.lang.svelte = {} O.lang.svelte = {
lsp = {
path = DATA_PATH .. "/lspinstall/svelte/node_modules/.bin/svelteserver",
},
}
end end
M.format = function() M.format = function()
@ -20,7 +24,7 @@ M.lsp = function()
end end
require("lspconfig").svelte.setup { require("lspconfig").svelte.setup {
cmd = { DATA_PATH .. "/lspinstall/svelte/node_modules/.bin/svelteserver", "--stdio" }, cmd = { O.lang.svelte.lsp.path, "--stdio" },
filetypes = { "svelte" }, filetypes = { "svelte" },
root_dir = require("lspconfig.util").root_pattern("package.json", ".git"), root_dir = require("lspconfig.util").root_pattern("package.json", ".git"),
on_attach = require("lsp").common_on_attach, on_attach = require("lsp").common_on_attach,

View file

@ -7,6 +7,9 @@ M.config = function()
args = {}, args = {},
stdin = true, stdin = true,
}, },
lsp = {
path = "sourcekit-lsp",
},
} }
end end
@ -38,7 +41,7 @@ M.lsp = function()
end end
require("lspconfig").sourcekit.setup { require("lspconfig").sourcekit.setup {
cmd = { "xcrun", "sourcekit-lsp" }, cmd = { "xcrun", O.lang.swift.lsp.path },
on_attach = require("lsp").common_on_attach, on_attach = require("lsp").common_on_attach,
filetypes = { "swift" }, filetypes = { "swift" },
} }

View file

@ -7,6 +7,9 @@ M.config = function()
args = { "fmt" }, args = { "fmt" },
stdin = false, stdin = false,
}, },
lsp = {
path = DATA_PATH .. "/lspinstall/terraform/terraform-ls",
},
} }
end end
@ -40,7 +43,7 @@ M.lsp = function()
end end
require("lspconfig").terraformls.setup { require("lspconfig").terraformls.setup {
cmd = { DATA_PATH .. "/lspinstall/terraform/terraform-ls", "serve" }, cmd = { O.lang.terraform.lsp.path, "serve" },
on_attach = require("lsp").common_on_attach, on_attach = require("lsp").common_on_attach,
filetypes = { "tf", "terraform", "hcl" }, filetypes = { "tf", "terraform", "hcl" },
} }

View file

@ -8,6 +8,9 @@ M.config = function()
diagnostics_delay = 300, diagnostics_delay = 300,
formatter_line_length = 80, formatter_line_length = 80,
latex_formatter = "latexindent", latex_formatter = "latexindent",
lsp = {
path = DATA_PATH .. "/lspinstall/latex/texlab",
},
build = { build = {
executable = "latexmk", executable = "latexmk",
args = { "-pdf", "-interaction=nonstopmode", "-synctex=1", "%f" }, args = { "-pdf", "-interaction=nonstopmode", "-synctex=1", "%f" },
@ -77,7 +80,7 @@ M.lsp = function()
end end
require("lspconfig").texlab.setup { require("lspconfig").texlab.setup {
cmd = { DATA_PATH .. "/lspinstall/latex/texlab" }, cmd = { O.lang.latex.lsp.path },
on_attach = require("lsp").common_on_attach, on_attach = require("lsp").common_on_attach,
handlers = { handlers = {
["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { ["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {

View file

@ -3,6 +3,9 @@ local M = {}
M.config = function() M.config = function()
O.lang.vim = { O.lang.vim = {
linters = { "vint" }, linters = { "vint" },
lsp = {
path = DATA_PATH .. "/lspinstall/vim/node_modules/.bin/vim-language-server",
},
} }
end end
@ -24,7 +27,7 @@ M.lsp = function()
-- npm install -g vim-language-server -- npm install -g vim-language-server
require("lspconfig").vimls.setup { require("lspconfig").vimls.setup {
cmd = { DATA_PATH .. "/lspinstall/vim/node_modules/.bin/vim-language-server", "--stdio" }, cmd = { O.lang.vim.lsp.path, "--stdio" },
on_attach = require("lsp").common_on_attach, on_attach = require("lsp").common_on_attach,
} }
end end

View file

@ -11,6 +11,9 @@ M.config = function()
stdin = true, stdin = true,
}, },
auto_import = true, auto_import = true,
lsp = {
path = DATA_PATH .. "/lspinstall/vue/node_modules/.bin/vls",
},
} }
end end
@ -53,7 +56,7 @@ M.lsp = function()
-- Vue language server configuration (vetur) -- Vue language server configuration (vetur)
require("lspconfig").vuels.setup { require("lspconfig").vuels.setup {
cmd = { DATA_PATH .. "/lspinstall/vue/node_modules/.bin/vls", "--stdio" }, cmd = { O.lang.vue.lsp.path, "--stdio" },
on_attach = require("lsp").common_on_attach, on_attach = require("lsp").common_on_attach,
} }

View file

@ -7,6 +7,9 @@ M.config = function()
args = { "--stdin-filepath", vim.api.nvim_buf_get_name(0), "--single-quote" }, args = { "--stdin-filepath", vim.api.nvim_buf_get_name(0), "--single-quote" },
stdin = true, stdin = true,
}, },
lsp = {
path = DATA_PATH .. "/lspinstall/yaml/node_modules/.bin/yaml-language-server",
},
} }
end end
@ -38,7 +41,7 @@ M.lsp = function()
-- npm install -g yaml-language-server -- npm install -g yaml-language-server
require("lspconfig").yamlls.setup { require("lspconfig").yamlls.setup {
cmd = { DATA_PATH .. "/lspinstall/yaml/node_modules/.bin/yaml-language-server", "--stdio" }, cmd = { O.lang.yaml.lsp.path, "--stdio" },
on_attach = require("lsp").common_on_attach, on_attach = require("lsp").common_on_attach,
} }
end end

View file

@ -7,6 +7,9 @@ M.config = function()
args = { "fmt" }, args = { "fmt" },
stdin = false, stdin = false,
}, },
lsp = {
path = "zls",
},
} }
end end
@ -41,6 +44,7 @@ M.lsp = function()
-- Further custom install zls in -- Further custom install zls in
-- https://github.com/zigtools/zls/wiki/Downloading-and-Building-ZLS -- https://github.com/zigtools/zls/wiki/Downloading-and-Building-ZLS
require("lspconfig").zls.setup { require("lspconfig").zls.setup {
cmd = { O.lang.zig.lsp.path },
root_dir = require("lspconfig").util.root_pattern(".git", "build.zig", "zls.json"), root_dir = require("lspconfig").util.root_pattern(".git", "build.zig", "zls.json"),
on_attach = require("lsp").common_on_attach, on_attach = require("lsp").common_on_attach,
} }

View file

@ -1,8 +1,11 @@
local M = {} local M = {}
M.config = function() M.config = function()
-- TODO: implement config for language O.lang.zsh = {
return "No config available!" lsp = {
path = DATA_PATH .. "/lspinstall/bash/node_modules/.bin/bash-language-server",
},
}
end end
M.format = function() M.format = function()
@ -35,7 +38,7 @@ M.lsp = function()
if not require("lv-utils").check_lsp_client_active "bashls" then if not require("lv-utils").check_lsp_client_active "bashls" then
-- npm i -g bash-language-server -- npm i -g bash-language-server
require("lspconfig").bashls.setup { require("lspconfig").bashls.setup {
cmd = { DATA_PATH .. "/lspinstall/bash/node_modules/.bin/bash-language-server", "start" }, cmd = { O.lang.zsh.lsp.path, "start" },
on_attach = require("lsp").common_on_attach, on_attach = require("lsp").common_on_attach,
filetypes = { "sh", "zsh" }, filetypes = { "sh", "zsh" },
} }