mirror of
https://codeberg.org/Mo8it/dotfiles.git
synced 2025-01-01 15:39:20 +00:00
Add clangd
This commit is contained in:
parent
9937abf25b
commit
dd4d5b842c
1 changed files with 15 additions and 8 deletions
|
@ -17,10 +17,12 @@ local function format_on_save(client)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local lsp_signature = require("lsp_signature")
|
||||||
|
|
||||||
lspconfig["pylsp"].setup({
|
lspconfig["pylsp"].setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = function(client, bufnr)
|
on_attach = function(client, bufnr)
|
||||||
require("lsp_signature").on_attach()
|
lsp_signature.on_attach()
|
||||||
|
|
||||||
-- Disable formatting
|
-- Disable formatting
|
||||||
client.resolved_capabilities.document_formatting = false
|
client.resolved_capabilities.document_formatting = false
|
||||||
|
@ -28,16 +30,23 @@ lspconfig["pylsp"].setup({
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
local function on_attach_with_formatting(client, bufnr)
|
||||||
|
lsp_signature.on_attach()
|
||||||
|
format_on_save(client)
|
||||||
|
end
|
||||||
|
|
||||||
lspconfig["julials"].setup({
|
lspconfig["julials"].setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = function(client, bufnr)
|
on_attach = on_attach_with_formatting,
|
||||||
require("lsp_signature").on_attach()
|
})
|
||||||
format_on_save(client)
|
|
||||||
end,
|
lspconfig["clangd"].setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach_with_formatting,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- null-ls
|
-- null-ls
|
||||||
null_ls = require("null-ls")
|
local null_ls = require("null-ls")
|
||||||
|
|
||||||
null_ls.setup({
|
null_ls.setup({
|
||||||
sources = {
|
sources = {
|
||||||
|
@ -49,8 +58,6 @@ null_ls.setup({
|
||||||
null_ls.builtins.formatting.shellharden,
|
null_ls.builtins.formatting.shellharden,
|
||||||
null_ls.builtins.formatting.shfmt,
|
null_ls.builtins.formatting.shfmt,
|
||||||
null_ls.builtins.formatting.taplo,
|
null_ls.builtins.formatting.taplo,
|
||||||
-- cpp
|
|
||||||
null_ls.builtins.formatting.clang_format,
|
|
||||||
},
|
},
|
||||||
on_attach = format_on_save,
|
on_attach = format_on_save,
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue