mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-26 10:48:45 +02:00
refactor: LazyVim.lsp.on_attach
This commit is contained in:
parent
6098a36d92
commit
8f7ee56dab
6 changed files with 32 additions and 42 deletions
|
@ -1,13 +1,3 @@
|
|||
LazyVim.lsp.on_attach(function(client, buffer)
|
||||
if client.name == "yamlls" then
|
||||
if vim.api.nvim_get_option_value("filetype", { buf = buffer }) == "helm" then
|
||||
vim.schedule(function()
|
||||
vim.cmd("LspStop ++force yamlls")
|
||||
end)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
|
@ -25,9 +15,19 @@ return {
|
|||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
yamlls = {},
|
||||
helm_ls = {},
|
||||
},
|
||||
setup = {
|
||||
yamlls = function()
|
||||
LazyVim.lsp.on_attach(function(client, buffer)
|
||||
if vim.bo[buffer].filetype == "helm" then
|
||||
vim.schedule(function()
|
||||
vim.cmd("LspStop ++force yamlls")
|
||||
end)
|
||||
end
|
||||
end, "yamlls")
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue