|
1 |
| -# protols |
2 |
| -[](https://crates.io/crates/protols) |
| 1 | +# Protols - Protobuf Language Server |
| 2 | + |
| 3 | +[](https://crates.io/crates/protols) |
3 | 4 | [](https://github.com/coder3101/protols/actions/workflows/ci.yml)
|
4 | 5 |
|
5 |
| -A Language Server for **proto3** files. It uses tree-sitter parser for all operations. |
| 6 | +**Protols** is an open-source Language Server Protocol (LSP) for **proto3** files, powered by the robust and efficient [tree-sitter](https://tree-sitter.github.io/tree-sitter/) parser. With Protols, you get powerful code assistance for protobuf files, including auto-completion, syntax diagnostics, and more. |
6 | 7 |
|
7 | 8 | 
|
8 | 9 |
|
9 |
| -## Features |
10 |
| -- [x] Completion (keywords, enums and messages of the package) |
11 |
| -- [x] Diagnostics - based on sytax errors |
12 |
| -- [x] Document Symbols |
13 |
| -- [x] Go to definition |
14 |
| -- [x] Hover |
15 |
| -- [x] Rename |
| 10 | +## ✨ Features |
| 11 | + |
| 12 | +- ✅ Code Completion |
| 13 | +- ✅ Diagnostics |
| 14 | +- ✅ Document Symbols |
| 15 | +- ✅ Code Formatting |
| 16 | +- ✅ Go to Definition |
| 17 | +- ✅ Hover Information |
| 18 | +- ✅ Rename Symbols |
| 19 | + |
| 20 | +## 🚀 Getting Started |
| 21 | + |
| 22 | +### Installation |
16 | 23 |
|
17 |
| -## Installation |
| 24 | +#### For Neovim |
| 25 | + |
| 26 | +To install Protols, run: |
| 27 | + |
| 28 | +```bash |
| 29 | +cargo install protols |
| 30 | +``` |
18 | 31 |
|
19 |
| -### Neovim |
20 |
| -Run `cargo install protols` to install and add below to setup using [`nvim-lspconfig`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#protols) |
| 32 | +Then, configure it with [`nvim-lspconfig`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#protols): |
21 | 33 |
|
22 | 34 | ```lua
|
23 | 35 | require'lspconfig'.protols.setup{}
|
24 |
| - |
25 | 36 | ```
|
26 | 37 |
|
27 |
| -### Visual Studio Code |
| 38 | +#### For Visual Studio Code |
| 39 | + |
| 40 | +You can use the [Protobuf Language Support](https://marketplace.visualstudio.com/items?itemName=ianandhum.protobuf-support) extension, which leverages this LSP under the hood. |
| 41 | + |
| 42 | +> **Note:** This extension is [open source](https://github.com/ianandhum/vscode-protobuf-support) but is not maintained by us. |
| 43 | +
|
| 44 | +## 🛠️ Usage |
| 45 | + |
| 46 | +### Code Completion |
| 47 | + |
| 48 | +Protols provides intelligent autocompletion for messages, enums, and proto3 keywords within the current package. |
| 49 | + |
| 50 | +### Diagnostics |
| 51 | + |
| 52 | +Diagnostics are powered by the tree-sitter parser, which catches syntax errors but does not utilize `protoc` for more advanced error reporting. |
| 53 | + |
| 54 | +### Code Formatting |
| 55 | + |
| 56 | +Formatting is enabled if [clang-format](https://clang.llvm.org/docs/ClangFormat.html) is available. You can control the [formatting style](https://clang.llvm.org/docs/ClangFormatStyleOptions.html) by placing a `.clang-format` file in the root of your workspace. Both document and range formatting are supported. |
| 57 | + |
| 58 | +### Document Symbols |
| 59 | + |
| 60 | +Provides symbols for the entire document, including nested symbols, messages, and enums. |
| 61 | + |
| 62 | +### Go to Definition |
| 63 | + |
| 64 | +Jump to the definition of any custom symbol, even across package boundaries. |
| 65 | + |
| 66 | +### Hover Information |
| 67 | + |
| 68 | +Displays comments and documentation for protobuf symbols on hover. Works seamlessly across package boundaries. |
| 69 | + |
| 70 | +### Rename Symbols |
| 71 | + |
| 72 | +Allows renaming of symbols like messages and enums, along with all their usages across packages. Currently, renaming fields within symbols is not supported directly. |
28 | 73 |
|
29 |
| -You can install an extension called [Protobuf Language Support](https://marketplace.visualstudio.com/items?itemName=ianandhum.protobuf-support) which uses this LSP under the hood. |
| 74 | +--- |
30 | 75 |
|
31 |
| -> NOTE: It is [open-sourced](https://github.com/ianandhum/vscode-protobuf-support) but do not own or maintain it. |
| 76 | +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](https://github.com/coder3101/protols) and join in on improving this tool! 🎉 |
0 commit comments