summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Clawsie <brad@b7j0c.org>2023-04-12 16:12:54 -0500
committerBrad Clawsie <brad@b7j0c.org>2023-04-12 16:12:54 -0500
commit21c68324d80654f717aacb847c0b57b368eb8613 (patch)
tree849bb026c4a5a66bf93c4eaf902b666e8f5b6183
parent73dc5cd4498b0493ea723bd2fe8804fc7c08c6ad (diff)
rust-anbalyzer
-rw-r--r--nvim/lspconfig.lua40
1 files changed, 40 insertions, 0 deletions
diff --git a/nvim/lspconfig.lua b/nvim/lspconfig.lua
new file mode 100644
index 0000000..6d1d920
--- /dev/null
+++ b/nvim/lspconfig.lua
@@ -0,0 +1,40 @@
+return {
+ {
+ "neovim/nvim-lspconfig",
+ dependencies = {
+ "simrat39/rust-tools.nvim",
+ },
+ opts = {
+ servers = {
+ rust_analyzer = {
+ mason = false,
+ cmd = { vim.fn.expand("/usr/sbin/rust-analyzer") },
+ settings = {
+ ["rust-analyzer"] = {
+ imports = {
+ granularity = {
+ group = "module",
+ },
+ prefix = "self",
+ },
+ cargo = {
+ buildScripts = {
+ enable = true,
+ },
+ },
+ procMacro = {
+ enable = true,
+ },
+ },
+ },
+ },
+ },
+ setup = {
+ rust_analyzer = function(_, opts)
+ require("rust-tools").setup({ server = opts })
+ return true
+ end,
+ },
+ },
+ },
+}