ziglang/sublime-zig-language

weird syntax coloring on github

andrewrk opened this issue · 8 comments

ziglang/zig#3129 (comment)

any idea what's going on here? it looks like too much stuff is red.
Screenshot_2019-08-27_16-54-26

@giann recently had a similar issue in sublime.

giann commented

Yes I have the exact same issue on some files.

can you send me links/copies of these files, so they can be added as test cases to stop future regressions?

giann commented

Actually it seems ⌘+/ (comment selection) doesn't work with the new syntax?

the analogue for windows beingctrl+/? this seems to work fine on the machines i have tested it on.

I'm not sure if the changes have rolled out on github yet, but here's another example:

https://github.com/ziglang/zig/blob/f7f3dedb1de405e0123c93a4a9e54503e02942ee/lib/std/io.zig#L1025

Screenshot_2019-10-15_15-03-39

no, the last update was August 29. here's what that would look like now: zig_snip
because types are first class values (at compile time) there are going to be some issues regarding type highlighting, because it's not possible to distinguish between a type and and regular identifiers.

because types are first class values (at compile time) there are going to be some issues regarding type highlighting, because it's not possible to distinguish between a type and and regular identifiers.

Makes sense. If you wanted to do such coloring, it might make sense to do it based on whether the first letter is capitalized or not, but also having types and regular identifiers be the same color is perfectly reasonable. Especially when you consider that it's possible for the same variable to be a type or not-a-type, for example when doing an inline for loop over var args.