Language Server for protocol buffers
Find a file
Ashar c36b05bf1a
feat: add doc and range formatting if clang-format is available (#27)
- [x] Update README
- [x] Tag and release v0.6.0
- [x] Format temporary file not original file
2024-09-01 15:34:40 +05:30
.github Create FUNDING.yml 2024-08-17 16:11:13 +05:30
assets docs: Improve README to include a video and fix text (#7) 2024-06-22 20:38:20 +05:30
sample feat: add doc and range formatting if clang-format is available (#27) 2024-09-01 15:34:40 +05:30
src feat: add doc and range formatting if clang-format is available (#27) 2024-09-01 15:34:40 +05:30
.clang-format feat: add doc and range formatting if clang-format is available (#27) 2024-09-01 15:34:40 +05:30
.gitignore feat: Add support for go to definition and hover and diagnostics on single file (#2) 2024-06-16 23:30:29 +05:30
Cargo.lock feat: add doc and range formatting if clang-format is available (#27) 2024-09-01 15:34:40 +05:30
Cargo.toml feat: add doc and range formatting if clang-format is available (#27) 2024-09-01 15:34:40 +05:30
LICENSE Initial commit 2024-06-10 10:11:37 +05:30
README.md feat: add doc and range formatting if clang-format is available (#27) 2024-09-01 15:34:40 +05:30

Protols - Protobuf Language Server

Crates.io Build and Test

Protols is an open-source Language Server Protocol (LSP) for proto3 files, powered by the robust and efficient tree-sitter parser. With Protols, you get powerful code assistance for protobuf files, including auto-completion, syntax diagnostics, and more.

Features

  • Code Completion
  • Diagnostics
  • Document Symbols
  • Code Formatting
  • Go to Definition
  • Hover Information
  • Rename Symbols

🚀 Getting Started

Installation

For Neovim

To install Protols, run:

cargo install protols

Then, configure it with nvim-lspconfig:

require'lspconfig'.protols.setup{}

For Visual Studio Code

You can use the Protobuf Language Support extension, which leverages this LSP under the hood.

Note: This extension is open source but is not maintained by us.

🛠️ Usage

Code Completion

Protols provides intelligent autocompletion for messages, enums, and proto3 keywords within the current package.

Diagnostics

Diagnostics are powered by the tree-sitter parser, which catches syntax errors but does not utilize protoc for more advanced error reporting.

Code Formatting

Formatting is enabled if clang-format is available. You can control the formatting style by placing a .clang-format file in the root of your workspace. Both document and range formatting are supported.

Document Symbols

Provides symbols for the entire document, including nested symbols, messages, and enums.

Go to Definition

Jump to the definition of any custom symbol, even across package boundaries.

Hover Information

Displays comments and documentation for protobuf symbols on hover. Works seamlessly across package boundaries.

Rename Symbols

Allows renaming of symbols like messages and enums, along with all their usages across packages. Currently, renaming fields within symbols is not supported directly.


Protols is designed to supercharge your workflow with proto3 files. We welcome contributions and feedback from the community! Feel free to check out the repository and join in on improving this tool! 🎉