mirror of
https://github.com/tuxdotrs/tawm.git
synced 2025-07-06 13:06:35 +05:30
add rust support
This commit is contained in:
@ -4,7 +4,7 @@ local capabilities = configs.capabilities
|
|||||||
|
|
||||||
local lspconfig = require("lspconfig")
|
local lspconfig = require("lspconfig")
|
||||||
|
|
||||||
local servers = { "tsserver", "tailwindcss", "eslint", "gopls" }
|
local servers = { "tsserver", "tailwindcss", "eslint", "gopls", "rust_analyzer" }
|
||||||
|
|
||||||
local function organize_imports()
|
local function organize_imports()
|
||||||
local params = {
|
local params = {
|
||||||
|
@ -21,6 +21,9 @@ M.treesitter = {
|
|||||||
"gomod",
|
"gomod",
|
||||||
"gowork",
|
"gowork",
|
||||||
"gosum",
|
"gosum",
|
||||||
|
|
||||||
|
-- rust
|
||||||
|
"rust",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,6 +45,11 @@ M.mason = {
|
|||||||
|
|
||||||
-- nix
|
-- nix
|
||||||
"nil",
|
"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 = {
|
dependencies = {
|
||||||
"ray-x/guihua.lua",
|
"ray-x/guihua.lua",
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
"mfussenegger/nvim-dap",
|
"mfussenegger/nvim-dap",
|
||||||
"rcarriga/nvim-dap-ui",
|
"rcarriga/nvim-dap-ui",
|
||||||
"theHamsta/nvim-dap-virtual-text",
|
"theHamsta/nvim-dap-virtual-text",
|
||||||
@ -110,5 +109,19 @@ local plugins = {
|
|||||||
ft = { "go", "gomod" },
|
ft = { "go", "gomod" },
|
||||||
build = ':lua require("go.install").update_all_sync()',
|
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
|
return plugins
|
||||||
|
Reference in New Issue
Block a user