From @mhchem on April 25, 2018 9:20
With this simplified .tmLanguage file, the whole document should be formatted a comment (because I use a begin without and end).
<?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>scopeName</key>
<string>text.test</string>
<key>patterns</key>
<array>
<dict>
<key>begin</key><string>^.</string>
<key>name</key><string>comment</string>
</dict>
<dict>
<key>begin</key><string>.</string>
<key>name</key><string>invalid</string>
</dict>
</array>
</dict>
</plist>
This works fine unless the document contains the word undefined.

I guess this is a "end is undefined" issue where undefined is taken literally.
The issue can be avoided by setting end to a never-matching regexp (like <key>end</key><string>^\b$</string>). And maybe that could be put into the highlighting code: if undefined, use ^\b$ instead of the string undefined.
Copied from original issue: microsoft/vscode#48654
From @mhchem on April 25, 2018 9:20
With this simplified
.tmLanguagefile, the whole document should be formatted a comment (because I use abeginwithout andend).This works fine unless the document contains the word
undefined.I guess this is a "
endis undefined" issue whereundefinedis taken literally.The issue can be avoided by setting
endto a never-matching regexp (like<key>end</key><string>^\b$</string>). And maybe that could be put into the highlighting code: if undefined, use^\b$instead of the stringundefined.Copied from original issue: microsoft/vscode#48654