TypeScript Tsgo Extra
lang.typescript-tsgo is the TypeScript and JavaScript stack that registers the
experimental tsgo language server instead of ts_ls.
Enable this extra instead of lang.typescript, not
alongside it. If lang.typescript is enabled in the extras state file, disable
it with :BlakExtras disable lang.typescript.
Enable it
Section titled “Enable it”-- ~/.config/blak/lua/blak/user.luareturn { extras = { enabled = { "lang.typescript-tsgo", }, },}Or toggle it interactively:
:BlakExtras enable lang.typescript-tsgo:BlakExtras disable lang.typescriptWhat it adds
Section titled “What it adds”| Surface | Contribution |
|---|---|
| Treesitter | javascript, typescript, tsx, jsdoc, json |
| Mason | prettier, prettierd |
| LSP | tsgo, eslint |
| Formatting | prettierd, falling back to prettier, for JS/TS/JSON filetypes |
| Linting | ESLint diagnostics come from the eslint language server |
| Apply hook | Removes ts_ls from the merged config before future setup |
The extra registers the tsgo LSP name. It does not add a Mason package for the
server itself, so use :LspInfo and :BlakDoctor to confirm your local setup
can start it.
Configure tsgo
Section titled “Configure tsgo”Put tsgo settings under lsp.servers.tsgo:
return { extras = { enabled = { "lang.typescript-tsgo" }, }, lsp = { servers = { tsgo = { settings = { typescript = { inlayHints = { includeInlayParameterNameHints = "all", }, }, }, }, eslint = { settings = { workingDirectory = { mode = "auto" }, }, }, }, },}Configure formatting and linting
Section titled “Configure formatting and linting”This extra uses the same formatter defaults as lang.typescript. Override the
filetype entries before the extra fills them:
return { extras = { enabled = { "lang.typescript-tsgo" }, }, format = { formatters_by_ft = { typescript = { "prettier" }, typescriptreact = { "prettier" }, }, },}ESLint diagnostics come from the eslint language server, so no nvim-lint entry
is registered. See Using eslint_d
anyway if you want the standalone daemon
as well.
Switching from ts_ls
Section titled “Switching from ts_ls”When switching from lang.typescript, restart Neovim after disabling it. The
extra removes ts_ls from future setup, but an LSP client that already attached
in the current session will keep running until it is stopped or Neovim exits.
Install and verify
Section titled “Install and verify”:BlakToolsInstall:BlakTreesitterInstall:BlakDoctorThen open a TypeScript file and check :LspInfo for tsgo.