aboutsummaryrefslogtreecommitdiff
path: root/lua/plugins/lsp.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/plugins/lsp.lua')
-rw-r--r--lua/plugins/lsp.lua33
1 files changed, 33 insertions, 0 deletions
diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua
index 855818f..1818640 100644
--- a/lua/plugins/lsp.lua
+++ b/lua/plugins/lsp.lua
@@ -296,6 +296,39 @@ require("lspconfig").rust_analyzer.setup{
}
end
+local opts = {
+ tools = {
+ runnables = {
+ use_telescope = true,
+ },
+ inlay_hints = {
+ auto = true,
+ show_parameter_hints = false,
+ parameter_hints_prefix = "",
+ other_hints_prefix = "",
+ },
+ },
+
+ -- all the opts to send to nvim-lspconfig
+ -- these override the defaults set by rust-tools.nvim
+ -- see https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#rust_analyzer
+ server = {
+ -- on_attach is a callback called when the language server attachs to the buffer
+ on_attach = on_attach,
+ settings = {
+ -- to enable rust-analyzer settings visit:
+ -- https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/generated_config.adoc
+ ["rust-analyzer"] = {
+ -- enable clippy on save
+ checkOnSave = {
+ command = "clippy",
+ },
+ },
+ },
+ },
+}
+require('rust-tools').setup(opts)
+
vim.diagnostic.config({
underline = false,
signs = true,