go goland idea 开发工具如何格式化 proto 代码
目录
背景
在使用 grpc 开发时, proto 文件如何像 go 文件一样有 go fmt 统一进行格式化呢?
安装clang-format
-
windows
-
mac
brew install clang-format
Which clang-format
goland 配置
设置—Tools—File Watchers—新增

-style="{editor.defaultFormatter: zxh404.vscode-proto3}"
-i
$FilePath$
保存Goland配置并重启Goland,proto文件发生修改则可立即被格式化