-
Notifications
You must be signed in to change notification settings - Fork 229
Closed
astral-sh/ruff
#20030Labels
performancePotential performance improvementPotential performance improvementserverRelated to the LSP serverRelated to the LSP server
Milestone
Description
Searching for workspace symbols can be very slow in large projects. We should add some form of caching to workspace symbols to traversing every single file on every request.
I don't think it's necessary to build a full search index. Using only salsa for caching should probably be fine for an initial version:
- Make
symbols_for_filea salsa query that doesn't take any option and returns all symbols of that file. We could consider making it two queries: One that returns hierarchical and another that returns non-hierarchical symbol information. The most important part is that the query isn't parametrized by the query string. Instead, filtering should happen after collecting all symbols. This gives us per-file caching, which should make subsequent lookups very cheap - Iterate over all files in
workspace_symbolsand apply the filtering based on the user input
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
performancePotential performance improvementPotential performance improvementserverRelated to the LSP serverRelated to the LSP server