chore: Updated lsp and formatting for nvim f8076614
Steve · 2025-06-14 11:39 5 file(s) · +49 −22
nvim/lsp/gopls.lua +3 −3
1 1
return {
2 -
	cmd = { "gopls" },                                   -- Command to start the language server
2 +
	cmd = { "gopls" },                                         -- Command to start the language server
3 3
	filetypes = { "go", "gomod", "gowork", "gotmpl", "gosum" }, -- File types that this server will handle
4 -
	root_markers = { "go.mod", "go.work", ".git" },      -- Markers to identify the root of the project
5 -
	settings = {                                         -- Settings for the language server
4 +
	root_markers = { "go.mod", "go.work", ".git" },            -- Markers to identify the root of the project
5 +
	settings = {                                               -- Settings for the language server
6 6
		gopls = {
7 7
			gofumpt = true,
8 8
			codelenses = {
nvim/lsp/rust-analyzer.lua (added) +39 −0
1 +
return {
2 +
	cmd = {
3 +
		"rust-analyzer",
4 +
	},
5 +
	filetypes = {
6 +
		"rust",
7 +
	},
8 +
	root_markers = {
9 +
		"Cargo.toml",
10 +
		"Cargo.lock",
11 +
		".git",
12 +
	},
13 +
	settings = {
14 +
		["rust-analyzer"] = {
15 +
			cargo = {
16 +
				allFeatures = true,
17 +
				loadOutDirsFromCheck = true,
18 +
				runBuildScripts = true,
19 +
			},
20 +
			-- Add other rust-analyzer specific settings here
21 +
			checkOnSave = {
22 +
				allFeatures = true,
23 +
				command = "clippy",
24 +
				extraArgs = { "--no-deps" },
25 +
			},
26 +
			procMacro = {
27 +
				enable = true,
28 +
				ignored = {
29 +
					leptos_macro = {
30 +
						-- "component",
31 +
						"server",
32 +
					},
33 +
				},
34 +
			},
35 +
		},
36 +
	},
37 +
	single_file_support = true,
38 +
	log_level = vim.lsp.protocol.MessageType.Warning,
39 +
}
nvim/lua/core/lsp.lua +2 −1
1 1
vim.lsp.enable({
2 2
    "gopls",
3 3
    "lua_ls",
4 -
    "tsserver"
4 +
    "tsserver",
5 +
    "rust-analyzer"
5 6
})
6 7
7 8
vim.diagnostic.config({
nvim/lua/plugins/conform.lua +5 −4
5 5
		require("conform").setup({
6 6
			formatters_by_ft = {
7 7
				lua = { "stylua" },
8 +
				javascript = { "prettier", stop_after_first = true },
8 9
				go = { "goimports", "golines", "gofmt" },
9 10
			},
10 -
			-- format_on_save = {
11 -
			--     lsp_fallback = true,
12 -
			--     async = false,
13 -
			-- },
11 +
			format_on_save = {
12 +
				lsp_fallback = true,
13 +
				async = false,
14 +
			},
14 15
		})
15 16
	end,
16 17
}
nvim/lua/plugins/formatter.lua (deleted) +0 −14
1 -
return {
2 -
  "stevearc/conform.nvim",
3 -
  config = function()
4 -
    require("conform").setup({
5 -
      formatters_by_ft = {
6 -
        lua = { "lua_ls" },
7 -
        -- Conform will run multiple formatters sequentially
8 -
        python = { "isort", "black" },
9 -
        -- Use a sub-list to run only the first available formatter
10 -
        javascript = { { "prettier" } },
11 -
      },
12 -
    })
13 -
  end,
14 -
}