3 ms·
Random idea: maybe you could supercharge this by introducing to grep some constructs from programming languages. Now you have things like "word character", "whi
by jpalomaki 7y ago
Random idea: maybe you could supercharge this by introducing to grep some constructs from programming languages. Now you have things like "word character", "whitespace", "start of line". In supercharged version you would have "function", "identifier"
- pjc50 7y agoThen it's not grep, it's something much slower which has to parse the syntax.
- LandR 7y agoVisual Studio with Resharper does this. It's very very fast / almost instant even with hundreds of source code files and millions of lines of code. I hit ctrl+T and then can search everything, this give me a drop down that filters out the more I type, select the item in the dropdown and it goes to that source file. I can also type: /t and search just types /m members /mm methods /u unit tests /f file /fp project /e event /mp property /mf field /ff project folder e.g. /t Foo will find all the Foos /mm SavePhoto will find any methods called SavePhoto Same works in JetBrains Rider for C# stuff. I couldn't dev without this now, and it's all built into my IDE.
- secure 7y agohttps://github.com/mvdan/gogrep https://github.com/mvdan/gogrep does something like this for Go :)
- predakanga 7y agoThere's an old project from Facebook that does something like this, called Pfff[0] It provides a tool called sgrep (syntactical grep) that lets you do some cool tricks, for instance: `sgrep "some_func(X,X)"` returns all calls to some_func with the same argument repeated. `sgrep "some_func(X,Y,...)"` returns all calls to some_func with 3 or more arguments. It's come in very handy for refactoring some troublesome codebases. [0]: https://github.com/facebookarchive/pfff https://github.com/facebookarchive/pfff