mirror of
https://github.com/tuxdotrs/tawm.git
synced 2025-07-05 20:56:33 +05:30
add rust support
This commit is contained in:
@ -4,7 +4,7 @@ local capabilities = configs.capabilities
|
||||
|
||||
local lspconfig = require("lspconfig")
|
||||
|
||||
local servers = { "tsserver", "tailwindcss", "eslint", "gopls" }
|
||||
local servers = { "tsserver", "tailwindcss", "eslint", "gopls", "rust_analyzer" }
|
||||
|
||||
local function organize_imports()
|
||||
local params = {
|
||||
|
@ -21,6 +21,9 @@ M.treesitter = {
|
||||
"gomod",
|
||||
"gowork",
|
||||
"gosum",
|
||||
|
||||
-- rust
|
||||
"rust",
|
||||
},
|
||||
}
|
||||
|
||||
@ -42,6 +45,11 @@ M.mason = {
|
||||
|
||||
-- nix
|
||||
"nil",
|
||||
|
||||
-- rust
|
||||
"rust-analyzer",
|
||||
"rustfmt",
|
||||
"codelldb",
|
||||
},
|
||||
}
|
||||
|
||||
|
17
pkgs/nvchad/nvim/lua/configs/rustaceanvim.lua
Normal file
17
pkgs/nvchad/nvim/lua/configs/rustaceanvim.lua
Normal file
@ -0,0 +1,17 @@
|
||||
local configs = require("nvchad.configs.lspconfig")
|
||||
local on_attach = configs.on_attach
|
||||
local capabilities = configs.capabilities
|
||||
|
||||
vim.g.rustaceanvim = {
|
||||
server = {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
default_settings = {
|
||||
["rust-analyzer"] = {
|
||||
cargo = {
|
||||
allFeatures = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
@ -98,7 +98,6 @@ local plugins = {
|
||||
dependencies = {
|
||||
"ray-x/guihua.lua",
|
||||
"neovim/nvim-lspconfig",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"mfussenegger/nvim-dap",
|
||||
"rcarriga/nvim-dap-ui",
|
||||
"theHamsta/nvim-dap-virtual-text",
|
||||
@ -110,5 +109,19 @@ local plugins = {
|
||||
ft = { "go", "gomod" },
|
||||
build = ':lua require("go.install").update_all_sync()',
|
||||
},
|
||||
{
|
||||
"mrcjkb/rustaceanvim",
|
||||
version = "^4",
|
||||
ft = { "rust" },
|
||||
config = function()
|
||||
require("configs.rustaceanvim")
|
||||
end,
|
||||
dependencies = {
|
||||
"neovim/nvim-lspconfig",
|
||||
"mfussenegger/nvim-dap",
|
||||
"rcarriga/nvim-dap-ui",
|
||||
"theHamsta/nvim-dap-virtual-text",
|
||||
},
|
||||
},
|
||||
}
|
||||
return plugins
|
||||
|
Reference in New Issue
Block a user