Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Es-search: Search ECMAScript structurally (github.com/jdonaghue)
24 points by davezatch on April 19, 2016 | hide | past | favorite | 7 comments


This is pretty neat - does it actually support unknown identifier search though?

Like, I can see "if:a===b" as an example, but what if you don't know the variable names? Like "if:<ident>===b" or something?


you can, 'if:?===b'.


you can also search for partial expressions like so 'if:*?===b' will match on any if statement that contains a condition matching '?===b' where '?' is a wildcard


There's also http://www.graspjs.com which also uses acorn.


This is very nice. I wonder if this could not be used as a base to build a code refactoring tool too! Refactoring is often just find and replace with a complex find expression.


Cool. A vim plugin and typescript type annotation support and I'd totally use it.


What is this? I read: "Using a special syntax like CSS" and then saw: "if:<10%%(..." I gotta admit, it looks like it's just JavaScript, but harder to read. How does it make finding code easier?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: