thejustinwalsh / textproto-grammar

Syntax Highlighting for the Protocol Buffer Text Format
https://marketplace.visualstudio.com/items?itemName=thejustinwalsh.textproto-grammer
MIT License
14 stars 2 forks source link

feature: add heredocs syntax and clean up syntax #3

Closed marcusrbrown closed 3 years ago

marcusrbrown commented 3 years ago

The "heredocs":

someField: <<END
This is a multi-line string
END

Based this off of multiline.go thanks to a tip from @thejustinwalsh.

I added explicit fold markers as they may be useful by other tools/editors that want to consume this syntax. The indentationRules gives the nice "dedent" to close a { or [ brace.

Finally, I cleaned up a few of the patterns and made things a bit more consistent. I'm going to raise another PR that brings the syntax a closer to the structure of UnmarshalText.