proto.md

Proto

Proto/proto3 (Protocol Buffers definition language) support is available natively in Zed.

Formatting

ProtoLS supports formatting if you have clang-format installed.

# MacOS:
brew install clang-format
# Ubuntu
sudo apt-get install clang-format
# Fedora
sudo dnf install clang-tools-extra

To customize your formatting preferences, create a .clang-format file, e.g.:

IndentWidth: 4
ColumnLimit: 120

Or you can have zed directly invoke clang-format by specifying it as a formatter in your settings:

  "languages": {
    "Proto": {
      "format_on_save": "on",
      "tab_size": 4,
      "formatter": {
        "external": {
          "command": "clang-format",
          "arguments": ["-style={IndentWidth: 4, ColumnLimit: 0}"]
        }
      }
    },
  }