From 3708c5608e34e2add18e1574823d9aa58d6f77c6 Mon Sep 17 00:00:00 2001 From: Walter Jenkins Date: Sat, 22 Nov 2025 13:19:58 -0600 Subject: [PATCH] updated golang and node lsp --- lua/plugins/debug.lua | 2 +- lua/plugins/mason-lspconfig.lua | 54 +++++++++++++++++++++ lua/plugins/mason.lua | 2 +- lua/plugins/none-ls.lua | 86 ++++++++++++++++++--------------- 4 files changed, 103 insertions(+), 41 deletions(-) create mode 100644 lua/plugins/mason-lspconfig.lua diff --git a/lua/plugins/debug.lua b/lua/plugins/debug.lua index 3e36acd1..3f605428 100644 --- a/lua/plugins/debug.lua +++ b/lua/plugins/debug.lua @@ -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, } diff --git a/lua/plugins/mason-lspconfig.lua b/lua/plugins/mason-lspconfig.lua new file mode 100644 index 00000000..755b2701 --- /dev/null +++ b/lua/plugins/mason-lspconfig.lua @@ -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, +} + diff --git a/lua/plugins/mason.lua b/lua/plugins/mason.lua index 0cb8b35d..699bbcbe 100644 --- a/lua/plugins/mason.lua +++ b/lua/plugins/mason.lua @@ -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 }, diff --git a/lua/plugins/none-ls.lua b/lua/plugins/none-ls.lua index 48c58785..cc6fffe8 100644 --- a/lua/plugins/none-ls.lua +++ b/lua/plugins/none-ls.lua @@ -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, +-- } +