by patrickdevivo · 4y ago · 0 comments
1) an ability to easily express higher level concepts in a search that's aware of code semantics ("match only function names", "find call sites of a method") etc. Maybe this is possible with existing tools (probably is?) but I tend to get lazy about learning DSLs - would love to see this in a UI if it's possible
2) ability to save searches I do frequently - after a certain level of complexity in a query (I've added ignore rules, I crafted the right regex, etc), I want to be able to save the "context" of a search so that I can easily return to it later
> would love to see this in a UI if it's possible
We do have code navigation via the UI, so in a way it's possible!
> ability to save searches I do frequently
Absolutely! This is possible using "custom scopes". If you're in the technology preview, click on the scope dropdown, scroll to the bottom, and choose "custom scopes". You can make a custom scope to search a set of respositories, a particular language, within a directory, or any combination with boolean operators!
http://lemonodor.com/archives/001232.html
For example, if you're looking for a search-and-replace function you know you wrote or had somewhere on your machine, you could do
mdfind "org_lisp_defuns == '*search*replace*'"
(Or just use the regular Spotlight UI.)1) This doesn't seem to exist in quite that way, but you can prefix a literal with "def:" and the engine will return only definitions of that thing (so far as it can tell). It's not quite what you (or I!) want, but close.
2) This exists and is called "scopes". On the landing page, to the left of the search bar, click the grey pill that says "All repos". At the bottom there is a "custom scopes" option.