Add support for Batch highlighting#879
Draft
chorgard wants to merge 3 commits into
Draft
Conversation
Author
|
Please fix the command highlighting first, if you do edit. As you could probably tell, I had a very difficult time using |
Author
@microsoft-github-policy-service agree |
Make figure out the `?i:` situation and boil down the variable regex, and in doing so, reformat the document.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WIP - Only in draft mode currently
Summary
Adds initial Batch syntax highlighting support (definition at
crates/lsh/definitions/batch.lsh) and more content under the batch sample file atassets/highlighting-tests/batch.bat. The syntax highlighting now applies to *.bat, *.cmd, and *.btm.Support for Batch syntax highlighting was also implemented into markdown, adding code to
crates/lsh/definitions/markdown.Ishand adding a simple demonstration of this inassets/highlighting-tests/markdown.mdScreenshot
These results can be reproduced with
cargo build&target\debug\edit.exe assets\highlighting-tests\batch.batorcargo run -p lsh-bin -- render --input ./assets/highlighting-tests/batch.bat ./crates/lsh/definitions/(This one not shown in screenshot).Tested on a Windows 11 Pro machine.
Scope
No dependencies were added; the highlighter only uses the preexisting LSH engine.
The highlighting covers many common Batch features, such as (not limited to):
Edit 6/18/26 Pt 1:
helpcommand (my source for all of the commands included) that were in capital characters (I sorted through the help command's output for words in all CAPS to get the commands).Edit 6/18/26 Pt 2:
?i:, effectively halving the associated code.P.S.: This is my first true PR ever! Edit as you need, but please provide constructive criticism; I need it!