bat
bat copied to clipboard
Syntax highlighting for `textproto`
bat
already digs .proto
(which is the schema language of https://protobuf.dev).
.textproto
is a file format for representation of protobuf data in text format, see https://protobuf.dev/reference/protobuf/textformat-spec/.
The goal of this issue would be to add syntax highlighting support for that format.
I dunno if e.g. https://github.com/VcamX/protobuf-syntax-highlighting could be helpful for someone interested to implement this.
Text proto is already supported, but not with the .textproto
extension:
$ bat -L | grep 'Protocol Buffer (TEXT)'
Protocol Buffer (TEXT):pb.txt,proto.text,textpb,pbtxt,prototxt
I created https://github.com/VcamX/protobuf-syntax-highlighting/pull/11 to add support for it in the underlying syntax spec.
Update: the change just got merged: https://github.com/VcamX/protobuf-syntax-highlighting/commit/1365331580b0e4bb86f74d0c599dccc87e7bdacb
@bluec0re cool, thanks! However this doesn't seem to work on v0.24.0 released on Oct 11, 2023 (after your PR above from August).
I suspected that some version may have to be bumped, but this looks like it's just pulling master
(as a sob-module), so not sure what's "missing".
$ bat --version
bat 0.24.0
$ bat -L | grep 'Protocol Buffer (TEXT)'
Protocol Buffer (TEXT):pb.txt,proto.text,textpb,pbtxt,prototxt
Hm, indeed... didn't notice as I added the textproto extension to my config file:
--map-syntax "*.textproto:Protocol Buffer (TEXT)"
But the commit needs to be bumped in this repository as well: https://github.com/sharkdp/bat/tree/master/assets/syntaxes/02_Extra/Protobuf still points to 726e21d
But the commit needs to be bumped in this repository as well: https://github.com/sharkdp/bat/tree/master/assets/syntaxes/02_Extra/Protobuf still points to 726e21d
@bluec0re #3038 should do the trick. (Or #3039.)