Textproto
Support for Protocol Buffers text format (.textproto, .txtpb, .textpb, .pbtxt)
How to install
With Forge Super installed, the button above opens the app on this extension, where you press Install. Nothing is installed until you do.
You can also open the Extensions panel in the app and search for Textproto. The extension's id is textproto.
Don't have Forge Super yet? Download it here.
README
From the extension's repository, written by its authors and not by Mentenaz. See the source.
Zed Textproto Extension
Language support for Protocol Buffers text format (textproto) in the Zed editor.
Features
- Syntax highlighting for
.textproto,.txtpb,.textpb, and.pbtxtfiles - Bracket matching for
{},<>, and[]pairs - Auto-indentation for nested messages
- Code outline navigation for fields
- Comment support (
#style line comments)
Installation
From Zed Extensions (Coming Soon)
Once published, you'll be able to install directly from Zed:
- Open Zed
- Go to Extensions (cmd+shift+x / ctrl+shift+x)
- Search for "Textproto"
- Click Install
Development Installation
To install the development version:
-
Clone this repository:
git clone https://github.com/mikn/zed-textproto.git cd zed-textproto -
Build the extension:
cargo build --release -
In Zed, open the command palette (cmd+shift+p / ctrl+shift+p)
-
Run "zed: install dev extension"
-
Select the cloned repository directory
Supported Syntax
The extension supports all Protocol Buffers text format features:
- Field assignments:
name: "value" - Nested messages:
field { nested: "value" }orfield < nested: "value" > - Repeated fields:
values: [1, 2, 3] - Comments:
# This is a comment - Numbers: Decimal, hexadecimal (
0xFF), octal (0755), floating point - Strings: With escape sequences
- Extension fields:
[com.example.extension]: "value" - Any type fields:
[type.googleapis.com/package.Type] { ... }
Example
# Example configuration
name: "MyService"
timeout_seconds: 30
server_config {
host: "localhost"
port: 8080
features: ["auth", "logging", "metrics"]
}
[com.example.custom_option]: true
Development
Requirements
Building from Source
# Clone the repository
git clone https://github.com/mikn/zed-textproto.git
cd zed-textproto
# Build the extension
cargo build --release
Project Structure
zed-textproto/
├── extension.toml # Extension manifest
├── Cargo.toml # Rust dependencies
├── src/
│ └── lib.rs # Extension implementation
└── languages/
└── textproto/
├── config.toml # Language configuration
├── highlights.scm # Syntax highlighting queries
├── brackets.scm # Bracket matching rules
├── indents.scm # Indentation rules
└── outline.scm # Symbol outline queries
Grammar
This extension uses the tree-sitter-textproto grammar for parsing.
License
MIT License - see LICENSE file for details
Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
Acknowledgments
- Tree-sitter grammar by PorterAtGoogle
- Protocol Buffers text format specification