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

The ¦ char in T4 output breaks code-coloring #17

Open
daiplusplus opened this issue Aug 15, 2023 · 2 comments
Open

The ¦ char in T4 output breaks code-coloring #17

daiplusplus opened this issue Aug 15, 2023 · 2 comments

Comments

@daiplusplus
Copy link

daiplusplus commented Aug 15, 2023

I noticed when I type a ¦ character into the plaintext/output part of a T4 script (i.e. not in a <# block) it causes the extension to lose syntax coloring of that run of text. This also happens when reloading a T4 file with those chars in it.

In the screenshot below, observe that I have Output set to ForestGreen, which is used for most of the output text runs on the right-hand editor pane - but notice that whenever an output run has ¦ in it the editor will render the text as black-on-white and not ForestGreen-on-white.

(I use the ¦ char to denote an alignment point which is used by a tool I wrote).

image

@daiplusplus
Copy link
Author

I've identified the problem exists in Constants.cs's const string OutputBlockRegex.

I have uncovered the actual regex patterns that VS itself uses and posted it to #21 - VS uses a single pattern that matches all runs of text (and it's much simpler (and faster overall) too).

I'm thinking if it might be better to refactor this extension to use the official VS regex instead of fiddling with the current regexes - but I'll see if I can patch the current regex patterns as they are...

@Tim-Maes
Copy link
Owner

Hey daiplusplus, thank you for helping out. I might have time this weekend, or the next, to apply your feedback, and test out your suggested PR.

Very much appreciated!

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

No branches or pull requests

2 participants