vscode-proto3

December 18, 2025 · View on GitHub

CI codecov VS Code Marketplace Installs

Protobuf 3 support for Visual Studio Code — syntax, validation, snippets, and quick compile/renumber workflows.

⚠️ Project is no longer maintained. Please consider using Protobuf VSC instead. This extension will receive no further updates and is marked as deprecated on the VS Code Marketplace. A big thank you to all users and contributors!

icon

Highlights

  • Fast syntax highlighting and validation for .proto
  • IntelliSense-style completion and snippets
  • Compile current/all protos via protoc
  • One-click renumbering for fields and enums
  • Formatting via clang-format

gif1

Commands

Open the command palette (Ctrl+Shift+P / Cmd+Shift+P) and run:

CommandDescription
proto3: Compile All ProtosCompile all workspace protos using configured protoc.options.
proto3: Compile This ProtoCompile the active proto using configured protoc.options.
proto3: Renumber Fields/Enum ValuesRenumber fields from 1 and enum values from 0 in the current scope.

Renumbering

While inside a message or enum, run proto3: Renumber Fields/Enum Values. Tags are rewritten so fields count up from 1 and enums from 0.

Snippets

prefixbody
sp2syntax = "proto2";
sp3syntax = "proto3";
pkgpackage package.name;
impimport "path/to/other/protos.proto";
ojpoption java_package = "java.package.name";
ojocoption java_outer_classname = "ClassName";
o4soption optimize_for = SPEED;
o4csoption optimize_for = CODE_SIZE;
o4lroption optimize_for = LITE_RUNTIME;
odepoption deprecated = true;
oaaoption allow_alias = true;
msgmessage MessageName {}
fbobool field_name = tag;
fi32int32 field_name = tag;
fi64int64 field_name = tag;
fu32uint32 field_name = tag;
fu64uint64 field_name = tag;
fs32sint32 field_name = tag;
fs64sint64 field_name = tag;
ff32fixed32 field_name = tag;
ff64fixed64 field_name = tag;
fsf32sfixed32 field_name = tag;
fsf64sfixed64 field_name = tag;
fflfloat field_name = tag;
fdodouble field_name = tag;
fststring field_name = tag;
fbybytes field_name = tag;
fmmap<key, val> field_name = tag;
foooneof name {}
enenum EnumName {}
svservice ServiceName {}
rpcrpc MethodName (Request) returns (Response);
svgapiGoogle API standard methods

Formatting

  • Runs clang-format if available. Configure via settings:
{
  "clang-format.style": "google",
  "clang-format.executable": "clang-format"
}

Configuration

Example .vscode/settings.json (see example/.vscode):

{
  "protoc": {
    "path": "/path/to/protoc",
    "compile_on_save": false,
    "options": [
      "--proto_path=protos/v3",
      "--proto_path=protos/v2",
      "--proto_path=${workspaceRoot}/proto",
      "--proto_path=${env.GOPATH}/src",
      "--java_out=gen/java"
    ]
  }
}
FieldTypeDefaultDescription
pathstringprotoc in PATHProtoc binary path.
compile_on_savebooleanfalseCompile current file on save.
renumber_on_savebooleanfalseRenumber fields/enums on save.
compile_all_pathstringWorkspace rootSearch path for Compile All.
use_absolute_pathbooleanfalseUse absolute paths when searching.
optionsstring[][]Protoc flags for validation/compilation.

Inline variables supported: config.*, env.*, workspaceRoot.

Development

  • Install dependencies: npm install
  • Local checks: npm run verify (lint, markdown lint, format check, tests with --forbid-only)
  • Build/package: npm run package:vsix
  • Release: push a tag v*.*.* to trigger CI packaging and GitHub release attachment (no marketplace publish)

Troubleshooting

  • spawnsync clang-format enoent: install clang-format (brew install clang-format on macOS) or update clang-format.executable.
  • Auto-complete may be limited in complex scopes; please file an issue with a minimal repro.

Contributing

See CONTRIBUTING. PRs that add tests and keep npm run verify passing are welcome.

Top contributors

Top contributors

See the full list on GitHub in the contributors graph.

Release Notes

See CHANGELOG.md.