Commit Graph
39175 Commits
Author SHA1 Message Date
Max Brunsfeld 6aeea31b36 Ignore .git directories 2021-04-26 15:46:06 -07:00
Max Brunsfeld ca12965b95 Fix handling of uppercase characters in fuzzy finding 2021-04-26 15:04:26 -07:00
Nathan Sobo e34cf2ba32 Rerender tabs when buffers' file handles change
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-04-26 14:16:35 -07:00
Max BrunsfeldandNathan Sobo 3a7e2b24c5 Update filehandle paths when renames occur
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-04-26 12:56:13 -07:00
7f96394f15 WIP: Start on updating file handles
Co-Authored-By: Max Brunsfeld <max@zed.dev>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-04-26 20:10:15 +02:00
Antonio Scandurra ad0b52781f Keep ignore status up-to-date as events are processed 2021-04-26 17:55:18 +02:00
Nathan Sobo 1a3132bae0 WIP: Maintain an IgnoreStack while scanning
All ignore files associated with ancestors of the directory currently being scanned are included in the stack. This allows us to compute ignore status for each entry as we initially scan it. If we encounter an ignored directory, we replace the stack with an "ignore all" variant that simply ignores every descendant of the ignored directory.

This is incomplete. We still need to construct an ignore stack in an appropriate state when rescanning subtrees in response to events. It also doesn't deal with individual ignore files being added, removed, or changed. I think we could potentially use the ignore stack while reconstructing the tree for this purpose.
2021-04-24 23:59:03 -06:00
Antonio Scandurra d58cfbc13c Avoid cloning entry in Snapshot::entry_for_path 2021-04-24 10:14:17 +02:00
Max BrunsfeldandNathan Sobo c2e8e0b3a2 Avoid storing redundant copies of file paths
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-04-23 21:17:26 -07:00
Max BrunsfeldandNathan Sobo 5141a063ce Fix fuzzy matching after removing root dirname from stored paths
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-04-23 15:22:47 -07:00
Nathan SoboandMax Brunsfeld 55eb255bdf WIP
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-04-23 12:47:23 -06:00
Nathan SoboandMax Brunsfeld 891357cd53 WIP
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-04-23 11:37:23 -06:00
Antonio ScandurraandNathan Sobo e6ef6fd106 Rename PathSearch::Sibling to PathSearch::Successor
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-04-23 17:15:04 +02:00
Antonio Scandurra 0d7cba35ab Restructure Worktree to index entries by path 2021-04-23 15:25:59 +02:00
Max BrunsfeldandNathan Sobo 73e2eb1f87 Use getmntinfo(3) to list mounted volumes
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-04-22 15:41:03 -07:00
Max BrunsfeldandNathan Sobo 563ff9f2fd Start work on excluding separate mount dirs
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-04-22 14:11:46 -07:00
Max BrunsfeldandNathan Sobo ac40391c67 Avoid redundant clearing of descendants when scanning dirs
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-04-22 10:30:47 -07:00
f7498ed35d Log when there's an error while scanning a directory
Co-Authored-By: Max Brunsfeld <max@zed.dev>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-04-22 19:15:37 +02:00
2ded57b499 Simulate .gitignores in the randomized test
Co-Authored-By: Max Brunsfeld <max@zed.dev>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-04-22 18:57:46 +02:00
622abe8a52 Clear descendants of existing children when scanning a directory
Co-Authored-By: Max Brunsfeld <max@zed.dev>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-04-22 18:42:11 +02:00
Antonio Scandurra 5340592ee1 Replace linear scan of entries with a custom FileIter 2021-04-22 17:29:36 +02:00
Antonio Scandurra b11ab0b394 Remove is_ignored from PathEntry and lean more on the tree instead 2021-04-22 16:49:11 +02:00
Antonio Scandurra 212ec2bc07 Ignore .git folder 2021-04-22 16:48:13 +02:00
Antonio Scandurra 1055788878 Let ignore edits batch naturally without imposing a max batch len 2021-04-22 16:47:41 +02:00
Antonio Scandurra 72fb1da21e Recompute ignore status when .gitignore changes or for new entries 2021-04-22 15:14:23 +02:00
Max Brunsfeld 34e872f98c Start work on handling changes to gitignore files
* Use the published ignore crate
* Store ignore objects on snapshot, and use them to compute
  files' ignored status dynamically, instead of storing the
  ignored status on the file.
2021-04-21 18:11:52 -07:00
Max Brunsfeld 7944856d60 wip - gitignore handling on rescan 2021-04-21 12:30:30 -07:00
Max BrunsfeldandNathan Sobo 36b8931801 Store paths as strings on PathMatch structs
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-04-21 12:05:34 -07:00
Max BrunsfeldandNathan Sobo 5834bc1585 Check worktree invariants in randomized test
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-04-21 11:46:49 -07:00
Max BrunsfeldandNathan Sobo f206b2398c Fix missing insert in populate_dir
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-04-21 11:39:50 -07:00
Nathan SoboandMax Brunsfeld 2d12a8a94b WIP
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-04-21 12:29:16 -06:00
Nathan SoboandMax Brunsfeld 3da2a00b48 WIP: Establish new invariant-maintaining API for mutating worktree snapshots
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2021-04-21 12:08:09 -06:00
Antonio ScandurraandNathan Sobo 208c58312b WIP
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-04-21 16:58:17 +02:00
Antonio Scandurra 305a3097f4 Re-enable file finder test and bind menu:select-{next-prev} 2021-04-21 10:07:32 +02:00
Max Brunsfeld f2dfc63d15 Merge pull request #23 from zed-industries/fix-mac-mini-failures
Use our own scoped_pool implementation
2021-04-20 16:01:47 -07:00
Max BrunsfeldandNathan Sobo b721209f29 Fully halt background scanner threads when dropping Worktree
* Rework fsevent API to expose a handle for halting the event stream

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-04-20 15:55:29 -07:00
Max Brunsfeld 4367b00060 Use our own scoped_pool implementation 2021-04-20 14:07:36 -07:00
Max BrunsfeldandAntonio Scandurra d7f0431880 Stop processing events if root path is deleted
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-04-20 10:40:17 -07:00
Max BrunsfeldandAntonio Scandurra 00c075ee4f Worktree: silence log message when dir is overwritten by file
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-04-20 10:12:48 -07:00
81cd133362 WIP
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-04-20 10:59:12 -06:00
dcd7e7d347 Remove task_done condvar which supported finish_pending_tasks
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-04-20 10:45:42 -06:00
4d16b59636 Ensure we remove broadcast channels after all conditions resolve
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-04-20 10:43:13 -06:00
e249900bb5 Panic when awaiting conditions on dropped entities
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2021-04-20 10:36:54 -06:00
Antonio ScandurraandNathan Sobo 5dd6557f09 Use env_logger instead of simplelog in tests
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-04-20 17:34:14 +02:00
Antonio ScandurraandNathan Sobo 91e58f9803 Time out condition after 200ms and add basic unit tests for it
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-04-20 17:21:29 +02:00
Antonio Scandurra eb174da091 Replace remaining usages of finish_pending_tasks with condition 2021-04-20 12:28:30 +02:00
Antonio Scandurra 447b3be78b Use scan_complete and the new ModelHandle::condition test method 2021-04-20 11:48:12 +02:00
Antonio Scandurra b26c9fe4e0 Rework Worktree::scan_complete to use a watch 2021-04-20 11:24:46 +02:00
Nathan Sobo 8035044bb0 WIP: Add a condition method to model and view handles for use in tests
It returns a future that resolves when the provided predicate returns true. The predicate is called any time the handle's targeted entity calls notify.

Still need to add a timeout and completely remove finsih_pending_tasks.
2021-04-19 22:01:54 -06:00
Max Brunsfeld 52ae5fd96e Add a method for waiting until a worktree's current scan is complete
Start removing usages of finish_pending_tasks in tests
2021-04-19 17:45:01 -07:00