zls
zls copied to clipboard
Not handling UTF-8 BOM
I've got some autogenerated Zig files that contain a UTF-8 BOM. The BOM for UTF-8 is 0xef 0xbb 0xbf (see https://en.wikipedia.org/wiki/Byte_order_mark#UTF-8). It looks like this confuses ZLS because the syntax highlighting on these files is all messed up. ZLS can address this by detecting and ignoring the BOM.
Thanks for reporting, I will implement this soon.
FYI, here's the code in the Zig compiler that handles the BOM (it's just one line of code): https://github.com/ziglang/zig/blob/fb37c1b0912c65d72b82f32df8bc7e780ab1ad80/lib/std/zig/tokenizer.zig#L342