Closed BaerMitUmlaut closed 8 years ago
Linguist only selects the grammar to use for highlighting. For SQF, GitHub uses JonBons/Sublime-SQF-Language. You should open an issue there if there isn't already one.
Thank you for the quick response. I assume this file is used? https://github.com/JonBons/Sublime-SQF-Language/blob/master/SQF.tmLanguage From what I can see it just contains a list of keywords, so I'm not sure how sometimes the highlighting works, and sometimes it doesn't. This package also seems to work perfectly fine in Sublime Text:
I've managed to trigger it on purpose:
// broken
if (true) then {
[] call fncDummy
} else {
[] call fncDummy
};
// working
if (true
) then {
[] call fncDummy
} else {};
// broken twice
if (true) then {} else {};
It looks like it only recognizes one keyword per line:
true
false
not true
not false
true and false
true && false
Already spotted one mistake in the grammar:
invoke|nil|not|or|pi|preprocessFile|private|private1|private2|private3|private4|private5|private6|private7|private8|private9|spawn|step|switch|then|this|throw|to|true|try|while|with|)\b</string>
Right at the very end, there:
with|)\b</string>
The stray |
is saying "Yeah, apply this rule anyway, even if nothing matches".
Okay, never mind. I spoke too soon: if I test my fix in Lightshow, the bug occurs. If I use the original grammar, nothing happens.
The hell.
Linguist only selects the grammar to use for highlighting. For SQF, GitHub uses JonBons/Sublime-SQF-Language. You should open an issue there if there isn't already one ;)
Closing this as it's an upstream issue (and not one that can be fixed in Linguist). @BaerMitUmlaut - please file an issue on the grammar repository and we'll pick up the fix automatically when it gets made upstream.
Not sure if this the correct repository to create the issue at, but we noticed some inconsistent SQF syntax highlighting today over @acemod.
For example, compare the
then
s in this file: https://github.com/alganthe/Co-ops/blob/dev_altis/functions/vehicle_handler/fn_vehiclePFH.sqf In all lines but line 53, thethen
is black while it should be red. You can notice the same behavior in the example file of the original PR that added SQF support.