aboutsummaryrefslogtreecommitdiffstats
path: root/home/nvim/lsp.lua
diff options
context:
space:
mode:
authorPetri Hienonen <petri.hienonen@gmail.com>2026-01-12 10:33:52 +0200
committerPetri Hienonen <petri.hienonen@gmail.com>2026-01-12 10:33:52 +0200
commit515b747a4273030e8bd145a6eac770c4de20f69c (patch)
treef399fcbc55fb4a93abb099f9455e3b76e1fd4a77 /home/nvim/lsp.lua
parent9091ec72fe5ed12ae56a46f8580e0053d4b525fb (diff)
downloadnixos-515b747a4273030e8bd145a6eac770c4de20f69c.tar.zst
Use tabs to indent nvim configurations
Diffstat (limited to 'home/nvim/lsp.lua')
-rw-r--r--home/nvim/lsp.lua504
1 files changed, 252 insertions, 252 deletions
diff --git a/home/nvim/lsp.lua b/home/nvim/lsp.lua
index 97037c6..15d463d 100644
--- a/home/nvim/lsp.lua
+++ b/home/nvim/lsp.lua
@@ -3,306 +3,306 @@ vim.lsp.set_log_level(vim.log.levels.WARN)
vim.lsp.log.set_format_func(vim.inspect)
vim.diagnostic.config({
- virtual_text = true,
- virtual_lines = { current_line = true },
- underline = true,
- update_in_insert = false,
- severity_sort = true,
- float = {
- border = "rounded",
- source = true,
- },
- signs = {
- text = {
- [vim.diagnostic.severity.ERROR] = "󰅚 ",
- [vim.diagnostic.severity.WARN] = "󰀪 ",
- [vim.diagnostic.severity.INFO] = "󰋽 ",
- [vim.diagnostic.severity.HINT] = "󰌶 ",
- },
- numhl = {
- [vim.diagnostic.severity.ERROR] = "ErrorMsg",
- [vim.diagnostic.severity.WARN] = "WarningMsg",
- },
- },
+ virtual_text = true,
+ virtual_lines = { current_line = true },
+ underline = true,
+ update_in_insert = false,
+ severity_sort = true,
+ float = {
+ border = "rounded",
+ source = true,
+ },
+ signs = {
+ text = {
+ [vim.diagnostic.severity.ERROR] = "󰅚 ",
+ [vim.diagnostic.severity.WARN] = "󰀪 ",
+ [vim.diagnostic.severity.INFO] = "󰋽 ",
+ [vim.diagnostic.severity.HINT] = "󰌶 ",
+ },
+ numhl = {
+ [vim.diagnostic.severity.ERROR] = "ErrorMsg",
+ [vim.diagnostic.severity.WARN] = "WarningMsg",
+ },
+ },
})
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = vim.tbl_deep_extend("force", capabilities, {
- textDocument = {
- inlayHint = {
- dynamicRegistration = false, -- Static registration
- resolveSupport = {
- properties = { "textEdits", "tooltip", "label" }, -- Resolve additional hint details
- },
- },
- synchronization = {
- dynamicRegistration = false, -- Static registration
- willSave = true, -- Notify server before saving
- willSaveWaitUntil = true, -- Allow server to provide edits before saving
- didSave = true, -- Notify server after saving
- },
- hover = {
- dynamicRegistration = false, -- Static registration
- contentFormat = { "markdown", "plaintext" }, -- Prefer markdown, fallback to plaintext
- },
- documentSymbol = {
- dynamicRegistration = false, -- Static registration
- hierarchicalDocumentSymbolSupport = true, -- Support nested symbols
- symbolKind = {
- valueSet = {
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
- }, -- All standard symbol kinds (file, module, namespace, etc.)
- },
- },
- completion = {
- completionItem = {
- snippetSupport = true,
- preselectSupport = true,
- insertReplaceSupport = true,
- labelDetailsSupport = true,
- deprecatedSupport = true,
- commitCharactersSupport = true,
- tagSupport = { valueSet = { 1 } },
- resolveSupport = {
- properties = { "documentation", "detail", "additionalTextEdits" },
- },
- },
- },
- diagnostic = {
- documentDiagnosticProvider = true, -- Enable document-level diagnostics
- relatedInformation = true, -- Show related diagnostic information
- tagSupport = { valueSet = { 1, 2 } }, -- Support deprecated (1) and unused (2) tags
- dataSupport = true, -- Allow custom data in diagnostics
- },
- semanticTokens = {
- multilineTokenSupport = true,
- overlappingTokenSupport = true,
- augmentsSyntaxTokens = true,
- },
- foldingRange = {
- dynamicRegistration = false,
- lineFoldingOnly = true,
- },
- },
- workspace = {
- configuration = true,
- workspaceFolders = true,
- didChangeWatchedFiles = {
- dynamicRegistration = true,
- },
- fileOperations = {
- didRename = true,
- willRename = true,
- didDelete = true,
- didCreate = true,
- },
- symbol = {
- dynamicRegistration = false, -- Static registration
- symbolKind = {
- valueSet = {
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
- }, -- All standard symbol kinds
- },
- },
- diagnostic = {
- workspaceDiagnosticsProvider = true, -- Enable workspace-level diagnostics
- },
- },
+ textDocument = {
+ inlayHint = {
+ dynamicRegistration = false, -- Static registration
+ resolveSupport = {
+ properties = { "textEdits", "tooltip", "label" }, -- Resolve additional hint details
+ },
+ },
+ synchronization = {
+ dynamicRegistration = false, -- Static registration
+ willSave = true, -- Notify server before saving
+ willSaveWaitUntil = true, -- Allow server to provide edits before saving
+ didSave = true, -- Notify server after saving
+ },
+ hover = {
+ dynamicRegistration = false, -- Static registration
+ contentFormat = { "markdown", "plaintext" }, -- Prefer markdown, fallback to plaintext
+ },
+ documentSymbol = {
+ dynamicRegistration = false, -- Static registration
+ hierarchicalDocumentSymbolSupport = true, -- Support nested symbols
+ symbolKind = {
+ valueSet = {
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
+ }, -- All standard symbol kinds (file, module, namespace, etc.)
+ },
+ },
+ completion = {
+ completionItem = {
+ snippetSupport = true,
+ preselectSupport = true,
+ insertReplaceSupport = true,
+ labelDetailsSupport = true,
+ deprecatedSupport = true,
+ commitCharactersSupport = true,
+ tagSupport = { valueSet = { 1 } },
+ resolveSupport = {
+ properties = { "documentation", "detail", "additionalTextEdits" },
+ },
+ },
+ },
+ diagnostic = {
+ documentDiagnosticProvider = true, -- Enable document-level diagnostics
+ relatedInformation = true, -- Show related diagnostic information
+ tagSupport = { valueSet = { 1, 2 } }, -- Support deprecated (1) and unused (2) tags
+ dataSupport = true, -- Allow custom data in diagnostics
+ },
+ semanticTokens = {
+ multilineTokenSupport = true,
+ overlappingTokenSupport = true,
+ augmentsSyntaxTokens = true,
+ },
+ foldingRange = {
+ dynamicRegistration = false,
+ lineFoldingOnly = true,
+ },
+ },
+ workspace = {
+ configuration = true,
+ workspaceFolders = true,
+ didChangeWatchedFiles = {
+ dynamicRegistration = true,
+ },
+ fileOperations = {
+ didRename = true,
+ willRename = true,
+ didDelete = true,
+ didCreate = true,
+ },
+ symbol = {
+ dynamicRegistration = false, -- Static registration
+ symbolKind = {
+ valueSet = {
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
+ }, -- All standard symbol kinds
+ },
+ },
+ diagnostic = {
+ workspaceDiagnosticsProvider = true, -- Enable workspace-level diagnostics
+ },
+ },
})
vim.lsp.config("*", {
- capabilities = capabilities,
- root_markers = { ".git" },
+ capabilities = capabilities,
+ root_markers = { ".git" },
})
vim.lsp.config("lua_ls", {
- cmd = { "lua-language-server" },
- filetypes = { "lua" },
- root_markers = { ".luarc.json", ".luarc.jsonc" },
- single_file_support = true,
- settings = {
- Lua = {
- format = {
- enable = true,
- defaultConfig = {
- indent_size = 1,
- indent_style = "tab",
- max_line_length = 120,
- quote_style = "double"
- },
- },
- runtime = { version = "LuaJIT" },
- diagnostics = {
- globals = { "vim", "luassert", "luv" },
- },
- workspace = {
- checkThirdParty = true,
- library = vim.api.nvim_get_runtime_file("", true),
- },
- telemetry = { enable = false },
- hint = {
- enable = true,
- setType = true,
- paramType = true,
- paramName = "All",
- },
- },
- },
+ cmd = { "lua-language-server" },
+ filetypes = { "lua" },
+ root_markers = { ".luarc.json", ".luarc.jsonc" },
+ single_file_support = true,
+ settings = {
+ Lua = {
+ format = {
+ enable = true,
+ defaultConfig = {
+ indent_size = 1,
+ indent_style = "tab",
+ max_line_length = 120,
+ quote_style = "double"
+ },
+ },
+ runtime = { version = "LuaJIT" },
+ diagnostics = {
+ globals = { "vim", "luassert", "luv" },
+ },
+ workspace = {
+ checkThirdParty = true,
+ library = vim.api.nvim_get_runtime_file("", true),
+ },
+ telemetry = { enable = false },
+ hint = {
+ enable = true,
+ setType = true,
+ paramType = true,
+ paramName = "All",
+ },
+ },
+ },
})
vim.lsp.config("nil_ls", {
- cmd = { "nil" },
- root_markers = { "flake.nix" },
- filetypes = { "nix" },
- settings = {
- ["nil"] = {
- formatting = { command = { "nixfmt", "-s" } },
- },
- },
+ cmd = { "nil" },
+ root_markers = { "flake.nix" },
+ filetypes = { "nix" },
+ settings = {
+ ["nil"] = {
+ formatting = { command = { "nixfmt", "-s" } },
+ },
+ },
})
vim.lsp.config("ts_ls", {
- cmd = { "typescript-language-server", "--stdio" },
- root_markers = { ".editorconfig", "jsconfig.json" },
- filetypes = { "javascript", "javascriptreact", "typescript", "typescriptreact", "vue" },
- init_options = {
- preferences = {
- disableSuggestions = false,
- includeCompletionsForModuleExports = true,
- },
- },
- capabilities = {
- textDocument = {
- formatting = false,
- },
- },
- on_attach = function(client, bufnr)
- client.server_capabilities.documentFormattingProvider = false
- client.server_capabilities.documentRangeFormattingProvider = false
- end,
+ cmd = { "typescript-language-server", "--stdio" },
+ root_markers = { ".editorconfig", "jsconfig.json" },
+ filetypes = { "javascript", "javascriptreact", "typescript", "typescriptreact", "vue" },
+ init_options = {
+ preferences = {
+ disableSuggestions = false,
+ includeCompletionsForModuleExports = true,
+ },
+ },
+ capabilities = {
+ textDocument = {
+ formatting = false,
+ },
+ },
+ on_attach = function(client, bufnr)
+ client.server_capabilities.documentFormattingProvider = false
+ client.server_capabilities.documentRangeFormattingProvider = false
+ end,
})
vim.lsp.config("ruff", {
- cmd = { "ruff", "server" },
- root_markers = { "pyproject.toml" },
- filetypes = { "python" },
- init_options = {
- settings = {
- configurationPreference = "filesystemFirst",
- fixAll = true,
- lineLength = 100,
- lint = { enable = true },
- organizeImports = true,
- },
- },
+ cmd = { "ruff", "server" },
+ root_markers = { "pyproject.toml" },
+ filetypes = { "python" },
+ init_options = {
+ settings = {
+ configurationPreference = "filesystemFirst",
+ fixAll = true,
+ lineLength = 100,
+ lint = { enable = true },
+ organizeImports = true,
+ },
+ },
})
vim.lsp.config("dprint", {
- cmd = { "dprint", "lsp" },
- filetypes = { "toml", "yaml", "markdown", "css" },
- settings = {},
+ cmd = { "dprint", "lsp" },
+ filetypes = { "toml", "yaml", "markdown", "css" },
+ settings = {},
})
vim.lsp.config("clangd", {
- cmd = { "clangd" },
- filetypes = { "c", "cpp" },
- root_markers = {
- ".clangd", ".git"
- },
+ cmd = { "clangd" },
+ filetypes = { "c", "cpp" },
+ root_markers = {
+ ".clangd", ".git"
+ },
})
vim.lsp.config("vale_ls", {
- cmd = { "vale-ls" },
- filetypes = { "markdown", "text", "tex", "rst", "adoc", "asciidoc" },
- root_markers = { ".vale.ini" },
+ cmd = { "vale-ls" },
+ filetypes = { "markdown", "text", "tex", "rst", "adoc", "asciidoc" },
+ root_markers = { ".vale.ini" },
})
vim.lsp.config("ty", {
- cmd = { "ty", "server" },
- root_markers = { "pyproject.toml" },
- filetypes = { "python" },
- settings = {
- ty = {
- diagnosticMode = "workspace",
- experimental = {
- rename = true,
- autoImport = true,
- completions = true,
- },
- },
- },
+ cmd = { "ty", "server" },
+ root_markers = { "pyproject.toml" },
+ filetypes = { "python" },
+ settings = {
+ ty = {
+ diagnosticMode = "workspace",
+ experimental = {
+ rename = true,
+ autoImport = true,
+ completions = true,
+ },
+ },
+ },
})
vim.lsp.config("rust_analyzer", {
- cmd = { "rust-analyzer" },
- root_markers = { "Cargo.toml" },
- filetypes = { "rust" },
- settings = {
- ["rust-analyzer"] = {
- check = {
- command = "clippy",
- },
- },
- },
+ cmd = { "rust-analyzer" },
+ root_markers = { "Cargo.toml" },
+ filetypes = { "rust" },
+ settings = {
+ ["rust-analyzer"] = {
+ check = {
+ command = "clippy",
+ },
+ },
+ },
})
vim.lsp.config("biome", {
- cmd = { "biome", "lsp-proxy" },
- workspace_required = true,
- filetypes = {
- "graphql",
- "javascript",
- "json",
- "html"
- },
- root_markers = { "biome.json" },
- capabilities = {
- textDocument = {
- formatting = {
- dynamicRegistration = false,
- },
- },
- },
- single_file_support = false
+ cmd = { "biome", "lsp-proxy" },
+ workspace_required = true,
+ filetypes = {
+ "graphql",
+ "javascript",
+ "json",
+ "html"
+ },
+ root_markers = { "biome.json" },
+ capabilities = {
+ textDocument = {
+ formatting = {
+ dynamicRegistration = false,
+ },
+ },
+ },
+ single_file_support = false
})
vim.lsp.config("gopls", {
- cmd = { "gopls" },
- root_markers = { "go.mod" },
- filetypes = { "go", "gomod", "gowork", "gotmpl" },
- settings = {
- gopls = {
- analyses = {
- unusedparams = true,
- },
- staticcheck = true,
- },
- },
+ cmd = { "gopls" },
+ root_markers = { "go.mod" },
+ filetypes = { "go", "gomod", "gowork", "gotmpl" },
+ settings = {
+ gopls = {
+ analyses = {
+ unusedparams = true,
+ },
+ staticcheck = true,
+ },
+ },
})
vim.lsp.config("bashls", {
- cmd = { "bash-language-server", "start" },
- filetypes = { "sh" },
+ cmd = { "bash-language-server", "start" },
+ filetypes = { "sh" },
})
vim.lsp.config("texlab", {
- cmd = { "texlab" },
- filetypes = { "tex", "plaintex", "bib" },
+ cmd = { "texlab" },
+ filetypes = { "tex", "plaintex", "bib" },
})
vim.lsp.enable({
- "bashls",
- "biome",
- "clangd",
- "dprint",
- "gopls",
- "lua_ls",
- "nil_ls",
- "ruff",
- "rust_analyzer",
- "texlab",
- "ts_ls",
- "ty",
- "vale_ls",
+ "bashls",
+ "biome",
+ "clangd",
+ "dprint",
+ "gopls",
+ "lua_ls",
+ "nil_ls",
+ "ruff",
+ "rust_analyzer",
+ "texlab",
+ "ts_ls",
+ "ty",
+ "vale_ls",
})