🌐 AI搜索 & 代理 主页
Skip to content

Pass --canUseWatchEvents to tsserver #956

@montlebalm

Description

@montlebalm

Is there a way to set the --canUseWatchEvents flag when starting tsserver? I've tried passing it as a command line arg to typescript-language-server in my Neovim LSP config:

vim.lsp.config('ts_ls', {
  cmd = { "typescript-language-server", "--stdio", "--canUseWatchEvents" },
})

... but it errors with "error: unknown option '--canUseWatchEvents'".

For background, typescript-language-server appears to be actively watching 40k files in my large project. I noticed that VS Code in the same project only watches around 200 files. I've read that VS Code uses a different version of node (electron-based?) with pointer compression so that could account for some improvements. That being said, I noticed that VS Code starts tsserver with the --canUseWatchEvents flag and typescript-language-server does not so that seemed like a good starting point.

Is there an option or workaround that I can use to test this theory?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions