updated golang and node lsp
This commit is contained in:
parent
80b5d665fe
commit
3708c5608e
|
|
@ -76,7 +76,7 @@ return {
|
|||
dap.listeners.before.event_exited['dapui_config'] = dapui.close
|
||||
|
||||
-- Install golang specific config
|
||||
-- require('dap-go').setup()
|
||||
require('dap-python').setup()
|
||||
require('dap-go').setup()
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,54 @@
|
|||
|
||||
-- lua/plugins/mason-lspconfig.lua
|
||||
return {
|
||||
-- "williamboman/mason-lspconfig.nvim",
|
||||
-- dependencies = {
|
||||
-- "williamboman/mason.nvim",
|
||||
-- "neovim/nvim-lspconfig",
|
||||
-- },
|
||||
-- config = function()
|
||||
-- local mason_lspconfig = require("mason-lspconfig")
|
||||
-- local lspconfig = require("lspconfig")
|
||||
--
|
||||
-- mason_lspconfig.setup({
|
||||
-- ensure_installed = {
|
||||
-- "gopls",
|
||||
-- "vtsls", -- use vtsls
|
||||
-- "astro",
|
||||
-- "templ",
|
||||
-- "lua_ls",
|
||||
-- "jsonls",
|
||||
-- "tailwindcss",
|
||||
-- },
|
||||
-- automatic_installation = true,
|
||||
-- })
|
||||
--
|
||||
-- mason_lspconfig.setup_handlers({
|
||||
-- -- Default handler for most servers
|
||||
-- function(server_name)
|
||||
-- -- 🚫 don’t start ts_ls at all
|
||||
-- if server_name == "ts_ls" then
|
||||
-- return
|
||||
-- end
|
||||
-- lspconfig[server_name].setup({})
|
||||
-- end,
|
||||
--
|
||||
-- -- Optional: vtsls-specific config
|
||||
-- ["vtsls"] = function()
|
||||
-- lspconfig.vtsls.setup({
|
||||
-- settings = {
|
||||
-- vtsls = {
|
||||
-- autoUseWorkspaceTsdk = true,
|
||||
-- },
|
||||
-- typescript = {
|
||||
-- tsserver = {
|
||||
-- maxTsServerMemory = 4096,
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- })
|
||||
-- end,
|
||||
-- })
|
||||
-- end,
|
||||
}
|
||||
|
||||
|
|
@ -13,7 +13,7 @@ return {
|
|||
lazy = false,
|
||||
dependencies = { "williamboman/mason.nvim" },
|
||||
opts = {
|
||||
ensure_installed = { "gopls", "ts_ls", "templ", "astro" },
|
||||
ensure_installed = { "gopls", "templ", "astro" },
|
||||
automatic_installation = true,
|
||||
automatic_setup = false, -- IMPORTANT: don't auto-setup servers
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,44 +1,52 @@
|
|||
|
||||
-- lua/plugins/none-ls.lua
|
||||
return {
|
||||
"nvimtools/none-ls.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" }, -- load early so it can attach
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
"jay-babu/mason-null-ls.nvim",
|
||||
"nvimtools/none-ls-extras.nvim", -- required for eslint_d now
|
||||
},
|
||||
config = function()
|
||||
local null_ls = require("null-ls")
|
||||
|
||||
-- eslint_d now comes from none-ls-extras, NOT null_ls.builtins
|
||||
local eslint_d = require("none-ls.diagnostics.eslint_d")
|
||||
|
||||
null_ls.setup({
|
||||
sources = {
|
||||
-- Go
|
||||
null_ls.builtins.formatting.gofumpt,
|
||||
null_ls.builtins.formatting.golines, -- optional
|
||||
null_ls.builtins.diagnostics.golangci_lint, -- if installed
|
||||
|
||||
-- Web
|
||||
null_ls.builtins.formatting.prettierd,
|
||||
eslint_d,
|
||||
},
|
||||
})
|
||||
|
||||
require("mason-null-ls").setup({
|
||||
ensure_installed = { "gofumpt", "golines", "golangci-lint", "prettierd", "eslint_d" },
|
||||
automatic_installation = true,
|
||||
-- leaving automatic_setup at default (false) so it doesn't double-register sources
|
||||
})
|
||||
|
||||
-- (optional) format on save for Go
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
pattern = "*.go",
|
||||
callback = function()
|
||||
vim.lsp.buf.format({ async = false })
|
||||
end,
|
||||
})
|
||||
end,
|
||||
enabled = false,
|
||||
}
|
||||
|
||||
|
||||
-- -- lua/plugins/none-ls.lua
|
||||
-- return {
|
||||
-- "nvimtools/none-ls.nvim",
|
||||
-- event = { "BufReadPre", "BufNewFile" }, -- load early so it can attach
|
||||
-- dependencies = {
|
||||
-- "williamboman/mason.nvim",
|
||||
-- "jay-babu/mason-null-ls.nvim",
|
||||
-- "nvimtools/none-ls-extras.nvim", -- required for eslint_d now
|
||||
-- },
|
||||
-- config = function()
|
||||
-- local null_ls = require("null-ls")
|
||||
--
|
||||
-- -- eslint_d now comes from none-ls-extras, NOT null_ls.builtins
|
||||
-- local eslint_d = require("none-ls.diagnostics.eslint_d")
|
||||
--
|
||||
-- null_ls.setup({
|
||||
-- sources = {
|
||||
-- -- Go
|
||||
-- null_ls.builtins.formatting.gofumpt,
|
||||
-- null_ls.builtins.formatting.golines, -- optional
|
||||
-- null_ls.builtins.diagnostics.golangci_lint, -- if installed
|
||||
--
|
||||
-- -- Web
|
||||
-- null_ls.builtins.formatting.prettierd,
|
||||
-- eslint_d,
|
||||
-- },
|
||||
-- })
|
||||
--
|
||||
-- require("mason-null-ls").setup({
|
||||
-- ensure_installed = { "gofumpt", "golines", "golangci-lint", "prettierd", "eslint_d" },
|
||||
-- automatic_installation = true,
|
||||
-- -- leaving automatic_setup at default (false) so it doesn't double-register sources
|
||||
-- })
|
||||
--
|
||||
-- -- (optional) format on save for Go
|
||||
-- vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
-- pattern = "*.go",
|
||||
-- callback = function()
|
||||
-- vim.lsp.buf.format({ async = false })
|
||||
-- end,
|
||||
-- })
|
||||
-- end,
|
||||
-- }
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue