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 HighlightingRule extensible so rules aren't required to use Regex #401

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GSonofNun
Copy link

Added IHighlightingRule so developers can implement custom rules that don't use a simple regex pattern. As part of this, I had to make a simple RuleMatch type to replace the uses of System.Text.RegularExpressions.Match instances as I needed a way for a custom implmentation to still return match results.

Here's an example of a custom IHighlightingRule I needed: https://gist.github.com/GSonofNun/f5a97b24bb9d57c06c723a7bc02940a0
This rule allows me to highlight delimiter separated values, giving a color to each column of values, and even lets me change the font weight and underline of certain lines.
image

I think these changes greatly expands the scope of possibilities for HighlightingRules.

@goswinr
Copy link
Contributor

goswinr commented Mar 22, 2024

Nice! Can this be used along with xshd files ?

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

Successfully merging this pull request may close these issues.

None yet

2 participants