diff options
Diffstat (limited to '')
-rw-r--r-- | lsp/angular-language-server.lua | 11 | ||||
-rw-r--r-- | lsp/biome.lua | 14 | ||||
-rw-r--r-- | lsp/lua-language-server.lua | 8 | ||||
-rw-r--r-- | lsp/qmlls.lua | 5 | ||||
-rw-r--r-- | lsp/rust-analyzer.lua | 25 | ||||
-rw-r--r-- | lsp/typescript-language-server.lua | 39 |
6 files changed, 101 insertions, 1 deletions
diff --git a/lsp/angular-language-server.lua b/lsp/angular-language-server.lua new file mode 100644 index 0000000..63a61c6 --- /dev/null +++ b/lsp/angular-language-server.lua @@ -0,0 +1,11 @@ +return { + cmd = { "ngserver", "--stdio" }, + root_markers = { "angular.json" }, + filetypes = { + "html", + "htmlangular", + "typescript", + "typescriptreact", + "typescript.tsx", + }, +} diff --git a/lsp/biome.lua b/lsp/biome.lua new file mode 100644 index 0000000..b55de9d --- /dev/null +++ b/lsp/biome.lua @@ -0,0 +1,14 @@ +return { + cmd = { "biome", "lsp-proxy" }, + root_markers = { "package.json", "biome.json", "biome.jsonc" }, + filetypes = { + "json", + "jsonc", + "javascript", + "javascriptreact", + "javascript.jsx", + "typescript", + "typescriptreact", + "typescript.tsx", + }, +} diff --git a/lsp/lua-language-server.lua b/lsp/lua-language-server.lua index 72a0847..ce0d902 100644 --- a/lsp/lua-language-server.lua +++ b/lsp/lua-language-server.lua @@ -1,6 +1,6 @@ return { cmd = { "lua-language-server" }, - root_markers = { ".luarc.json" }, + root_markers = { ".luarc.json", ".git" }, filetypes = { "lua" }, settings = { @@ -13,6 +13,12 @@ return { disable = { "missing-fields" }, }, telemetry = { enabled = false }, + + workspace = { + library = { + vim.env.VIMRUNTIME, + }, + }, }, }, } diff --git a/lsp/qmlls.lua b/lsp/qmlls.lua new file mode 100644 index 0000000..92dc83b --- /dev/null +++ b/lsp/qmlls.lua @@ -0,0 +1,5 @@ +return { + cmd = { "qmlls", "-E" }, + root_markers = { ".qmlls.ini", ".git" }, + filetypes = { "qml", "qmljs" }, +} diff --git a/lsp/rust-analyzer.lua b/lsp/rust-analyzer.lua index 51f5037..78ed2c5 100644 --- a/lsp/rust-analyzer.lua +++ b/lsp/rust-analyzer.lua @@ -1,8 +1,33 @@ +local serverReady = {} + return { cmd = { "rust-analyzer" }, root_markers = { "Cargo.toml" }, filetypes = { "rust" }, + capabilities = { + experimental = { + serverStatusNotification = true, + }, + }, + + handlers = { + ["experimental/serverStatus"] = function(_, result, ctx) + -- Try to fix inlay hints not being shown on start of + if result.quiescent and not serverReady[ctx.client_id] then + for _, bufnr in ipairs(vim.lsp.get_buffers_by_client_id(ctx.client_id)) do + -- Re-enable inlay hints so they are refreshed + if vim.lsp.inlay_hint.is_enabled() then + vim.lsp.inlay_hint.enable(false, { bufnr = bufnr }) + vim.lsp.inlay_hint.enable(true, { bufnr = bufnr }) + end + + serverReady[ctx.client_id] = true + end + end + end, + }, + settings = { ["rust-analyzer"] = { checkOnSave = { command = "clippy" }, diff --git a/lsp/typescript-language-server.lua b/lsp/typescript-language-server.lua new file mode 100644 index 0000000..41a3110 --- /dev/null +++ b/lsp/typescript-language-server.lua @@ -0,0 +1,39 @@ +return { + cmd = { "typescript-language-server", "--stdio" }, + root_markers = { "package.json", "jsconfig.json", "tsconfig.json" }, + filetypes = { + "javascript", + "javascriptreact", + "javascript.jsx", + "typescript", + "typescriptreact", + "typescript.tsx", + }, + settings = { + typescript = { + inlayHints = { + includeInlayParameterNameHints = "all", + includeInlayParameterNameHintsWhenArgumentMatchesName = true, + includeInlayVariableTypeHints = true, + includeInlayFunctionParameterTypeHints = true, + includeInlayVariableTypeHintsWhenTypeMatchesName = true, + includeInlayPropertyDeclarationTypeHints = true, + includeInlayFunctionLikeReturnTypeHints = true, + includeInlayEnumMemberValueHints = true, + }, + }, + javascript = { + inlayHints = { + includeInlayParameterNameHints = "all", + includeInlayParameterNameHintsWhenArgumentMatchesName = true, + includeInlayVariableTypeHints = true, + + includeInlayFunctionParameterTypeHints = true, + includeInlayVariableTypeHintsWhenTypeMatchesName = true, + includeInlayPropertyDeclarationTypeHints = true, + includeInlayFunctionLikeReturnTypeHints = true, + includeInlayEnumMemberValueHints = true, + }, + }, + }, +} |