All Projects → zxh0 → Vscode Proto3

zxh0 / Vscode Proto3

Licence: mit
vscode extension for proto3

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Vscode Proto3

Vscode Markdown
Markdown All in One
Stars: ✭ 2,113 (+1135.67%)
Mutual labels:  vscode
Vscode Kotlin
Kotlin language support for VS Code
Stars: ✭ 161 (-5.85%)
Mutual labels:  vscode
Rocketseat Vscode React Native Snippets
Rocketseat React Native snippets for Visual Studio Code Editor
Stars: ✭ 166 (-2.92%)
Mutual labels:  vscode
Serialize
Stars: ✭ 159 (-7.02%)
Mutual labels:  protobuf
Vscode Commitizen
Visual Studio Code Commitizen Support
Stars: ✭ 159 (-7.02%)
Mutual labels:  vscode
Vscode Remote Release
Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
Stars: ✭ 2,256 (+1219.3%)
Mutual labels:  vscode
Blackboxprotobuf
Blackbox protobuf is a Burp Suite extension for decoding and modifying arbitrary protobuf messages without the protobuf type definition.
Stars: ✭ 155 (-9.36%)
Mutual labels:  protobuf
Nim
Streamline Your Node.js Debugging Workflow with Chromium (Chrome, Edge, More) DevTools.
Stars: ✭ 168 (-1.75%)
Mutual labels:  vscode
Vscode Auto Rename Tag
Automatically rename paired HTML/XML tag
Stars: ✭ 161 (-5.85%)
Mutual labels:  vscode
Sbt Protobuf
sbt plugin for compiling protobuf files
Stars: ✭ 163 (-4.68%)
Mutual labels:  protobuf
Vala Language Server
Code Intelligence for Vala & Genie
Stars: ✭ 156 (-8.77%)
Mutual labels:  vscode
Dance
Make your cursors dance with Kakoune-like keybindings for VS Code.
Stars: ✭ 157 (-8.19%)
Mutual labels:  vscode
Vscode
Connect to MongoDB and Atlas and directly from your VS Code environment, navigate your databases and collections, inspect your schema and use playgrounds to prototype queries and aggregations.
Stars: ✭ 161 (-5.85%)
Mutual labels:  vscode
Kratos
A modular-designed and easy-to-use microservices framework in Go.
Stars: ✭ 15,844 (+9165.5%)
Mutual labels:  protobuf
Sublimetext Sqltools
SQLTools for Sublime Text 3
Stars: ✭ 166 (-2.92%)
Mutual labels:  vscode
Gayrpc
Full Duplex C++ RPC Library,Use Protobuf, Support HTTP API .
Stars: ✭ 157 (-8.19%)
Mutual labels:  protobuf
Xresloader
跨平台Excel导表工具(Excel=>protobuf/msgpack/lua/javascript/json/xml)
Stars: ✭ 161 (-5.85%)
Mutual labels:  protobuf
Vscode Twitch Highlighter
This is a VS Code extension that will allow your Twitch chat to highlight a line of code via a command message. Example: `!line 8 server.js`. See master branch README.md for more details
Stars: ✭ 169 (-1.17%)
Mutual labels:  vscode
Flutter Grpc Tutorial
[Tutorial] Asynchronous Flutter chat client with Go chat server which are powered by gRPC (simple and streaming)
Stars: ✭ 167 (-2.34%)
Mutual labels:  protobuf
Elm Language Client Vscode
Improving your Elm experience since 2019
Stars: ✭ 162 (-5.26%)
Mutual labels:  vscode

vscode-proto3

icon

Protobuf 3 support for Visual Studio Code

https://github.com/zxh0/vscode-proto3

VSCode Commands

By default ctrl-shift-p opens the command prompt.

Command Description
proto3: Compile All Protos Compiles all workspace protos using configurations defined with protoc.options.
proto3: Compile This Proto Compiles the active proto using configurations defined with protoc.options.

Features

  • syntax highlighting.
  • syntax validation.
  • code snippets.
  • code completion.
  • code formatting.
  • brace matching.
  • line and block commenting.
  • compilation.

gif1

Syntax Highlighting

The grammar is written in tmLanguage JSON format.

Syntax Validation

The validation is triggered when you save the proto file. You need protoc compiler to enable syntax validation. You also need a settings.json file to tell the extension the full path of protoc if it is not in path.

Extension Settings

Below is an example settings.json file which comes from 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"
        ]
    }
}

Fields

The possible fields under the protoc extension settings which can be defined in a settings.json file.

Field Type Default Description
path string protoc in PATH Path to protoc. Defaults to protoc in PATH if omitted.
compile_on_save boolean false On .proto file save, compiles to --*_out location within options
compile_all_path string Workspace Root Search Path for Compile All Protos action. Defaults to the Workspace Root
options string[] [] protoc compiler arguments/flags, required for proto validation and compilation

In-Line Variables

These variables can be used to inject variables strings within the protoc extension configurations. See above for examples.

Variable Description
config.* Refer settings items in Preferences.
env.* Refer environment variable.
workspaceRoot Returns current workspace root path.

Code Completion

A very simple parser is written to support code completion.

Code Snippets

prefix body
sp2 syntax = "proto2";
sp3 syntax = "proto3";
pkg package package.name;
imp import "path/to/other/protos.proto";
ojp option java_package = "java.package.name";
ojoc option java_outer_classname = "ClassName";
o4s option optimize_for = SPEED;
o4cs option optimize_for = CODE_SIZE;
o4lr option optimize_for = LITE_RUNTIME;
odep option deprecated = true;
oaa option allow_alias = true;
msg message MessageName {}
fbo bool field_name = tag;
fi32 int32 field_name = tag;
fi64 int64 field_name = tag;
fu32 uint32 field_name = tag;
fu64 uint64 field_name = tag;
fs32 sint32 field_name = tag;
fs64 sint64 field_name = tag;
ff32 fixed32 field_name = tag;
ff64 fixed64 field_name = tag;
fsf32 sfixed32 field_name = tag;
fsf64 sfixed64 field_name = tag;
ffl float field_name = tag;
fdo double field_name = tag;
fst string field_name = tag;
fby bytes field_name = tag;
fm map<key, val> field_name = tag;
foo oneof name {}
en enum EnumName {}
sv service ServiceName {}
rpc rpc MethodName (Request) returns (Response);

Google API Design Guide

The following snippets are based on Google API Design Guide.

prefix reference
svgapi Standard Methods

Code Formatting

Support "Format Document" if clang-format is in path, including custom style options.

By default, clang-format's standard coding style will be used for formatting. To define a custom style or use a supported preset add "clang-format.style" in VSCode Settings (settings.json)

Example usage:

"clang-format.style": "google"

This is the equivalent of executing clang-format -style=google from the shell.

With multiple formatting options

"clang-format.style": "{ IndentWidth: 4, BasedOnStyle: google, AlignConsecutiveAssignments: true }"

For further formatting options refer to the official clang-format documentation

Known Issues

Auto-completion not works in some situations.

Some users consistently see an error like spawnsync clang-format enoent when they save. This happens when the "formatOnSave"-setting is enabled in VSCode and "clang-format" cannot be found. To fix this:

On MacOS

  1. Install clang-format on your system: brew install clang-format
  2. Install the clang-format plugin in VSCode

Release Notes

See CHANGELOG.md.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].