Add helm-projectile-find-file-strategy for streaming#207
Merged
Conversation
`helm-projectile-find-file' builds the whole file index up front before the picker appears, which is slow on large or remote projects. Streaming already exists as a separate `helm-projectile-find-file-streaming' command, but you had to relearn the command name to use it. Add a `helm-projectile-find-file-strategy' option; set it to `streaming' and `helm-projectile-find-file' - along with its other-window and other-frame variants - streams candidates as Projectile's indexing command lists them. The strategy is read on each call, so toggling it takes effect immediately. Defaults to `sync', the original behavior. The dwim commands and `helm-projectile-find-file-in-known-projects' stay sync: they need the full file list by nature (to match the file at point, or to span every known project). Factor the streaming source into `helm-projectile--make-streaming-source' so the other-window/other-frame variants reuse it with the right default action.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
helm-projectile-find-filebuilds the whole project file index up front, which is slow to appear on large or remote projects. Streaming already exists as the separatehelm-projectile-find-file-streamingcommand, but you had to relearn the command name to get it.This adds a
helm-projectile-find-file-strategyoption. Set it tostreamingandhelm-projectile-find-file(plus its other-window and other-frame variants) streams candidates as Projectile's indexing command lists them. It's read on each call, so toggling takes effect immediately. Defaults tosync, the original behavior, so nothing changes out of the box.The
find-file-dwimcommands andfind-file-in-known-projectsstay sync on purpose: they need the full file list by nature (to match the file at point, or to span every known project). The streaming source is factored into a small builder so the window/frame variants reuse it with the right default action.Tests cover the dispatch for all three variants under both strategies, plus the new variant sources and their default actions.
M-x checkdocwarnings