feat: added go test/debug plugins + dadbob db ui
This commit is contained in:
@@ -20,6 +20,7 @@
|
|||||||
"neo-tree.nvim": { "branch": "v3.x", "commit": "9130e58424ad95bf2dd8b40afbb8cf04d648638c" },
|
"neo-tree.nvim": { "branch": "v3.x", "commit": "9130e58424ad95bf2dd8b40afbb8cf04d648638c" },
|
||||||
"neotest": { "branch": "master", "commit": "2cf3544fb55cdd428a9a1b7154aea9c9823426e8" },
|
"neotest": { "branch": "master", "commit": "2cf3544fb55cdd428a9a1b7154aea9c9823426e8" },
|
||||||
"neotest-dotnet": { "branch": "main", "commit": "e27c67a856ce67cc968b773d01a35ec07459bb8b" },
|
"neotest-dotnet": { "branch": "main", "commit": "e27c67a856ce67cc968b773d01a35ec07459bb8b" },
|
||||||
|
"neotest-go": { "branch": "fork", "commit": "59b50505053f9c45a9febb79e11a56206c3e3901" },
|
||||||
"neotest-jest": { "branch": "main", "commit": "2f657403aabab7d68eaa2cb9181dc4bb7fdd8a08" },
|
"neotest-jest": { "branch": "main", "commit": "2f657403aabab7d68eaa2cb9181dc4bb7fdd8a08" },
|
||||||
"neotest-playwright": { "branch": "fork", "commit": "e6202f2b00dd5c3b7b626b147b86deb36c2d64bd" },
|
"neotest-playwright": { "branch": "fork", "commit": "e6202f2b00dd5c3b7b626b147b86deb36c2d64bd" },
|
||||||
"neotest-python": { "branch": "master", "commit": "7cab6e2ecc260bf61b97ca147574a470bd880cbd" },
|
"neotest-python": { "branch": "master", "commit": "7cab6e2ecc260bf61b97ca147574a470bd880cbd" },
|
||||||
@@ -46,6 +47,9 @@
|
|||||||
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
||||||
"typr": { "branch": "main", "commit": "bdd9ef7143702851edd1dac85101e0a537056d2f" },
|
"typr": { "branch": "main", "commit": "bdd9ef7143702851edd1dac85101e0a537056d2f" },
|
||||||
"venv-selector.nvim": { "branch": "main", "commit": "ab5002d83817e481f7eef07b488c7e402d231bcf" },
|
"venv-selector.nvim": { "branch": "main", "commit": "ab5002d83817e481f7eef07b488c7e402d231bcf" },
|
||||||
|
"vim-dadbod": { "branch": "master", "commit": "e95afed23712f969f83b4857a24cf9d59114c2e6" },
|
||||||
|
"vim-dadbod-completion": { "branch": "master", "commit": "a8dac0b3cf6132c80dc9b18bef36d4cf7a9e1fe6" },
|
||||||
|
"vim-dadbod-ui": { "branch": "master", "commit": "48c4f271da13d380592f4907e2d1d5558044e4e5" },
|
||||||
"volt": { "branch": "main", "commit": "620de1321f275ec9d80028c68d1b88b409c0c8b1" },
|
"volt": { "branch": "main", "commit": "620de1321f275ec9d80028c68d1b88b409c0c8b1" },
|
||||||
"which-key.nvim": { "branch": "main", "commit": "904308e6885bbb7b60714c80ab3daf0c071c1492" }
|
"which-key.nvim": { "branch": "main", "commit": "904308e6885bbb7b60714c80ab3daf0c071c1492" }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
-- include in completions --
|
||||||
|
return {
|
||||||
|
"kristijanhusak/vim-dadbod-ui",
|
||||||
|
dependencies = {
|
||||||
|
{ "tpope/vim-dadbod", lazy = true },
|
||||||
|
{ "kristijanhusak/vim-dadbod-completion", ft = { "sql", "mysql", "plsql" }, lazy = true },
|
||||||
|
},
|
||||||
|
cmd = {
|
||||||
|
"DBUI",
|
||||||
|
"DBUIToggle",
|
||||||
|
"DBUIAddConnection",
|
||||||
|
"DBUIFindBuffer",
|
||||||
|
},
|
||||||
|
init = function()
|
||||||
|
vim.g.db_ui_use_nerd_fonts = 1
|
||||||
|
vim.g.db_ui_auto_execute_table_helpers = 1
|
||||||
|
end,
|
||||||
|
}
|
||||||
+270
-270
@@ -1,323 +1,323 @@
|
|||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"williamboman/mason.nvim",
|
"williamboman/mason.nvim",
|
||||||
lazy = false,
|
lazy = false,
|
||||||
config = function()
|
config = function()
|
||||||
require("mason").setup()
|
require("mason").setup()
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"williamboman/mason-lspconfig.nvim",
|
"williamboman/mason-lspconfig.nvim",
|
||||||
lazy = false,
|
lazy = false,
|
||||||
opts = {
|
opts = {
|
||||||
automatic_enable = false,
|
automatic_enable = false,
|
||||||
auto_install = true,
|
auto_install = true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"linux-cultist/venv-selector.nvim",
|
"linux-cultist/venv-selector.nvim",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
"mfussenegger/nvim-dap",
|
"mfussenegger/nvim-dap",
|
||||||
"mfussenegger/nvim-dap-python",
|
"mfussenegger/nvim-dap-python",
|
||||||
{ "nvim-telescope/telescope.nvim", branch = "0.1.x", dependencies = { "nvim-lua/plenary.nvim" } },
|
{ "nvim-telescope/telescope.nvim", branch = "0.1.x", dependencies = { "nvim-lua/plenary.nvim" } },
|
||||||
},
|
},
|
||||||
ft = "python",
|
ft = "python",
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>v", "<cmd>VenvSelect<cr>" },
|
{ "<leader>v", "<cmd>VenvSelect<cr>" },
|
||||||
},
|
},
|
||||||
opts = {
|
opts = {
|
||||||
search = {},
|
search = {},
|
||||||
options = {},
|
options = {},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
dependencies = { "hoffs/omnisharp-extended-lsp.nvim" },
|
dependencies = { "hoffs/omnisharp-extended-lsp.nvim" },
|
||||||
lazy = false,
|
lazy = false,
|
||||||
config = function()
|
config = function()
|
||||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
|
|
||||||
vim.lsp.handlers["window/showMessage"] = function(_, result, ctx)
|
vim.lsp.handlers["window/showMessage"] = function(_, result, ctx)
|
||||||
local client = vim.lsp.get_client_by_id(ctx.client_id)
|
local client = vim.lsp.get_client_by_id(ctx.client_id)
|
||||||
|
|
||||||
local lvl = ({
|
local lvl = ({
|
||||||
ERROR = vim.log.levels.ERROR,
|
ERROR = vim.log.levels.ERROR,
|
||||||
WARNING = vim.log.levels.WARN,
|
WARNING = vim.log.levels.WARN,
|
||||||
INFO = vim.log.levels.INFO,
|
INFO = vim.log.levels.INFO,
|
||||||
LOG = vim.log.levels.DEBUG,
|
LOG = vim.log.levels.DEBUG,
|
||||||
})[result.type]
|
})[result.type]
|
||||||
|
|
||||||
vim.notify(result.message, lvl, {
|
vim.notify(result.message, lvl, {
|
||||||
title = string.format("LSP[%s]", client and client.name or "Unknown"),
|
title = string.format("LSP[%s]", client and client.name or "Unknown"),
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.lsp.handlers["$/progress"] = function(_, result, ctx)
|
vim.lsp.handlers["$/progress"] = function(_, result, ctx)
|
||||||
local client = vim.lsp.get_client_by_id(ctx.client_id)
|
local client = vim.lsp.get_client_by_id(ctx.client_id)
|
||||||
|
|
||||||
if result.value.kind == "begin" then
|
if result.value.kind == "begin" then
|
||||||
vim.notify(
|
vim.notify(
|
||||||
string.format("LSP[%s] %s", client and client.name or "Unknown", result.value.title),
|
string.format("LSP[%s] %s", client and client.name or "Unknown", result.value.title),
|
||||||
vim.log.levels.INFO
|
vim.log.levels.INFO
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.lsp.config("eslint", {
|
vim.lsp.config("eslint", {
|
||||||
on_attach = function(_, bufnr)
|
on_attach = function(_, bufnr)
|
||||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
buffer = bufnr,
|
buffer = bufnr,
|
||||||
command = "EslintFixAll",
|
command = "EslintFixAll",
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
on_new_config = function(config, new_root_dir)
|
on_new_config = function(config, new_root_dir)
|
||||||
config.settings.workspaceFolder = {
|
config.settings.workspaceFolder = {
|
||||||
uri = vim.uri_from_fname(new_root_dir),
|
uri = vim.uri_from_fname(new_root_dir),
|
||||||
name = vim.fn.fnamemodify(new_root_dir, ":t"),
|
name = vim.fn.fnamemodify(new_root_dir, ":t"),
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.lsp.enable("eslint")
|
vim.lsp.enable("eslint")
|
||||||
|
|
||||||
vim.lsp.config("omnisharp", {
|
vim.lsp.config("omnisharp", {
|
||||||
handlers = {
|
handlers = {
|
||||||
["textDocument/definition"] = require("omnisharp_extended").handler,
|
["textDocument/definition"] = require("omnisharp_extended").handler,
|
||||||
},
|
},
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.lsp.enable("omnisharp")
|
vim.lsp.enable("omnisharp")
|
||||||
|
|
||||||
vim.lsp.config("lua_ls", {
|
vim.lsp.config("lua_ls", {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.lsp.enable("lua_ls")
|
vim.lsp.enable("lua_ls")
|
||||||
|
|
||||||
local vue_language_server = vim.fn.stdpath("data")
|
local vue_language_server = vim.fn.stdpath("data")
|
||||||
.. "/mason/packages/vue-language-server/node_modules/@vue/language-server"
|
.. "/mason/packages/vue-language-server/node_modules/@vue/language-server"
|
||||||
|
|
||||||
vim.lsp.config("ts_ls", {
|
vim.lsp.config("ts_ls", {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
init_options = {
|
init_options = {
|
||||||
plugins = {
|
plugins = {
|
||||||
{
|
{
|
||||||
name = "@vue/typescript-plugin",
|
name = "@vue/typescript-plugin",
|
||||||
location = vue_language_server,
|
location = vue_language_server,
|
||||||
languages = { "vue" },
|
languages = { "vue" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
filetypes = { "typescript", "javascript", "javascriptreact", "typescriptreact", "vue" },
|
filetypes = { "typescript", "javascript", "javascriptreact", "typescriptreact", "vue" },
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.lsp.enable("ts_ls")
|
vim.lsp.enable("ts_ls")
|
||||||
|
|
||||||
vim.lsp.config("html", {
|
vim.lsp.config("html", {
|
||||||
filetypes = { "html", "ejs", "vue", "gohtml" },
|
filetypes = { "html", "ejs", "vue", "gohtml" },
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.lsp.enable("html")
|
vim.lsp.enable("html")
|
||||||
|
|
||||||
vim.lsp.config("emmet_language_server", {
|
vim.lsp.config("emmet_language_server", {
|
||||||
filetypes = { "html", "css", "javascriptreact", "typescriptreact", "vue", "gohtml" },
|
filetypes = { "html", "css", "javascriptreact", "typescriptreact", "vue", "gohtml" },
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.lsp.enable("emmet_language_server")
|
vim.lsp.enable("emmet_language_server")
|
||||||
|
|
||||||
vim.lsp.config("cssls", {
|
vim.lsp.config("cssls", {
|
||||||
filetypes = { "css", "vue", "scss", "less" },
|
filetypes = { "css", "vue", "scss", "less" },
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.lsp.enable("cssls")
|
vim.lsp.enable("cssls")
|
||||||
|
|
||||||
vim.lsp.config("tailwindcss", {
|
vim.lsp.config("tailwindcss", {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.lsp.enable("tailwindcss")
|
vim.lsp.enable("tailwindcss")
|
||||||
|
|
||||||
vim.lsp.config("pyright", {
|
vim.lsp.config("pyright", {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.lsp.enable("pyright")
|
vim.lsp.enable("pyright")
|
||||||
|
|
||||||
vim.lsp.config("lemminx", {
|
vim.lsp.config("lemminx", {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.lsp.enable("lemminx")
|
vim.lsp.enable("lemminx")
|
||||||
|
|
||||||
vim.lsp.config("gopls", {
|
vim.lsp.config("gopls", {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
filetypes = { "go", "gomod", "gowork", "gotmpl", "gohtml" },
|
filetypes = { "go", "gomod", "gowork", "gotmpl", "gohtml" },
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.lsp.enable("gopls")
|
vim.lsp.enable("gopls")
|
||||||
|
|
||||||
vim.lsp.config("rust_analyzer", {
|
vim.lsp.config("rust_analyzer", {
|
||||||
settings = {
|
settings = {
|
||||||
["rust-analyzer"] = {
|
["rust-analyzer"] = {
|
||||||
diagnostics = {
|
diagnostics = {
|
||||||
enable = false,
|
enable = false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.lsp.enable("rust_analyzer")
|
vim.lsp.enable("rust_analyzer")
|
||||||
|
|
||||||
vim.lsp.enable("gh_actions_ls")
|
vim.lsp.enable("gh_actions_ls")
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("LspAttach", {
|
vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
|
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
|
||||||
callback = function(ev)
|
callback = function(ev)
|
||||||
local client = vim.lsp.get_client_by_id(ev.data.client_id)
|
local client = vim.lsp.get_client_by_id(ev.data.client_id)
|
||||||
|
|
||||||
if not client then
|
if not client then
|
||||||
vim.notify("LSP client not found", vim.log.levels.ERROR)
|
vim.notify("LSP client not found", vim.log.levels.ERROR)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if not client.server_capabilities then
|
if not client.server_capabilities then
|
||||||
vim.notify("LSP server not ready yet", vim.log.levels.WARN)
|
vim.notify("LSP server not ready yet", vim.log.levels.WARN)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
client.on_error = function(err)
|
client.on_error = function(err)
|
||||||
vim.notify(string.format("LSP server error: %s", err.message), vim.log.levels.ERROR)
|
vim.notify(string.format("LSP server error: %s", err.message), vim.log.levels.ERROR)
|
||||||
end
|
end
|
||||||
|
|
||||||
client.on_status = function(status)
|
client.on_status = function(status)
|
||||||
if status == "stopped" then
|
if status == "stopped" then
|
||||||
vim.notify("LSP server stopped", vim.log.levels.WARN)
|
vim.notify("LSP server stopped", vim.log.levels.WARN)
|
||||||
elseif status == "running" then
|
elseif status == "running" then
|
||||||
vim.notify("LSP server running", vim.log.levels.INFO)
|
vim.notify("LSP server running", vim.log.levels.INFO)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local omnisharp = require("omnisharp_extended")
|
local omnisharp = require("omnisharp_extended")
|
||||||
|
|
||||||
if client.name == "omnisharp" then
|
if client.name == "omnisharp" then
|
||||||
vim.keymap.set(
|
vim.keymap.set(
|
||||||
"n",
|
"n",
|
||||||
"gd",
|
"gd",
|
||||||
omnisharp.telescope_lsp_definition,
|
omnisharp.telescope_lsp_definition,
|
||||||
{ desc = "Go to definition", buffer = ev.buf }
|
{ desc = "Go to definition", buffer = ev.buf }
|
||||||
)
|
)
|
||||||
|
|
||||||
vim.keymap.set(
|
vim.keymap.set(
|
||||||
"n",
|
"n",
|
||||||
"gi",
|
"gi",
|
||||||
omnisharp.telescope_lsp_implementation,
|
omnisharp.telescope_lsp_implementation,
|
||||||
{ desc = "Go to implementation", buffer = ev.buf }
|
{ desc = "Go to implementation", buffer = ev.buf }
|
||||||
)
|
)
|
||||||
|
|
||||||
vim.keymap.set(
|
vim.keymap.set(
|
||||||
"n",
|
"n",
|
||||||
"gr",
|
"gr",
|
||||||
omnisharp.telescope_lsp_references,
|
omnisharp.telescope_lsp_references,
|
||||||
{ desc = "Go to references", buffer = ev.buf }
|
{ desc = "Go to references", buffer = ev.buf }
|
||||||
)
|
)
|
||||||
|
|
||||||
vim.keymap.set(
|
vim.keymap.set(
|
||||||
"n",
|
"n",
|
||||||
"<leader>D",
|
"<leader>D",
|
||||||
omnisharp.telescope_lsp_type_definition,
|
omnisharp.telescope_lsp_type_definition,
|
||||||
{ desc = "Go to type definition", buffer = ev.buf }
|
{ desc = "Go to type definition", buffer = ev.buf }
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
vim.keymap.set(
|
vim.keymap.set(
|
||||||
"n",
|
"n",
|
||||||
"gd",
|
"gd",
|
||||||
vim.lsp.buf.definition,
|
vim.lsp.buf.definition,
|
||||||
{ desc = "Go to definition", buffer = ev.buf }
|
{ desc = "Go to definition", buffer = ev.buf }
|
||||||
)
|
)
|
||||||
|
|
||||||
vim.keymap.set(
|
vim.keymap.set(
|
||||||
"n",
|
"n",
|
||||||
"gD",
|
"gD",
|
||||||
vim.lsp.buf.declaration,
|
vim.lsp.buf.declaration,
|
||||||
{ desc = "Go to declaration", buffer = ev.buf }
|
{ desc = "Go to declaration", buffer = ev.buf }
|
||||||
)
|
)
|
||||||
|
|
||||||
vim.keymap.set(
|
vim.keymap.set(
|
||||||
"n",
|
"n",
|
||||||
"gi",
|
"gi",
|
||||||
vim.lsp.buf.implementation,
|
vim.lsp.buf.implementation,
|
||||||
{ desc = "Go to implementation", buffer = ev.buf }
|
{ desc = "Go to implementation", buffer = ev.buf }
|
||||||
)
|
)
|
||||||
|
|
||||||
vim.keymap.set(
|
vim.keymap.set(
|
||||||
"n",
|
"n",
|
||||||
"gr",
|
"gr",
|
||||||
vim.lsp.buf.references,
|
vim.lsp.buf.references,
|
||||||
{ desc = "Go to references", buffer = ev.buf }
|
{ desc = "Go to references", buffer = ev.buf }
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ "FileType" }, {
|
vim.api.nvim_create_autocmd({ "FileType" }, {
|
||||||
callback = function()
|
callback = function()
|
||||||
if require("nvim-treesitter.parsers").has_parser() then
|
if require("nvim-treesitter.parsers").has_parser() then
|
||||||
vim.opt.foldmethod = "expr"
|
vim.opt.foldmethod = "expr"
|
||||||
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
|
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
|
||||||
else
|
else
|
||||||
vim.opt.foldmethod = "syntax"
|
vim.opt.foldmethod = "syntax"
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
pattern = "*.go",
|
pattern = "*.go",
|
||||||
callback = function()
|
callback = function()
|
||||||
local params = vim.lsp.util.make_range_params()
|
local params = vim.lsp.util.make_range_params()
|
||||||
params.context = { only = { "source.organizeImports" } }
|
params.context = { only = { "source.organizeImports" } }
|
||||||
local result = vim.lsp.buf_request_sync(0, "textDocument/codeAction", params)
|
local result = vim.lsp.buf_request_sync(0, "textDocument/codeAction", params)
|
||||||
for cid, res in pairs(result or {}) do
|
for cid, res in pairs(result or {}) do
|
||||||
for _, r in pairs(res.result or {}) do
|
for _, r in pairs(res.result or {}) do
|
||||||
if r.edit then
|
if r.edit then
|
||||||
local enc = (vim.lsp.get_client_by_id(cid) or {}).offset_encoding or "utf-16"
|
local enc = (vim.lsp.get_client_by_id(cid) or {}).offset_encoding or "utf-16"
|
||||||
vim.lsp.util.apply_workspace_edit(r.edit, enc)
|
vim.lsp.util.apply_workspace_edit(r.edit, enc)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
vim.lsp.buf.format({ async = false })
|
vim.lsp.buf.format({ async = false })
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.keymap.set(
|
vim.keymap.set(
|
||||||
"n",
|
"n",
|
||||||
"<leader>ca",
|
"<leader>ca",
|
||||||
vim.lsp.buf.code_action,
|
vim.lsp.buf.code_action,
|
||||||
{ desc = "Code actions", buffer = ev.buf }
|
{ desc = "Code actions", buffer = ev.buf }
|
||||||
)
|
)
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, { desc = "Rename", buffer = ev.buf })
|
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, { desc = "Rename", buffer = ev.buf })
|
||||||
|
|
||||||
vim.keymap.set(
|
vim.keymap.set(
|
||||||
"n",
|
"n",
|
||||||
"<leader>e",
|
"<leader>e",
|
||||||
vim.diagnostic.open_float,
|
vim.diagnostic.open_float,
|
||||||
{ desc = "Display error for current line", buffer = ev.buf }
|
{ desc = "Display error for current line", buffer = ev.buf }
|
||||||
)
|
)
|
||||||
|
|
||||||
vim.keymap.set(
|
vim.keymap.set(
|
||||||
"n",
|
"n",
|
||||||
"<leader>ea",
|
"<leader>ea",
|
||||||
":Telescope diagnostics bufnr=0<CR>",
|
":Telescope diagnostics bufnr=0<CR>",
|
||||||
{ desc = "Display errors for current buffer", buffer = ev.buf }
|
{ desc = "Display errors for current buffer", buffer = ev.buf }
|
||||||
)
|
)
|
||||||
|
|
||||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, { desc = "Display symbol info", buffer = ev.buf })
|
vim.keymap.set("n", "K", vim.lsp.buf.hover, { desc = "Display symbol info", buffer = ev.buf })
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
+73
-59
@@ -1,67 +1,81 @@
|
|||||||
return {
|
return {
|
||||||
"nvim-neotest/neotest",
|
"nvim-neotest/neotest",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"antoinemadec/FixCursorHold.nvim",
|
"antoinemadec/FixCursorHold.nvim",
|
||||||
"nvim-neotest/neotest-python",
|
"nvim-neotest/neotest-python",
|
||||||
"nvim-neotest/neotest-jest",
|
"nvim-neotest/neotest-jest",
|
||||||
"marilari88/neotest-vitest",
|
"marilari88/neotest-vitest",
|
||||||
{ "stevanfreeborn/neotest-playwright", branch = "fork" },
|
{ "stevanfreeborn/neotest-playwright", branch = "fork" },
|
||||||
"issafalcon/neotest-dotnet",
|
"issafalcon/neotest-dotnet",
|
||||||
},
|
{ "stevanfreeborn/neotest-go" },
|
||||||
config = function()
|
},
|
||||||
local neotest = require("neotest")
|
config = function()
|
||||||
|
local neotest = require("neotest")
|
||||||
|
|
||||||
neotest.setup({
|
-- local neotest_ns = vim.api.nvim_create_namespace("neotest")
|
||||||
summary = {
|
--
|
||||||
follow = false,
|
-- vim.diagnostic.config({
|
||||||
},
|
-- virtual_text = {
|
||||||
adapters = {
|
-- format = function(diagnostic)
|
||||||
require("neotest-python"),
|
-- local message = diagnostic.message:gsub("\n", " "):gsub("\t", " "):gsub("%s+", " "):gsub("^%s+", "")
|
||||||
require("neotest-jest"),
|
-- return message
|
||||||
require("neotest-vitest"),
|
-- end,
|
||||||
require("neotest-playwright").adapter({
|
-- },
|
||||||
options = {
|
-- }, neotest_ns)
|
||||||
persist_project_selection = true,
|
|
||||||
enable_dynamic_test_discovery = true,
|
|
||||||
preset = "headed",
|
|
||||||
experimental = {
|
|
||||||
telescope = {
|
|
||||||
enabled = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
get_playwright_binary = function()
|
|
||||||
return vim.loop.cwd() .. "/node_modules/.bin/playwright"
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
require("neotest-dotnet")({
|
|
||||||
dap = {
|
|
||||||
adapter_name = "coreclr",
|
|
||||||
},
|
|
||||||
discovery_root = "solution",
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>tr", neotest.run.run, { desc = "Run nearest test" })
|
neotest.setup({
|
||||||
|
log_level = vim.log.levels.DEBUG,
|
||||||
|
summary = {
|
||||||
|
follow = false,
|
||||||
|
},
|
||||||
|
adapters = {
|
||||||
|
require("neotest-python"),
|
||||||
|
require("neotest-jest"),
|
||||||
|
require("neotest-vitest"),
|
||||||
|
require("neotest-playwright").adapter({
|
||||||
|
options = {
|
||||||
|
persist_project_selection = true,
|
||||||
|
enable_dynamic_test_discovery = true,
|
||||||
|
preset = "headed",
|
||||||
|
experimental = {
|
||||||
|
telescope = {
|
||||||
|
enabled = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
get_playwright_binary = function()
|
||||||
|
return vim.loop.cwd() .. "/node_modules/.bin/playwright"
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
require("neotest-dotnet")({
|
||||||
|
dap = {
|
||||||
|
adapter_name = "coreclr",
|
||||||
|
},
|
||||||
|
discovery_root = "solution",
|
||||||
|
}),
|
||||||
|
require("neotest-go"),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>td", function()
|
vim.keymap.set("n", "<leader>tr", neotest.run.run, { desc = "Run nearest test" })
|
||||||
neotest.run.run({ strategy = "dap" })
|
|
||||||
end, { desc = "Debug nearest test" })
|
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>ts", neotest.run.stop, { desc = "Stop nearest test" })
|
vim.keymap.set("n", "<leader>td", function()
|
||||||
|
neotest.run.run({ strategy = "dap" })
|
||||||
|
end, { desc = "Debug nearest test" })
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>tf", function()
|
vim.keymap.set("n", "<leader>ts", neotest.run.stop, { desc = "Stop nearest test" })
|
||||||
neotest.run.run(vim.fn.expand("%"))
|
|
||||||
end, { desc = "Run file tests" })
|
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>to", neotest.output.open, { desc = "Display output" })
|
vim.keymap.set("n", "<leader>tf", function()
|
||||||
vim.keymap.set("n", "<leader>top", neotest.output_panel.open, { desc = "Display output panel" })
|
neotest.run.run(vim.fn.expand("%"))
|
||||||
vim.keymap.set("n", "<leader>topc", neotest.output_panel.clear, { desc = "Clear output" })
|
end, { desc = "Run file tests" })
|
||||||
vim.keymap.set("n", "<C-t>", neotest.summary.open, { desc = "Display summary" })
|
|
||||||
vim.keymap.set("n", "<leader>tsr", neotest.summary.run_marked, { desc = "Run marked tests" })
|
vim.keymap.set("n", "<leader>to", neotest.output.open, { desc = "Display output" })
|
||||||
vim.keymap.set("n", "<leader>tsc", neotest.summary.clear_marked, { desc = "Clear marked tests" })
|
vim.keymap.set("n", "<leader>top", neotest.output_panel.open, { desc = "Display output panel" })
|
||||||
vim.keymap.set("n", "<leader>tw", neotest.watch.watch, { desc = "Start watching tests" })
|
vim.keymap.set("n", "<leader>topc", neotest.output_panel.clear, { desc = "Clear output" })
|
||||||
vim.keymap.set("n", "<leader>twc", neotest.watch.stop, { desc = "Stop watching tests" })
|
vim.keymap.set("n", "<C-t>", neotest.summary.open, { desc = "Display summary" })
|
||||||
end,
|
vim.keymap.set("n", "<leader>tsr", neotest.summary.run_marked, { desc = "Run marked tests" })
|
||||||
|
vim.keymap.set("n", "<leader>tsc", neotest.summary.clear_marked, { desc = "Clear marked tests" })
|
||||||
|
vim.keymap.set("n", "<leader>tw", neotest.watch.watch, { desc = "Start watching tests" })
|
||||||
|
vim.keymap.set("n", "<leader>twc", neotest.watch.stop, { desc = "Stop watching tests" })
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user