Many improvements.
This commit is contained in:
parent
bcb5556f7c
commit
30e94f86f0
10 changed files with 247 additions and 7 deletions
|
|
@ -1,5 +1,7 @@
|
|||
require("lspconfig").basedpyright.setup({})
|
||||
require("lspconfig").ruff.setup({})
|
||||
local capabilities = require("blink.cmp").get_lsp_capabilities()
|
||||
|
||||
require("lspconfig").basedpyright.setup({ capabilities = capabilities })
|
||||
require("lspconfig").ruff.setup({ capabilities = capabilities })
|
||||
|
||||
require("lspconfig").lua_ls.setup({
|
||||
on_init = function(client)
|
||||
|
|
@ -31,4 +33,73 @@ require("lspconfig").lua_ls.setup({
|
|||
settings = {
|
||||
Lua = {},
|
||||
},
|
||||
capabilities = capabilities,
|
||||
})
|
||||
|
||||
vim.g.rustaceanvim = {
|
||||
-- Plugin configuration
|
||||
-- tools = {
|
||||
-- },
|
||||
-- LSP configuration
|
||||
server = {
|
||||
-- on_attach = function(client, bufnr)
|
||||
-- -- you can also put keymaps in here
|
||||
--end,
|
||||
default_settings = {
|
||||
-- rust-analyzer language server configuration
|
||||
["rust-analyzer"] = {
|
||||
cargoWatch = true,
|
||||
cargo = {
|
||||
allFeatures = true,
|
||||
allTargets = false,
|
||||
loadOutDirsFromCheck = true,
|
||||
buildScripts = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
checkOnSave = {
|
||||
allFeatures = true,
|
||||
allTargets = false,
|
||||
},
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
},
|
||||
procMacro = {
|
||||
enable = true,
|
||||
ignored = {
|
||||
["async-trait"] = { "async_trait" },
|
||||
["napi-derive"] = { "napi" },
|
||||
["async-recursion"] = { "async_recursion" },
|
||||
},
|
||||
},
|
||||
files = {
|
||||
excludeDirs = {
|
||||
".direnv",
|
||||
".git",
|
||||
".github",
|
||||
".gitlab",
|
||||
"bin",
|
||||
"node_modules",
|
||||
"target",
|
||||
"venv",
|
||||
".venv",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
-- DAP configuration
|
||||
dap = {},
|
||||
}
|
||||
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("lsp", { clear = true }),
|
||||
callback = function(args)
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
buffer = args.buf,
|
||||
callback = function()
|
||||
vim.lsp.buf.format({ async = false, id = args.data.client_id })
|
||||
end,
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue