News for hackers. Stuff that matters.
Re:Ripgrep 11 Released by xrouge on Monday April 22, 2019 @08:50PM (#19724624)
Is there a way to output the results in Visual Studio format, which is <filename>(<line number>)<result>? This way when I hook up ripgrep as an External Tool, the line shown in the Output window can be clicked on to open the file and go to the specific line. I see in the source code that the separator is ":"; VS expects () around the line number.
Re:Ripgrep 11 Released by burntsushi on Tuesday April 23, 2019 @09:44AM (#19728474)
Not natively, no. You could probably write a simple script that transforms the output into what you want though. For example, on Unix at least,

    rg -n pattern | sed 's/:/(/' | sed 's/:/)/'
That won't work in every case (e.g., in the case of a file path containining a `:`), but it might get you pretty far. And it could probably be made more precise.

Otherwise, you could always use ripgrep's --json output mode to craft its output into whatever format you like, but that's probably more work. :-) The JSON format is documented here: https://docs.rs/grep-printer/0.1.2/grep_printer/struct.JSON....