Using ignore crate to search in reverse #2486
-
Following the work I did in #2294, I'm using ignore 0.4.20 in combination with the other wonderful parts of the ripgrep crates to support searching in distant. Particularly, this is helpful with distant.nvim. I have a scenario where I need to search upward to support quick location of files in the current or one of ancestor directories that indicates a language server to use. I'm trying to think of the best way to do this given my current setup of creating a parallel walker. My first thought is that I take the path that is the deepest I will search - given in a query - and produce all of the ancestor paths. Then I provide all of those paths to the walker and set to the maximum depth to 0 to make sure that it doesn't traverse beyond the paths I provide. Would that make sense to pursue? Any particular downside to call out? I'd also love to hear if there are any alternatives. Of course, if the ignore crate supports changing the traversal direction to upward, I'd latch onto that immediately. :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think that sounds reasonable? I am honestly not sure. I've never done such a thing before and the |
Beta Was this translation helpful? Give feedback.
I think that sounds reasonable? I am honestly not sure. I've never done such a thing before and the
ignore
crate certainly does not support it directly. Good luck!