Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New CLI --field-{context,match}-separator-{prefix,postfix} flags #2464

Closed
vorburger opened this issue Mar 19, 2023 · 2 comments
Closed

New CLI --field-{context,match}-separator-{prefix,postfix} flags #2464

vorburger opened this issue Mar 19, 2023 · 2 comments
Labels
wontfix A feature or bug that is unlikely to be implemented or fixed.

Comments

@vorburger
Copy link

Following up on #1842, it could be great and very useful if, in addition to the current flags introduced in #1871:

--field-match-separator
--field-context-separator

there were, in addition, also:

--field-match-separator-postfix
--field-match-separator-prefix
--field-context-separator-prefix
--field-context-separator-postfix

This would help when invoking ripgrep in an IDE, such as Visual Studio Code (VSC), to allow clicking on links detected in terminals. This is because with the defaulf of rg default, e.g.:

.bazelrc:4:common --enable_bzlmod

link detection does not work. Using --field-match-separator=": " or --field-match-separator=" :" isn't right and doesn't work either.

What one would ideally want is (something like): --field-match-separator-prefix=":" --field-match-separator-postfix=" " so that it would print:

.bazelrc:4 common --enable_bzlmod

PS: I guess one could work around this either by post-processing rg output, or perhaps with a custom problem matcher in VSC, but the flags would be neat.

@BurntSushi
Copy link
Owner

This looks like a duplicate of #665 to me. You're suggesting a different approach here, but the high level problem you're trying to solve appears to be same.

IMO, VS Code should adapt to the format. It's standard grep format. VS Code should understand that. Many other editors already do.

@BurntSushi
Copy link
Owner

Hyperlinks will be available as an opt-in feature in ripgrep 14. Given that your ultimate goal here is the ability to click on things and that's better solved by hyperlinks, I'm going to close this.

I probably would wind up closing this anyway as I'm not keen on just adding to a never-ending list of output control functions. This feature request is proposing four new flags that are, to a first approximation, never going to be used. Not worth it.

@BurntSushi BurntSushi closed this as not planned Won't fix, can't repro, duplicate, stale Oct 19, 2023
@BurntSushi BurntSushi added the wontfix A feature or bug that is unlikely to be implemented or fixed. label Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix A feature or bug that is unlikely to be implemented or fixed.
Projects
None yet
Development

No branches or pull requests

2 participants