Skip to content

Commit

Permalink
feat(nvim): replace rust-tools with native inlay hints (#915)
Browse files Browse the repository at this point in the history
topic:featnvim-replace-rust-tools-with-native-inlay-hints
  • Loading branch information
kaihowl authored Jan 1, 2025
1 parent 855fba2 commit a5d0c67
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
1 change: 0 additions & 1 deletion home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ in
enable = true;
plugins= with pkgs.vimPlugins; [
nvim-lspconfig
rust-tools-nvim
plenary-nvim
kotlin-vim
markdown-preview-nvim
Expand Down
19 changes: 7 additions & 12 deletions nvim/config--nvim--init.vim.symlink
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,10 @@ local on_attach = function(client, bufnr)
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end

if vim.lsp.inlay_hint then
vim.lsp.inlay_hint.enable(true, { 0 })
end

-- Enable completion triggered by <c-x><c-o>
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')

Expand Down Expand Up @@ -987,18 +991,9 @@ configs.efm.setup {
}

if (os.getenv('DOTFILES_PROFILE') or 'full') == 'full' then
require('rust-tools').setup {
server = {
on_attach = on_attach,
capabilities = capabilities,
settings = {
["rust-analyzer"] = {
checkOnSave = {
command = "clippy"
}
}
}
}
configs.rust_analyzer.setup{
on_attach = on_attach,
capabilities = capabilities,
}
end

Expand Down

0 comments on commit a5d0c67

Please sign in to comment.