aboutsummaryrefslogtreecommitdiff
path: root/lsp.lua
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2024-05-03 14:27:26 +0100
committerJuan J. Martinez <jjm@usebox.net>2024-05-03 14:27:26 +0100
commit4a04c8dae449bf983342e1647f963644156dac74 (patch)
tree5864f544a21ccc1842c1b93100bd0c0ec790c3bb /lsp.lua
parentd16de57d96bd99772dcc2253d4fa0f334071006e (diff)
downloaddotnvim-master.tar.gz
dotnvim-master.zip
Added rust LSP, cleaned up a littleHEADmaster
Diffstat (limited to 'lsp.lua')
-rw-r--r--lsp.lua40
1 files changed, 27 insertions, 13 deletions
diff --git a/lsp.lua b/lsp.lua
index fabb8d5..5ffce6d 100644
--- a/lsp.lua
+++ b/lsp.lua
@@ -34,16 +34,16 @@ end
-- better UI
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(
- vim.lsp.handlers.hover, {
- -- Use a sharp border with `FloatBorder` highlights
- border = "single"
- }
+vim.lsp.handlers.hover, {
+ -- Use a sharp border with `FloatBorder` highlights
+ border = "single"
+}
)
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(
- vim.lsp.handlers.signature_help, {
- -- Use a sharp border with `FloatBorder` highlights
- border = "single"
- }
+vim.lsp.handlers.signature_help, {
+ -- Use a sharp border with `FloatBorder` highlights
+ border = "single"
+}
)
-- Use a loop to conveniently call 'setup' on multiple servers and
@@ -70,14 +70,28 @@ local servers = {
lua_ls = {
lua_ls = { },
},
+ rust_analyzer = {
+ ["rust-analyzer"] = {
+ imports = {
+ granularity = {
+ group = "module",
+ },
+ prefix = "self",
+ },
+ cargo = {
+ buildScripts = {
+ enable = true,
+ },
+ },
+ procMacro = {
+ enable = true
+ },
+ },
+ },
}
for lsp, settings in pairs(servers) do
require('lspconfig')[lsp].setup {
on_attach = on_attach,
- flags = {
- -- This will be the default in neovim 0.7+
- debounce_text_changes = 150,
- },
settings = settings,
}
end
@@ -88,5 +102,5 @@ vim.diagnostic.config({ virtual_text = true, signs = true })
require("trouble").setup()
vim.api.nvim_set_keymap("n", "<leader>xx", "<cmd>TroubleToggle<cr>",
- {silent = true, noremap = true}
+{silent = true, noremap = true}
)