]> git.huck.website - nvim.git/commitdiff
updated: rust analyzer settings
authorHuck Boles <huck@huck.website>
Mon, 12 Jun 2023 15:03:17 +0000 (10:03 -0500)
committerHuck Boles <huck@huck.website>
Mon, 12 Jun 2023 15:03:17 +0000 (10:03 -0500)
lua/plugins/lsp.lua

index c86eaabf08625abdbb261c091ea2e5c11353cd55..569554ddbc5ccbbf23d2833a5b40576b47c71d69 100644 (file)
@@ -78,6 +78,44 @@ return {
         config = function()
             -- servers to setup
             local lsp = require("lspconfig")
+            lsp.rust_analyzer.setup({
+                settings = {
+                    ['rust-analyzer'] = {
+                        completion = {
+                            privateEditable = true,
+                            completionItem = {
+                                preselectSupport = true,
+                                snippetSupport = true,
+                            }
+                        },
+                        hover = {
+                            actions = {
+                                enable = true,
+                                references = true,
+                            }
+                        },
+                        imports = {
+                            granularity = {
+                                enforce = true,
+                            },
+                            group = true,
+                            prefix = "self",
+                        },
+                        inlayHints = {
+                            closureCaptureHints       = true,
+                            closureReturnTypeHints    = true,
+                            lifetimeElisionHints      = true,
+                            discriminantHints         = true,
+                            expressionAdjustmentHints = { enable = true, mode = "postfix" },
+                            closingBraceHints         = { enable = true, minLines = 1 },
+                        },
+                        highlightRelated = { enable = true },
+                        magicCompletions = { enable = true },
+                        procMacro = {
+                            enable = true
+                        } }
+                }
+            })
             lsp.awk_ls.setup({})
             lsp.bashls.setup({})
             lsp.clangd.setup({})
@@ -89,7 +127,6 @@ return {
             lsp.lua_ls.setup({})
             lsp.marksman.setup({})
             lsp.solargraph.setup({})
-            lsp.rust_analyzer.setup({})
             lsp.taplo.setup({})
             lsp.yamlls.setup({})