1
0

feat: golang import fixing

This commit is contained in:
2025-10-14 13:17:49 +01:00
parent b22f5b7b44
commit 03ea1210eb
3 changed files with 36 additions and 15 deletions

View File

@@ -35,6 +35,7 @@ M.mason = {
"debugpy",
"rust-analyzer",
"codelldb",
"prettier",
"tailwindcss-language-server",
"golangci-lint-langserver",
"typescript-language-server",

View File

@@ -1,20 +1,20 @@
local options = {
formatters_by_ft = {
lua = { "stylua" },
css = { "prettier" },
html = { "prettier" },
go = { "gopls" },
ts = { "prettier" },
tsx = { "prettier" },
js = { "prettier" },
jsx = { "prettier" }
},
formatters_by_ft = {
lua = { "stylua" },
css = { "prettier" },
html = { "prettier" },
go = { "gopls", "goimports" },
ts = { "prettier" },
tsx = { "prettier" },
js = { "prettier" },
jsx = { "prettier" },
},
format_on_save = {
-- These options will be passed to conform.format()
timeout_ms = 500,
lsp_fallback = true,
},
format_on_save = {
-- These options will be passed to conform.format()
timeout_ms = 500,
lsp_fallback = true,
},
}
return options

View File

@@ -39,3 +39,23 @@ end, { desc = "Show lines git blame" })
map("n", "gi", function()
require("telescope.builtin").lsp_implementations()
end, { desc = "Go to LSP implementations via Telescope" })
map("n", "<leader>gvi", function()
vim.cmd("vsplit")
require("telescope.builtin").lsp_implementations()
end, { desc = "Go to LSP implementations in a vsplit" })
map("n", "<leader>ghi", function()
vim.cmd("split")
require("telescope.builtin").lsp_implementations()
end, { desc = "Go to LSP implementations in a split" })
map("n", "<leader>gvd", function()
vim.cmd("vsplit")
require("telescope.builtin").lsp_definitions()
end, { desc = "Go to LSP definitions in a new vsplit" })
map("n", "<leader>ghd", function()
vim.cmd("split")
require("telescope.builtin").lsp_definitions()
end, { desc = "Go to LSP definition in a new split" })