-- LSP Configuration -- Extends LazyVim's built-in LSP support return { -- Mason: manage LSP servers, linters, formatters { "mason-org/mason.nvim", opts = { ensure_installed = { -- LSP servers "gopls", -- Go "lua-language-server", -- Lua "typescript-language-server", -- TypeScript/JavaScript "html-lsp", -- HTML "css-lsp", -- CSS "json-lsp", -- JSON "yaml-language-server", -- YAML "marksman", -- Markdown "sqlls", -- SQL -- Linters "golangci-lint", "eslint_d", "markdownlint", -- Formatters "gofumpt", "goimports", "prettier", "stylua", "sql-formatter", -- DAP "delve", -- Go debugger }, }, }, -- LSP configuration { "neovim/nvim-lspconfig", opts = { servers = { -- Go gopls = { settings = { gopls = { gofumpt = true, codelenses = { gc_details = false, generate = true, regenerate_cgo = true, run_govulncheck = true, test = true, tidy = true, upgrade_dependency = true, vendor = true, }, hints = { assignVariableTypes = true, compositeLiteralFields = true, compositeLiteralTypes = true, constantValues = true, functionTypeParameters = true, parameterNames = true, rangeVariableTypes = true, }, analyses = { fieldalignment = true, nilness = true, unusedparams = true, unusedwrite = true, useany = true, }, usePlaceholders = true, completeUnimported = true, staticcheck = true, directoryFilters = { "-.git", "-.vscode", "-.idea", "-.vscode-test", "-node_modules" }, semanticTokens = true, }, }, }, -- Lua lua_ls = { settings = { Lua = { workspace = { checkThirdParty = false, }, completion = { callSnippet = "Replace", }, diagnostics = { globals = { "vim" }, }, }, }, }, -- TypeScript/JavaScript ts_ls = { settings = { typescript = { inlayHints = { includeInlayParameterNameHints = "all", includeInlayParameterNameHintsWhenArgumentMatchesName = false, includeInlayFunctionParameterTypeHints = true, includeInlayVariableTypeHints = true, includeInlayPropertyDeclarationTypeHints = true, includeInlayFunctionLikeReturnTypeHints = true, includeInlayEnumMemberValueHints = true, }, }, javascript = { inlayHints = { includeInlayParameterNameHints = "all", includeInlayParameterNameHintsWhenArgumentMatchesName = false, includeInlayFunctionParameterTypeHints = true, includeInlayVariableTypeHints = true, includeInlayPropertyDeclarationTypeHints = true, includeInlayFunctionLikeReturnTypeHints = true, includeInlayEnumMemberValueHints = true, }, }, }, }, -- HTML html = { filetypes = { "html", "templ" }, }, -- CSS cssls = {}, -- JSON jsonls = {}, -- YAML yamlls = { settings = { yaml = { keyOrdering = false, schemas = { ["https://json.schemastore.org/github-workflow.json"] = "/.github/workflows/*", ["https://json.schemastore.org/docker-compose.json"] = "docker-compose*.yml", }, }, }, }, -- Markdown marksman = {}, -- SQL sqlls = {}, }, }, }, -- Treesitter for better syntax highlighting { "nvim-treesitter/nvim-treesitter", opts = { ensure_installed = { "go", "gomod", "gowork", "gosum", "lua", "luadoc", "typescript", "javascript", "tsx", "html", "css", "json", "jsonc", "yaml", "markdown", "markdown_inline", "sql", "make", "vim", "vimdoc", "bash", "regex", "diff", "gitcommit", "git_rebase", }, highlight = { enable = true }, indent = { enable = true }, }, }, }