pmizio / typescript-tools.nvim

⚡ TypeScript integration NeoVim deserves ⚡
MIT License
1.26k stars 36 forks source link

Poor completion perfomance #262

Open victorkamoto opened 2 months ago

victorkamoto commented 2 months ago

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 commented 2 months ago

https://github.com/yioneko/vtsls

        settings = {
          vtsls = {
            experimental = {
              completion = {
                enableServerSideFuzzyMatch = true,
              },
            },
          },
        }
hanumanman commented 1 month ago

https://github.com/yioneko/vtsls

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

can you elaborate on this?

victorkamoto commented 1 month ago

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.

austinbutler commented 2 weeks ago

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