当前位置:   article > 正文

Protobuf(二):IDEA + maven + protobuf配置(on mac)_mac idea protobuf-maven-plugin

mac idea protobuf-maven-plugin

1. 絮絮叨叨

  • 都说懒惰是人类进步的源泉,有时候想想还真就那么回事
  • 学习了如何使用protoc命令编译,重度依赖IDEA且已经习惯了maven的我,就在想是否能在IDEA中一键编译.proto文件

2. vscode配置protobuf编辑环境

  • 由于自己习惯了使用vscode做文本阅读,因此通过protoc命令编译的.proto文件,最开始都是通过vscode查看
  • 使用vscode查看的过程中,发现没有预发高亮,简单的内容修改,也没有语法提示
  • 因此,自己首先想为vscode配置protobuf编辑环境

2.1 安装相关插件

2.2 The ‘clang-format’ command is not available问题的解决

  • 如果提示The 'clang-format' command is not available,具体报错信息如下:

    The 'clang-format' command is not available. Please check your clang-format.executable user setting and ensure it is installed.
    
    • 1
  • 自己检查发现又发现Clang-Format已经成功安装,这时需要通过命令进行安装:

    brew install clang-format
    
    • 1
  • 找了很多方法,目前就这个办法亲测ok。感谢博客:Golang 集成 Protobuf 及 vscode 配置

3. IDEA配置protobuf编辑环境

  • 插件配置,主要是为了能实现protobuf的语法高亮、代码提示
  • idea配置protobuf,好多博客都推荐Protobuf Support
  • 自己的idea不知道什么时候,已经安装上了gRPC及其依赖Protocol Buffers,撰写proto文件时会有代码提示和语法高亮
  • 就凑合这样使用吧 声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:【wpsshop博客】
推荐阅读
相关标签