tomnomnom/gf

Suggestion: Add JavaScript `debugger` flag to debug-pages

Opened this issue · 4 comments

If one wants to use this tool to debug a code base, it would be helpful to find the debugger flag in a JavaScript/NodeJs framework.

I know I can fork and add whatever patterns I like but I want to know if this pattern is actually useful or if it could just make the program run slower overall.

What do you think, @tomnomnom?

You could add a file called someting like debugger.json to your ~/.gf/ folder with a contents like this:

{
    "flags": "-HnraiE",
    "pattern": "^\\s*debugger;"
}

You could then use it with gf debugger

The pattern here matches the string debugger; if it is proceeded only by white space on the line.

I think my idea with this issue was to discuss whether or not exploring Node debuggers was useful. I could that, absolutely (and my config currently has a regex in the javascript files). But would it be useful?

Hey!

I think on balance adding a debugger.json pattern as @Jab2870 suggests is probably the better idea IMO. My debug-pages pattern is really about finding debug/error pages in the output of meg etc.

Thanks!

Thanks for the explanation. I added that to my fork because it might be useful to me.