Marwin
Marwin
CC#
Created by Marwin on 6/15/2023 in #help
❔ Writing VS Extension to Support Language with TextMate Grammar File
Hello, I am trying to write extension to support BNF(Backus–Naur form) metalanguage files. I am trying to add Syntax Highlight. I find this https://www.youtube.com/watch?v=ftug7sL-5kw but it doesn't seem to work for me. My best ques is that I have a something wrong in tmLanguage file. I added only comments (one line). To what I understood the name should define the style, I used just comment thinking that it will make my comments green like they are in my VS Theme. I didn't find the tmTheme definition for the defaults VS Themes if anybody found them, that might be helpfull. Here is my tmLanguage file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>bnf</string>
</array>
<key>keyEquivalent</key>
<string>^~B</string>
<key>name</key>
<string>bnf</string>
<key>patterns</key>
<array>
<dict>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>!</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>comment.line.bnf</string>
</dict>
</dict>
<key>end</key>
<string>\n</string>
<key>name</key>
<string>comment.line.bnf</string>
</dict>
</array>
</dict>
</array>
<key>scopeName</key>
<string>source.bnf</string>
<key>uuid</key>
<string>ba3fad05-08de-470a-819e-5126daaafcf4</string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>bnf</string>
</array>
<key>keyEquivalent</key>
<string>^~B</string>
<key>name</key>
<string>bnf</string>
<key>patterns</key>
<array>
<dict>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>!</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>comment.line.bnf</string>
</dict>
</dict>
<key>end</key>
<string>\n</string>
<key>name</key>
<string>comment.line.bnf</string>
</dict>
</array>
</dict>
</array>
<key>scopeName</key>
<string>source.bnf</string>
<key>uuid</key>
<string>ba3fad05-08de-470a-819e-5126daaafcf4</string>
</dict>
</plist>
3 replies