UPDATE 221119As mentioned in the initial post, the "meat" of the language extension is found in this file:
C:\Users\[your user account]\.vscode\extensions\WBT\syntaxes\wbt.tmLanguage.json
That's where you'll find each keyword / operator / etc itemized and colorized.
Here's the skinny.
The WinBatch IDE editor primarily uses five colors that I've been able to identify:
* WB Operators - (if/else/GoSub/Return/IntControl) ----- PURPLE
* WB Functions - (winExist, timeYmdHms, isDefined) ---- LAPIS-LAZULI BLUE
* Comments - (no description required just space) ------ FOREST GREEN
* Strings - (anything between sing/double quotes) ------ TOMATO RED (red)
* Extender Funcs - (additional funcs added by ext) ------ BRIGHT PURPLY-PINK
I've been able to identify six unique colors I can use in VSCode lang extensions:
* keyword.control.wbt --------- purple (similar to WB)
* keyword.other.wbt ----------- lapis-lazuli blue (similar to WB)
* variable.other.wbt ------------ lighter, brighter, cyan-ish blue
* entity.name.function.wbt ---- pale yellow
* support.type.wbt ------------- emerald green
* string.quoted.single.wbt ----- tangerine orange (more orange than the WB strings color)
* string.quoted.double.wbt ---- tangerine orange (more orange than the WB strings color)
* unidentified but works - COMMENTS are forest green, quite similar to WB
I have not found where these colors are actually defined -- I suspect they are defined within the theme you are currently using.
Here is a potential SO article re modifying theme colors:
https://stackoverflow.com/questions/63455950/how-can-i-find-the-folder-of-the-theme-im-using-in-vs-codeNOTE: I am currently using the "Dark+ (default dark)" theme
In the wbt.tmLanguage.json file:
1. The section containing an array of objects called "patterns" is a list of all the color definitions that will be INCLUDEd from those following below.
2. Next after "patterns" is "repository" - this contains each of the included color definitions itemized above
3. The "key" (operators/commands/keywords/special/etc) should be included in the initial "patterns" list (number (1) above)
4. Each color definition (operators / commands / keywords / special / etc) has a "name" and a "match" string
5. The "name" references the set of color definitions that will colorize these keywords (I don't yet know where they are defined, probably in the current Theme)
6. The "match" string contains the commands that will be colorized with that color
Notes:
a. You can swap the colors of different pattern definitions by swapping their names. For example, if you want the WinBatch included functions to be purple instead of blue, change the "keywords" pattern from keyword.other.wbt to keyword.control.wbt.
b. To create a new color group and move some commands into that new color group:
- Duplicate (for example) the "operators" def group
- Paste it into that list and rename the key (e.g. "summatnew" instead of "operators")
- Change the name to one of the unique color defs not yet used, for e.g. [ variable.other.wbt ]
- Update the commands in the 'match" line (between the (parentheses)
- Ensure to remove those commands from the other match lines where they were previously defined
- SAVE the wbt.tmLanguage.json file
- QUIT VSCODE and restart it
True VSCode happiness will be yours.
Final Notes:
* I suspect the reason the previous version "broke" (stopped working, at least for me) is because it was using [ keyword.control.wbt ] for the "operators" pattern/group. Probably that "name" is not defined in the Dark+ theme, and when I switched to that theme the if/else/gosub/etc operators stopped being colorized.
Just a guess based on what I now understand about how the tmLanguage.json file works.*** Attached is the latest/greatest wbt.zip file (identical to the one now available in the first post). Installation instruction are in the first post in this thread. ***