3 ms·
this looks awesome! two things I've always wanted and haven't found satisfying solutions for in code search (in an editor) 1) an ability to easily express high
by patrickdevivo 5y ago
this looks awesome! two things I've always wanted and haven't found satisfying solutions for in code search (in an editor)
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
- colin353 5y agoGitHub Code Search developer here: > 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!
- Serow225 5y agoI wonder if “custom scopes” is going to be a recognizable term for people?
- pianoben 5y agoI've been in the preview for a bit. 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.
- colin353 5y agoMight also be worth checking out the syntax guide: https://cs.github.com/about/syntax#symbol https://cs.github.com/about/syntax#symbol
- jjwiseman 5y agoIt's local-only search, but you reminded me that this is possible with MacOS Spotlight. I wrote an indexer (for Common Lisp) that let you search for function definitions, etc. http://lemonodor.com/archives/001232.html 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.)