gagbo/consult-lsp

consult-lsp-symbols is slow

qleguennec opened this issue · 1 comments

Could there maybe be a way to cache the candidates?

gagbo commented

Hello,

I don't think that making consult-lsp handle caching is a good idea. The first question that arises when it comes to caching is "when should the cache be cleaned ?"

The answer to that is, in my opinion, "when a file or an event somewhere in the project changed what the response should be." And, just like the initial responsibility of providing the list of symbols, the optional task of caching the list and handling that cache falls to the LSP server, not the client. That's why most (if not all) LSP servers have some sort of cache on disk with the relevant indexing information and they should use that to make the queries faster.

I'll close this as I don't see myself having the time nor the motivation to try to tackle language-specific caching rules on the language-agnostic client side of the protocol.

Cheers,
Gerry