typescript-tools.nvim icon indicating copy to clipboard operation
typescript-tools.nvim copied to clipboard

Poor completion perfomance

Open victorkamoto opened this issue 1 year ago • 8 comments

Great plugin btw

Typescript-tools so far has been a better alternative for typescript-language-server. The completions however can be quite slow. You heve to wait for a second or two before getting completions. There's visible lag. Is there a workaround/tsserver configuration to remedy this? Or is it a known issue?

Using default config btw (lazy.nvim)

return {
  {
    "pmizio/typescript-tools.nvim",
    lazy = true,
    ft = { "typescript", "javascript", "javascriptreact", "typescriptreact" },
    dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" },
    opts = {},
  },
}

victorkamoto avatar May 01 '24 04:05 victorkamoto

https://github.com/yioneko/vtsls

        settings = {
          vtsls = {
            experimental = {
              completion = {
                enableServerSideFuzzyMatch = true,
              },
            },
          },
        }

victorkamoto avatar May 02 '24 02:05 victorkamoto

https://github.com/yioneko/vtsls

        settings = {
          vtsls = {
            experimental = {
              completion = {
                enableServerSideFuzzyMatch = true,
              },
            },
          },
        }

can you elaborate on this?

hanumanman avatar May 18 '24 17:05 hanumanman

can you elaborate on this?

It significantly improves completion performance, as explained in the link on that post: https://github.com/yioneko/vtsls?tab=readme-ov-file#bad-performance-of-completion

tsserver could throw out plenty of completion entries, most of them are globally accessible variables, modules or namespaces. Some LSP clients have poor performance for fuzzy matching or filtering, and cause noticeable delay of completion.

vtsls.experimental.completion.enableServerSideFuzzyMatch: before returning all the completion candidates from tsserver, the server will do fuzzy matching and filter out entries with no match. This can reduce the number of invalid entries in the response.

victorkamoto avatar May 18 '24 23:05 victorkamoto

Shouldn't this be re-opened? It was closed as "not planned" because some other plugin has a fix for it?

austinbutler avatar Jun 21 '24 17:06 austinbutler

Is there any workaround here? This makes typescript-tools unusable for me as it feels laggy when typing because thousands of completion items are being returned by the LSP. I gotta assume there is something I am missing or misconfiguring. Thanks in advance!

GitMurf avatar Apr 02 '25 14:04 GitMurf

Switch to https://github.com/yioneko/vtsls

austinbutler avatar Apr 02 '25 18:04 austinbutler

Switch to https://github.com/yioneko/vtsls

@austinbutler I was using vtsls but have other annoying issues like sometimes goto definition gets wacky (gets confused and takes me to wrong location) and often goto def / refs will hang and take several seconds before it properly "resolves" and takes me there.

Have you noticed those issues?

GitMurf avatar Apr 02 '25 22:04 GitMurf

I don't think so, but maybe I'm just used to it

austinbutler avatar Apr 03 '25 01:04 austinbutler