背景
在使用 grpc 开发时, proto 文件如何像 go 文件一样有 go fmt 统一进行格式化呢?
安装clang-format
-
windows
-
mac
brew install clang-format
Which clang-format
goland 配置
设置---Tools---File Watchers---新增
22.png
-style="{editor.defaultFormatter: zxh404.vscode-proto3}"
-i
$FilePath$
保存Goland配置并重启Goland,proto文件发生修改则可立即被格式化
原文地址