From 08071ec95af6080e08105b4afc49a9df38ef3d29 Mon Sep 17 00:00:00 2001 From: Gabe Venberg Date: Fri, 19 Aug 2022 18:51:57 -0500 Subject: [PATCH] fixed broken rust-tools --- neovim/.config/nvim/lua/packages.lua | 2 +- neovim/.config/nvim/lua/rust-tools-setup.lua | 137 ++++++++++--------- 2 files changed, 70 insertions(+), 69 deletions(-) diff --git a/neovim/.config/nvim/lua/packages.lua b/neovim/.config/nvim/lua/packages.lua index 682c6b0..26b5d9e 100644 --- a/neovim/.config/nvim/lua/packages.lua +++ b/neovim/.config/nvim/lua/packages.lua @@ -58,12 +58,12 @@ return require('packer').startup(function(use) { "neovim/nvim-lspconfig", after = "mason-lspconfig.nvim", + after = "rust-tools.nvim", config = function() require('LSPconfig') end }, {'simrat39/rust-tools.nvim', - after = "nvim-lspconfig", } } diff --git a/neovim/.config/nvim/lua/rust-tools-setup.lua b/neovim/.config/nvim/lua/rust-tools-setup.lua index 1ec50ac..263e121 100644 --- a/neovim/.config/nvim/lua/rust-tools-setup.lua +++ b/neovim/.config/nvim/lua/rust-tools-setup.lua @@ -1,78 +1,79 @@ local nvim_lsp = require'lspconfig' local opts = { tools = { - autoSetHints = true, - RustHoverActions = true, + autoSetHints = true, + RustHoverActions = true, - -- how to execute terminal commands - executor = require("rust-tools/executors").termopen, - inlay_hints = { - -- Only show inlay hints for the current line - only_current_line = false, - -- Event which triggers a refersh of the inlay hints. - only_current_line_autocmd = "CursorHold", - -- whether to show parameter hints with the inlay hints or not - show_parameter_hints = true, - -- whether to show variable name before type hints with the inlay hints or not - show_variable_name = false, - -- prefix for parameter hints - parameter_hints_prefix = "<- ", - -- prefix for all the other hints (type, chaining) - other_hints_prefix = "=> ", - -- whether to align to the lenght of the longest line in the file - max_len_align = false, - -- padding from the left if max_len_align is true - max_len_align_padding = 1, - -- whether to align to the extreme right or not - right_align = true, - -- padding from the right if right_align is true - right_align_padding = 7, - -- The color of the hints - highlight = "Comment", - }, - hover_actions = { - -- the border that is used for the hover window - border = { - { "╭", "FloatBorder" }, - { "─", "FloatBorder" }, - { "╮", "FloatBorder" }, - { "│", "FloatBorder" }, - { "╯", "FloatBorder" }, - { "─", "FloatBorder" }, - { "╰", "FloatBorder" }, - { "│", "FloatBorder" }, + -- how to execute terminal commands + executor = require("rust-tools/executors").termopen, + inlay_hints = { + auto=true, + -- Only show inlay hints for the current line + only_current_line = false, + -- Event which triggers a refersh of the inlay hints. + only_current_line_autocmd = "CursorHold", + -- whether to show parameter hints with the inlay hints or not + show_parameter_hints = true, + -- whether to show variable name before type hints with the inlay hints or not + show_variable_name = false, + -- prefix for parameter hints + parameter_hints_prefix = "<- ", + -- prefix for all the other hints (type, chaining) + other_hints_prefix = "=> ", + -- whether to align to the lenght of the longest line in the file + max_len_align = false, + -- padding from the left if max_len_align is true + max_len_align_padding = 1, + -- whether to align to the extreme right or not + right_align = true, + -- padding from the right if right_align is true + right_align_padding = 7, + -- The color of the hints + highlight = "Comment", }, - -- whether the hover action window gets automatically focused - auto_focus = false, - }, - -- settings for showing the crate graph based on graphviz and the dot - -- command - crate_graph = { - -- Backend used for displaying the graph - backend = "x11", - -- where to store the output, nil for no output stored (relative - -- path from pwd) - output = nil, - -- true for all crates.io and external crates, false only the local - -- crates - full = true, - }, -}, --- all the opts to send to nvim-lspconfig -server = { - -- standalone file support - -- setting it to false may improve startup time - standalone = true, - settings = { - -- rust-analyer options - ["rust-analyzer"] = { - -- enable clippy on save - checkOnSave = { - command = "clippy" + hover_actions = { + -- the border that is used for the hover window + border = { + { "╭", "FloatBorder" }, + { "─", "FloatBorder" }, + { "╮", "FloatBorder" }, + { "│", "FloatBorder" }, + { "╯", "FloatBorder" }, + { "─", "FloatBorder" }, + { "╰", "FloatBorder" }, + { "│", "FloatBorder" }, }, + -- whether the hover action window gets automatically focused + auto_focus = false, + }, + -- settings for showing the crate graph based on graphviz and the dot + -- command + crate_graph = { + -- Backend used for displaying the graph + backend = "x11", + -- where to store the output, nil for no output stored (relative + -- path from pwd) + output = nil, + -- true for all crates.io and external crates, false only the local + -- crates + full = true, + }, + }, + -- all the opts to send to nvim-lspconfig + server = { + -- standalone file support + -- setting it to false may improve startup time + standalone = true, + settings = { + -- rust-analyer options + ["rust-analyzer"] = { + -- enable clippy on save + checkOnSave = { + command = "clippy" + }, + } } - } -}, + }, -- debugging stuff dap = { adapter = {