diff options
author | Bobby Bingham <koorogi@koorogi.info> | 2023-05-14 12:32:03 -0500 |
---|---|---|
committer | Bobby Bingham <koorogi@koorogi.info> | 2023-05-14 12:32:03 -0500 |
commit | fbe1bf75657ecf7198f4e064f34c84745368dc42 (patch) | |
tree | af80dc16c95f0716e8f95b49943cba4096db195e | |
parent | d1e8e26f31d5e8357aa5f35c2003db6bd9e74b09 (diff) |
nvim: lsp support for rust
-rw-r--r-- | nvim/.config/nvim/lua/lsp_config.lua | 28 | ||||
-rw-r--r-- | nvim/.config/nvim/lua/plugins.lua | 1 |
2 files changed, 29 insertions, 0 deletions
diff --git a/nvim/.config/nvim/lua/lsp_config.lua b/nvim/.config/nvim/lua/lsp_config.lua index d5fcf14..792811a 100644 --- a/nvim/.config/nvim/lua/lsp_config.lua +++ b/nvim/.config/nvim/lua/lsp_config.lua @@ -64,6 +64,34 @@ for _, lsp in pairs(servers) do }) end +-- rust +require("rust-tools").setup({ + tools = { + runnables = { + use_telescope = true, + }, + inlay_hints = { + auto = true, + show_parameter_hints = false, + parameter_hints_prefix = "", + other_hints_prefix = "", + }, + }, + + -- options to send to nvim-lspconfig + server = { + on_attach = on_attach, + capabilities = capabilities, + settings = { + ["rust-analyzer"] = { + checkOnSave = { + command = "clippy", + }, + }, + }, + }, +}) + -- overrides for typescript lspconfig.tsserver.setup({ on_attach = function(client, bufnr) diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index a60c9de..7c4e4d4 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -74,6 +74,7 @@ require('packer').startup(function() 'jose-elias-alvarez/null-ls.nvim', 'jose-elias-alvarez/nvim-lsp-ts-utils', 'hrsh7th/cmp-nvim-lsp', + 'simrat39/rust-tools.nvim', }, config = function() require('lsp_config') end, } |