From d57e050ea870c4e97d056bcd4aff94439de10838 Mon Sep 17 00:00:00 2001 From: Luke Else Date: Thu, 16 Mar 2023 22:25:40 +0000 Subject: [PATCH] Reverted to when RT was present (Note lsp keybinds not working) --- nvim/after/plugin/inlay.lua | 20 ---------------- nvim/after/plugin/rt.lua | 45 +++++++++++++++++++++++++++++++++++ nvim/lua/luke-else/packer.lua | 4 ++-- 3 files changed, 47 insertions(+), 22 deletions(-) delete mode 100644 nvim/after/plugin/inlay.lua create mode 100644 nvim/after/plugin/rt.lua diff --git a/nvim/after/plugin/inlay.lua b/nvim/after/plugin/inlay.lua deleted file mode 100644 index be594cc..0000000 --- a/nvim/after/plugin/inlay.lua +++ /dev/null @@ -1,20 +0,0 @@ -local inlay_hints = require('lsp_extensions.inlay_hints') - -local M = {} - --- Global function, so you can just call it on the lua side -ShowInlineInlayHints = function() - vim.lsp.buf_request(0, 'rust-analyzer/inlayHints', inlay_hints.get_params(), inlay_hints.get_callback { - only_current_line = true - }) -end - --- @rockerboo -M.show_line_hints_on_cursor_events = function() - vim.cmd [[augroup ShowLineHints]] - vim.cmd [[ au!]] - vim.cmd [[ autocmd CursorHold,CursorHoldI,CursorMoved *.rs :lua ShowInlineInlayHints()]] - vim.cmd [[augroup END]] -end - -return M \ No newline at end of file diff --git a/nvim/after/plugin/rt.lua b/nvim/after/plugin/rt.lua new file mode 100644 index 0000000..d13b47b --- /dev/null +++ b/nvim/after/plugin/rt.lua @@ -0,0 +1,45 @@ +local opts = { + tools = { -- rust-tools options + -- automatically call RustReloadWorkspace when writing to a Cargo.toml file. + reload_workspace_from_cargo_toml = true, + + -- These apply to the default RustSetInlayHints command + inlay_hints = { + -- automatically set inlay hints (type hints) + -- default: true + auto = true, + + -- Only show inlay hints for the current line + only_current_line = false, + + -- whether to show parameter hints with the inlay hints or not + -- default: true + show_parameter_hints = true, + + -- prefix for parameter hints + -- default: "<-" + parameter_hints_prefix = "<- ", + + -- prefix for all the other hints (type, chaining) + -- default: "=>" + other_hints_prefix = "=> ", + + -- whether to align to the length 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 = false, + + -- padding from the right if right_align is true + right_align_padding = 7, + + -- The color of the hints + highlight = "Comment", + }, + }, + } + + require('rust-tools').setup(opts) \ No newline at end of file diff --git a/nvim/lua/luke-else/packer.lua b/nvim/lua/luke-else/packer.lua index 9a18ccd..201efab 100644 --- a/nvim/lua/luke-else/packer.lua +++ b/nvim/lua/luke-else/packer.lua @@ -57,8 +57,8 @@ return require('packer').startup(function(use) } } - -- Type Inlay - use('nvim-lua/lsp_extensions.nvim') + -- Rust tools + use 'simrat39/rust-tools.nvim' -- Debugger use 'nvim-lua/plenary.nvim'