Search code examples
protocol-buffers

how to make both vscode and JetBrains have the same protobuf formatter


Our project team members are using both vscode and JetBrains editors. All of us are writing protobuf files, but there's a difference in formatters between vscode and JetBrains.

We want to standardize the formatting rules to match JetBrains' conventions. In vscode, we are using the vscode-proto3 extension along with the clang-format plugin.

We are unsure about the settings in JetBrains, and we need guidance on how to achieve this.


Solution

  • I wrote as below.

    vscode/.settings.json

    { "clang-format.style": "{ BasedOnStyle: Google, ColumnLimit: 0 }" }

    and then it became the same format.

    this solved it.