feat(nvim): add custom nginx lsp server conf
This commit is contained in:
parent
86a3d3afc6
commit
a9ed33f30a
@ -20,8 +20,9 @@ local opts = {
|
|||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local lsp_server_bin_dir = vim.fn.stdpath("data") .. "/mason/bin/"
|
||||||
local rust_tools = require("rust-tools")
|
local rust_tools = require("rust-tools")
|
||||||
local codelldb_path = vim.fn.stdpath("data") .. "/mason/bin/codelldb"
|
local codelldb_path = lsp_server_bin_dir .. "codelldb"
|
||||||
local liblldb_path = vim.fn.stdpath("data") .. "/mason/packages/codelldb/extension/lldb/lib/liblldb.so"
|
local liblldb_path = vim.fn.stdpath("data") .. "/mason/packages/codelldb/extension/lldb/lib/liblldb.so"
|
||||||
local rustopts = {
|
local rustopts = {
|
||||||
server = opts,
|
server = opts,
|
||||||
@ -335,3 +336,22 @@ for _, server in ipairs({
|
|||||||
}) do
|
}) do
|
||||||
lspconfig[server].setup(opts)
|
lspconfig[server].setup(opts)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Custom Servers outside of lspconfig
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
pattern = "nginx",
|
||||||
|
desc = "Nginx Language Server Handler",
|
||||||
|
callback = function()
|
||||||
|
local client_id = vim.lsp.start({
|
||||||
|
name = "Nginx-ls",
|
||||||
|
cmd = { lsp_server_bin_dir .. "nginx-language-server" },
|
||||||
|
root_dir = vim.fn.getcwd(),
|
||||||
|
capabilities = vim.lsp.protocol.make_client_capabilities(),
|
||||||
|
on_attach = on_attach
|
||||||
|
})
|
||||||
|
|
||||||
|
if client_id then
|
||||||
|
vim.lsp.buf_attach_client(0, client_id)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user