Skip to content

Commit 3708c56

Browse files
committed
updated golang and node lsp
1 parent 80b5d66 commit 3708c56

File tree

4 files changed

+102
-40
lines changed

4 files changed

+102
-40
lines changed

lua/plugins/debug.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ return {
7676
dap.listeners.before.event_exited['dapui_config'] = dapui.close
7777

7878
-- Install golang specific config
79-
-- require('dap-go').setup()
8079
require('dap-python').setup()
80+
require('dap-go').setup()
8181
end,
8282
}

lua/plugins/mason-lspconfig.lua

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
2+
-- lua/plugins/mason-lspconfig.lua
3+
return {
4+
-- "williamboman/mason-lspconfig.nvim",
5+
-- dependencies = {
6+
-- "williamboman/mason.nvim",
7+
-- "neovim/nvim-lspconfig",
8+
-- },
9+
-- config = function()
10+
-- local mason_lspconfig = require("mason-lspconfig")
11+
-- local lspconfig = require("lspconfig")
12+
--
13+
-- mason_lspconfig.setup({
14+
-- ensure_installed = {
15+
-- "gopls",
16+
-- "vtsls", -- use vtsls
17+
-- "astro",
18+
-- "templ",
19+
-- "lua_ls",
20+
-- "jsonls",
21+
-- "tailwindcss",
22+
-- },
23+
-- automatic_installation = true,
24+
-- })
25+
--
26+
-- mason_lspconfig.setup_handlers({
27+
-- -- Default handler for most servers
28+
-- function(server_name)
29+
-- -- 🚫 don’t start ts_ls at all
30+
-- if server_name == "ts_ls" then
31+
-- return
32+
-- end
33+
-- lspconfig[server_name].setup({})
34+
-- end,
35+
--
36+
-- -- Optional: vtsls-specific config
37+
-- ["vtsls"] = function()
38+
-- lspconfig.vtsls.setup({
39+
-- settings = {
40+
-- vtsls = {
41+
-- autoUseWorkspaceTsdk = true,
42+
-- },
43+
-- typescript = {
44+
-- tsserver = {
45+
-- maxTsServerMemory = 4096,
46+
-- },
47+
-- },
48+
-- },
49+
-- })
50+
-- end,
51+
-- })
52+
-- end,
53+
}
54+

lua/plugins/mason.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ return {
1313
lazy = false,
1414
dependencies = { "williamboman/mason.nvim" },
1515
opts = {
16-
ensure_installed = { "gopls", "ts_ls", "templ", "astro" },
16+
ensure_installed = { "gopls", "templ", "astro" },
1717
automatic_installation = true,
1818
automatic_setup = false, -- IMPORTANT: don't auto-setup servers
1919
},

lua/plugins/none-ls.lua

Lines changed: 46 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,52 @@
1+
12
-- lua/plugins/none-ls.lua
23
return {
34
"nvimtools/none-ls.nvim",
4-
event = { "BufReadPre", "BufNewFile" }, -- load early so it can attach
5-
dependencies = {
6-
"williamboman/mason.nvim",
7-
"jay-babu/mason-null-ls.nvim",
8-
"nvimtools/none-ls-extras.nvim", -- required for eslint_d now
9-
},
10-
config = function()
11-
local null_ls = require("null-ls")
12-
13-
-- eslint_d now comes from none-ls-extras, NOT null_ls.builtins
14-
local eslint_d = require("none-ls.diagnostics.eslint_d")
15-
16-
null_ls.setup({
17-
sources = {
18-
-- Go
19-
null_ls.builtins.formatting.gofumpt,
20-
null_ls.builtins.formatting.golines, -- optional
21-
null_ls.builtins.diagnostics.golangci_lint, -- if installed
22-
23-
-- Web
24-
null_ls.builtins.formatting.prettierd,
25-
eslint_d,
26-
},
27-
})
5+
enabled = false,
6+
}
287

29-
require("mason-null-ls").setup({
30-
ensure_installed = { "gofumpt", "golines", "golangci-lint", "prettierd", "eslint_d" },
31-
automatic_installation = true,
32-
-- leaving automatic_setup at default (false) so it doesn't double-register sources
33-
})
348

35-
-- (optional) format on save for Go
36-
vim.api.nvim_create_autocmd("BufWritePre", {
37-
pattern = "*.go",
38-
callback = function()
39-
vim.lsp.buf.format({ async = false })
40-
end,
41-
})
42-
end,
43-
}
9+
-- -- lua/plugins/none-ls.lua
10+
-- return {
11+
-- "nvimtools/none-ls.nvim",
12+
-- event = { "BufReadPre", "BufNewFile" }, -- load early so it can attach
13+
-- dependencies = {
14+
-- "williamboman/mason.nvim",
15+
-- "jay-babu/mason-null-ls.nvim",
16+
-- "nvimtools/none-ls-extras.nvim", -- required for eslint_d now
17+
-- },
18+
-- config = function()
19+
-- local null_ls = require("null-ls")
20+
--
21+
-- -- eslint_d now comes from none-ls-extras, NOT null_ls.builtins
22+
-- local eslint_d = require("none-ls.diagnostics.eslint_d")
23+
--
24+
-- null_ls.setup({
25+
-- sources = {
26+
-- -- Go
27+
-- null_ls.builtins.formatting.gofumpt,
28+
-- null_ls.builtins.formatting.golines, -- optional
29+
-- null_ls.builtins.diagnostics.golangci_lint, -- if installed
30+
--
31+
-- -- Web
32+
-- null_ls.builtins.formatting.prettierd,
33+
-- eslint_d,
34+
-- },
35+
-- })
36+
--
37+
-- require("mason-null-ls").setup({
38+
-- ensure_installed = { "gofumpt", "golines", "golangci-lint", "prettierd", "eslint_d" },
39+
-- automatic_installation = true,
40+
-- -- leaving automatic_setup at default (false) so it doesn't double-register sources
41+
-- })
42+
--
43+
-- -- (optional) format on save for Go
44+
-- vim.api.nvim_create_autocmd("BufWritePre", {
45+
-- pattern = "*.go",
46+
-- callback = function()
47+
-- vim.lsp.buf.format({ async = false })
48+
-- end,
49+
-- })
50+
-- end,
51+
-- }
4452

0 commit comments

Comments
 (0)