From 0df1c17c1fc4177226b4aadf2b2502fa8ae46faf Mon Sep 17 00:00:00 2001 From: AramJonghu Date: Sat, 1 Aug 2026 17:11:33 +0200 Subject: [PATCH] feat(tsgo): vtls -> tsgo for better lsp --- lua/config/inlay-hints.lua | 15 +++++++++++++++ lua/config/lspconfig.lua | 15 ++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/lua/config/inlay-hints.lua b/lua/config/inlay-hints.lua index 9bea549..4fa2933 100644 --- a/lua/config/inlay-hints.lua +++ b/lua/config/inlay-hints.lua @@ -13,6 +13,21 @@ vim.lsp.config("vtsls", { }, }) +vim.lsp.config("tsgo", { + settings = { + typescript = { + inlayHints = { + parameterNames = { enabled = "all" }, + parameterTypes = { enabled = true }, + variableTypes = { enabled = true }, + propertyDeclarationTypes = { enabled = true }, + functionLikeReturnTypes = { enabled = true }, + enumMemberValues = { enabled = true }, + }, + }, + }, +}) + vim.lsp.config("denols", { settings = { deno = { diff --git a/lua/config/lspconfig.lua b/lua/config/lspconfig.lua index 0523263..197e977 100644 --- a/lua/config/lspconfig.lua +++ b/lua/config/lspconfig.lua @@ -5,7 +5,7 @@ local servers = { "phpactor", "ols", "zls", - "vtsls", + "tsgo", "eslint", "yamlls", "vimls", @@ -38,6 +38,19 @@ for _, server in ipairs(servers) do vim.lsp.enable(server) end +vim.lsp.config("tsgo", { + cmd = function(dispatchers, config) + local bin = "tsc" + if (config or {}).root_dir then + local local_bin = vim.fs.joinpath(config.root_dir, "node_modules/.bin", bin) + if vim.fn.executable(local_bin) == 1 then + bin = local_bin + end + end + return vim.lsp.rpc.start({ bin, "--lsp", "--stdio" }, dispatchers) + end, +}) + vim.lsp.config("digestif", { cmd = { vim.fn.expand "~/.luarocks/bin/digestif" }, })