gf icon indicating copy to clipboard operation
gf copied to clipboard

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

Open gsilvapt opened this issue 5 years ago • 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?

gsilvapt avatar Jun 28 '19 10:06 gsilvapt

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.

Jab2870 avatar Jul 03 '19 14:07 Jab2870

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?

gsilvapt avatar Jul 03 '19 21:07 gsilvapt

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!

tomnomnom avatar Jul 04 '19 12:07 tomnomnom

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

gsilvapt avatar Jul 05 '19 08:07 gsilvapt