Added rust lsp and parsing in tree-sitter
This commit is contained in:
Pkoenig2 2026-06-18 18:48:16 -07:00
parent e8af44278a
commit 42eb72eb80
1 changed files with 22 additions and 4 deletions

View File

@ -683,7 +683,8 @@ do
-- If you're wondering about lsp vs treesitter, you can check out the wonderfully -- If you're wondering about lsp vs treesitter, you can check out the wonderfully
-- and elegantly composed help section, `:help lsp-vs-treesitter` -- and elegantly composed help section, `:help lsp-vs-treesitter`
-- Useful status updates for LSP.
-- Useful status updates for LSP.
vim.pack.add { gh 'j-hui/fidget.nvim' } vim.pack.add { gh 'j-hui/fidget.nvim' }
require('fidget').setup {} require('fidget').setup {}
@ -844,6 +845,22 @@ do
-- Automatically install LSPs and related tools to stdpath for Neovim -- Automatically install LSPs and related tools to stdpath for Neovim
require('mason').setup {} require('mason').setup {}
vim.pack.add({
{ src = "https://github.com/mrcjkb/rustaceanvim" },
})
vim.g.rustaceanvim = {
server = {
on_attach = function(client, bufnr)
vim.keymap.set("n", "<C-space>", function()
vim.cmd.RustLsp { 'hover', 'actions' }
end, { buffer = bufnr })
vim.keymap.set("n", "<Leader>a", function()
vim.cmd.RustLsp('codeAction')
end, { buffer = bufnr })
end,
},
}
-- Ensure the servers and tools above are installed -- Ensure the servers and tools above are installed
-- --
-- To check the current status of installed tools and/or manually install -- To check the current status of installed tools and/or manually install
@ -864,8 +881,8 @@ do
end end
end end
vim.pack.add { vim.pack.add {
gh 'dstein64/nvim-scrollview' gh 'dstein64/nvim-scrollview',
} }
@ -886,6 +903,7 @@ end
end, end,
}) })
-- ============================================================ -- ============================================================
-- SECTION 7: FORMATTING -- SECTION 7: FORMATTING
-- conform.nvim setup and keymap -- conform.nvim setup and keymap
@ -1020,7 +1038,7 @@ do
vim.pack.add { { src = gh 'nvim-treesitter/nvim-treesitter', version = 'main' } } vim.pack.add { { src = gh 'nvim-treesitter/nvim-treesitter', version = 'main' } }
require('nvim-treesitter.install').compilers = { 'zig' } require('nvim-treesitter.install').compilers = { 'zig' }
-- Ensure basic parsers are installed -- Ensure basic parsers are installed
local parsers = {'zig', 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc', 'python' } local parsers = {'zig', 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc', 'python', "rust" }
require('nvim-treesitter').install(parsers) require('nvim-treesitter').install(parsers)
---@param buf integer ---@param buf integer