dotfiles/home/common/nvim/lsp.lua

68 lines
1.5 KiB
Lua
Raw Normal View History

2024-10-06 23:00:01 +02:00
local lspconfig = require("lspconfig")
local servers = {
cssls = {},
html = {},
jsonls = {},
2025-01-08 15:37:19 +01:00
sqls = {},
superhtml = {},
ts_ls = {},
2024-10-06 23:00:01 +02:00
2024-12-02 09:42:24 +01:00
gopls = {
settings = {
gopls = {
hints = {
rangeVariableTypes = true,
parameterNames = true,
constantValues = true,
assignVariableTypes = true,
compositeLiteralFields = true,
compositeLiteralTypes = true,
functionTypeParameters = true,
},
},
},
},
2024-12-02 09:42:24 +01:00
harper_ls = {
filetypes = {
"asciidoc", "c", "gitcommit", "go", "html", "javascript", "just", "lua", "markdown",
"nix", "python", "ruby", "rust", "text", "toml", "typescript", "zig",
}
},
lua_ls = {
settings = {
Lua = {
runtime = {
version = "LuaJIT",
path = vim.split(package.path, ";"),
},
diagnostics = { globals = { "vim", "hs" } },
2024-12-02 09:42:24 +01:00
hint = { enable = true },
workspace = {
library = {
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
[vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true,
},
},
},
2024-11-09 10:09:10 +01:00
},
},
2024-10-06 23:00:01 +02:00
nixd = {
cmd = { "nixd" },
settings = {
nixd = {
nixpkgs = { expr = "import <nixpkgs> { }" },
formatting = { command = { "nixfmt" } },
options = {},
2024-11-09 10:09:10 +01:00
},
},
},
}
for server, config in pairs(servers) do
config.capabilities = require('blink.cmp').get_lsp_capabilities(config.capabilities)
lspconfig[server].setup(config)
end