Open PiotrSokol opened 6 months ago
Hi, I just came across this project and I love it!
The idea to use vscode regexp can potentially save a lot of time while writing complicated queries for rg.
My example use case is querying '^\h*\\begin\{$2[\w\*]*?\}\s*(?:\\label\{([^\}])\}|\[(.*)\])', where $2 is transformed according to
'^\h*\\begin\{$2[\w\*]*?\}\s*(?:\\label\{([^\}])\}|\[(.*)\])'
"periscope.rgQueryParams": [ { "regex": "((?<=(?<![\\w\\#\\@]))@([a-zA-Z]+(?:\\\\*)?)(?=(?:$|\\s)))", "param": "-e '^\\h*\\\\begin\\{$2[\\w\\*]*?\\}\\s*(?:\\\\label\\{([^\\}])\\}|\\[(.*)\\])'" } ]
I clumsily implemented this-- I pass the query as and additional flag -e .... If you're interested I can make a PR and discuss the specifics.
-e ...
Hey @PiotrSokol
If you think there is value for others then feel free to raise a PR.
I'm always curious to understand how periscope is being used. :) glad you like it 👍
Hi, I just came across this project and I love it!
The idea to use vscode regexp can potentially save a lot of time while writing complicated queries for rg.
My example use case is querying
'^\h*\\begin\{$2[\w\*]*?\}\s*(?:\\label\{([^\}])\}|\[(.*)\])'
, where $2 is transformed according toI clumsily implemented this-- I pass the query as and additional flag
-e ...
. If you're interested I can make a PR and discuss the specifics.