Sublime-Text-2 plugin that allows auto-formatting of Protocol Buffer Code on save.
ProtoBufCodeFormatter
is available via Package Control and can be found as ProtoBufCodeFormatter
.
*Important this plugin uses the GOPATH
, please set it in Settings - User
.
- Golang v1.0 or higher
- Correctly set
PROTOPATH
,GOROOT
andGOBIN
in theSettings - User
.
Open Settings - User
under Preferences/Package Settings
and edit to contain the correct path information. Add variable GOBIN
and enter the location of your Go Binary. Add variable PROTOPATH
and enter any locations of Protocol Buffers that are imported by your protocol buffers. Optionally add a GOROOT
variable to show the location of your Go workspace. Look at Settings - Default
as an example.
-
Formatter cannot preserve order of structures. The order is pre-determined.
-
For comments, outer `extend' groups are logically grouped together, so inner comments are lost.
-
Style of comments are not preserved (/* */ vs. //), so both single-line and multi-line comments are shown with
//
.