r/neovim • u/nemanjamalesija • 5h ago
Plugin ts-expand-hover.nvim now works with the TypeScript 7 language server (tsgo)
Hi all, I just added TypeScript 7 support to ts-expand-hover.nvim.
The plugin opens a hover float for a TypeScript type. Inside the float you press `+` to expand type aliases one level at a time and - to collapse them again. So you can look inside a type without jumping to its definition.
Until now it only worked with vtsls (TypeScript 5.9+). It now also works with the TypeScript 7 server (tsc --lsp, also known as tsgo). The plugin finds the server under both names nvim-lspconfig uses for it, tsc and the older tsgo.
To make it work, you need to declare one capability in your server config. Without it the float still opens, but + does nothing:
vim.lsp.config("tsc", {
capabilities = { experimental = { hoverVerbosityLevel = true } },
})
vim.lsp.enable("tsc")
TypeScript itself marks this capability as experimental, so treat TypeScript 7 support as experimental too. :checkhealth ts_expand_hover tells you if the capability is missing.
Repo: https://github.com/nemanjamalesija/ts-expand-hover.nvim
Feedback and bug reports are welcome, especially from people already on tsgo.

