Skip to content

[docs] how to use typescript-go lsp #67

Open
@sockthedev

Description

@sockthedev

https://github.com/microsoft/typescript-go

its finally giving me a great experience in neovim. feels mega responsive, and features like find usage etc are working.

probably worth considering testing it here and documenting the option to use it.

below is how i configure it for neovim.

install the latest build;

npm install -g @typescript/native-preview

and then manually extend the lsp config;

local configs = require 'lspconfig.configs'

if not configs.tsgo then
  configs.tsgo = {
    default_config = {
      cmd = { 'tsgo', '--lsp', '--stdio' },
      filetypes = {
        'javascript',
        'javascriptreact',
        'javascript.jsx',
        'typescript',
        'typescriptreact',
        'typescript.tsx',
      },
      root_dir = require('lspconfig').util.root_pattern(
        'tsconfig.json',
        'pnpm-lock.yaml',
        'package-lock.json',
        'yarn.lock',
        'bun.lockb',
        '.git'
      ),
    },
  }
end

you can register it in the same way you register other lsps.

make sure to disable/remove any other typescript lsp you might have had configured.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions