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

Make regex detection configurable by Language Mode #59

Open
MarttiR opened this issue Jan 10, 2023 · 0 comments
Open

Make regex detection configurable by Language Mode #59

MarttiR opened this issue Jan 10, 2023 · 0 comments

Comments

@MarttiR
Copy link

MarttiR commented Jan 10, 2023

There are a lot of requests for supporting new file types.

One way to do that would be to make vscode-regex configuration overrideable by Language Mode.

For example, for bash, one could add detection for common sed and grep patterns, the first capturing group containing the regex:

"[shellscript]": {
  "vscode-regex.enable": true,
  "vscode-regex.detectionPatterns": [
    "sed.*?\"s/(.*?)/",
    "sed.*?\"s#(.*?)#",
    "grep.*?\"(.*?)\"",
  ],
},

Such configuration properties can be created by setting the scope property to language-overridable.

This would enable users themselves to add support for whatever they need.

Consider also supporting a specifically named capturing group inside a detectionPattern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants