Initial config
This commit is contained in:
9
lsp/on_attach.lua
Normal file
9
lsp/on_attach.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
return function(client, bufnr)
|
||||
if client.server_capabilities.inlayHintProvider then
|
||||
local inlayhints_avail, inlayhints = pcall(require, "lsp-inlayhints")
|
||||
if inlayhints_avail then
|
||||
inlayhints.on_attach(client, bufnr)
|
||||
vim.keymap.set("n", "<leader>uH", function() inlayhints.toggle() end, { desc = "Toggle inlay hints" })
|
||||
end
|
||||
end
|
||||
end
|
5
lsp/server-settings/clangd.lua
Normal file
5
lsp/server-settings/clangd.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
capabilities = {
|
||||
offsetEncoding = "utf-8",
|
||||
},
|
||||
}
|
15
lsp/server-settings/rust_analyzer.lua
Normal file
15
lsp/server-settings/rust_analyzer.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
return {
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
checkOnSave = {
|
||||
command = "clippy",
|
||||
extraArgs = {
|
||||
"--all-features",
|
||||
"--",
|
||||
"-W", "clippy::pedantic",
|
||||
"-W", "clippy::nursery",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
Reference in New Issue
Block a user