Skip to content

Commit e7a98f3

Browse files
committed
update readme
1 parent 565a51e commit e7a98f3

File tree

1 file changed

+65
-48
lines changed

1 file changed

+65
-48
lines changed

README.md

Lines changed: 65 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,77 @@
11
# Protols - Protobuf Language Server
22

3-
[![Crates.io](https://img.shields.io/crates/v/protols.svg)](https://crates.io/crates/protols)
3+
[![Crates.io](https://img.shields.io/crates/v/protols.svg)](https://crates.io/crates/protols)
44
[![Build and Test](https://github.com/coder3101/protols/actions/workflows/ci.yml/badge.svg)](https://github.com/coder3101/protols/actions/workflows/ci.yml)
55

6-
**Protols** is an open-source Language Server Protocol (LSP) for **proto** 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+
**Protols** is an open-source, feature-rich [Language Server Protocol (LSP)](https://microsoft.github.io/language-server-protocol/) for **Protocol Buffers (proto)** files. Powered by the efficient [tree-sitter](https://tree-sitter.github.io/tree-sitter/) parser, Protols offers intelligent code assistance for protobuf development, including features like auto-completion, diagnostics, formatting, and more.
77

8-
![](./assets/protols.mov)
8+
![Protols Demo](./assets/protols.mov)
99

1010
## ✨ Features
1111

12-
- ✅ Code Completion
13-
- ✅ Diagnostics
14-
- ✅ Document Symbols
15-
- ✅ Code Formatting
16-
- ✅ Go to Definition
17-
- ✅ Hover Information
18-
- ✅ Rename Symbols
19-
- ✅ Find references
12+
-**Code Completion**: Auto-complete messages, enums, and keywords in your `.proto` files.
13+
-**Diagnostics**: Syntax errors detected with the tree-sitter parser.
14+
-**Document Symbols**: Navigate and view all symbols, including messages and enums.
15+
-**Code Formatting**: Format `.proto` files using `clang-format` for a consistent style.
16+
-**Go to Definition**: Jump to the definition of symbols like messages or enums.
17+
-**Hover Information**: Get detailed information and documentation on hover.
18+
-**Rename Symbols**: Rename protobuf symbols and propagate changes across the codebase.
19+
-**Find References**: Find where messages, enums, and fields are used throughout the codebase.
20+
21+
---
2022

2123
## Table of Contents
2224

2325
- [Installation](#installation)
26+
- [For Neovim](#for-neovim)
27+
- [For Visual Studio Code](#for-visual-studio-code)
2428
- [Configuration](#configuration)
2529
- [Basic Configuration](#basic-configuration)
2630
- [Experimental Configuration](#experimental-configuration)
2731
- [Formatter Configuration](#formatter-configuration)
32+
- [Multiple Configuration Files](#multiple-configuration-files)
2833
- [Usage](#usage)
34+
- [Code Completion](#code-completion)
35+
- [Diagnostics](#diagnostics)
36+
- [Code Formatting](#code-formatting)
37+
- [Document Symbols](#document-symbols)
38+
- [Go to Definition](#go-to-definition)
39+
- [Hover Information](#hover-information)
40+
- [Rename Symbols](#rename-symbols)
41+
- [Find References](#find-references)
2942
- [Contributing](#contributing)
43+
- [Setting Up Locally](#setting-up-locally)
3044
- [License](#license)
3145

3246
---
3347

34-
### Installation
48+
## 🚀 Installation
3549

36-
#### For Neovim
50+
### For Neovim
3751

38-
You can install [protols with mason.nvim](https://github.com/mason-org/mason-registry/blob/main/packages/protols/package.yaml) or directly from crates.io with:
52+
You can install **Protols** via [mason.nvim](https://github.com/mason-org/mason-registry/blob/main/packages/protols/package.yaml), or install it directly from [crates.io](https://crates.io/crates/protols):
3953

4054
```bash
4155
cargo install protols
4256
```
4357

44-
Then, configure it with [`nvim-lspconfig`](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#protols):
58+
Then, configure it in your `init.lua` using [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig):
4559

4660
```lua
4761
require'lspconfig'.protols.setup{}
4862
```
4963

50-
#### For Visual Studio Code
51-
52-
You can use the [Protobuf Language Support](https://marketplace.visualstudio.com/items?itemName=ianandhum.protobuf-support) extension, which leverages this LSP under the hood.
64+
### For Visual Studio Code
5365

54-
> **Note:** This extension is [open source](https://github.com/ianandhum/vscode-protobuf-support) but is not maintained by us.
55-
You can install **protols** via your preferred method, such as downloading the binary or building from source. Here’s how to get started with the simplest method:
66+
If you're using Visual Studio Code, you can install the [Protobuf Language Support](https://marketplace.visualstudio.com/items?itemName=ianandhum.protobuf-support) extension, which uses this LSP under the hood.
5667

68+
> **Note**: This extension is [open source](https://github.com/ianandhum/vscode-protobuf-support), but is not officially maintained by us.
5769
5870
---
5971

60-
## Configuration
72+
## ⚙️ Configuration
6173

62-
Protols is configured using a `protols.toml` file. This configuration file can be placed in any directory, and **protols** will look for the closest file by recursively searching through parent directories.
63-
64-
Here’s a sample configuration:
74+
Protols is configured using a `protols.toml` file, which you can place in any directory. **Protols** will search for the closest configuration file by recursively traversing the parent directories.
6575

6676
### Sample `protols.toml`
6777

@@ -83,87 +93,94 @@ clang_format_path = "/usr/bin/clang-format" # clang-format binary to execute in
8393

8494
The `[config]` section contains stable settings that should generally remain unchanged.
8595

86-
- `include_paths`: List the directories where your `.proto` files are located.
87-
- `disable_parse_diagnostics`: Set to `true` to disable parsing diagnostics.
96+
- `include_paths`: Directories to search for `.proto` files.
97+
- `disable_parse_diagnostics`: Set to `true` to disable diagnostics during parsing.
8898

8999
#### Experimental Configuration
90100

91-
The `[config.experimental]` section contains settings that are still under development or are not fully tested.
101+
The `[config.experimental]` section contains settings that are in development or not fully tested.
92102

93-
- `use_protoc_diagnostics`: If set to `true`, this will enable diagnostics from the `protoc` compiler.
103+
- `use_protoc_diagnostics`: Enable diagnostics from the `protoc` compiler when set to `true`.
94104

95105
#### Formatter Configuration
96106

97-
The `[formatter]` section configures how the formatting is done.
107+
The `[formatter]` section allows configuration for code formatting.
98108

99-
- `clang_format_path`: Path to the `clang-format` binary used for formatting `.proto` files.
109+
- `clang_format_path`: Specify the path to the `clang-format` binary.
100110

101111
### Multiple Configuration Files
102112

103-
You can use multiple `protols.toml` files across different directories, and **protols** will use the closest configuration file found by traversing the parent directories.
113+
You can place multiple `protols.toml` files across different directories. **Protols** will use the closest configuration file by searching up the directory tree.
104114

105115
---
106116

107117
## 🛠️ Usage
108118

119+
Protols offers a rich set of features to enhance your `.proto` file editing experience.
120+
109121
### Code Completion
110122

111-
Protols provides intelligent autocompletion for messages, enums, and proto3 keywords within the current package.
123+
**Protols** offers intelligent autocompletion for messages, enums, and proto3 keywords within the current package. Simply start typing, and Protols will suggest valid completions.
112124

113125
### Diagnostics
114126

115-
Diagnostics are powered by the tree-sitter parser, which catches syntax errors but does not utilize `protoc` for more advanced error reporting.
127+
Syntax errors are caught by the tree-sitter parser, which highlights issues directly in your editor. For more advanced error reporting, the LSP can be configured to use `protoc` diagnostics.
116128

117129
### Code Formatting
118130

119-
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.
131+
Format your `.proto` files using `clang-format`. To customize the formatting style, add a `.clang-format` file to the root of your project. Both document and range formatting are supported.
120132

121133
### Document Symbols
122134

123-
Provides symbols for the entire document, including nested symbols, messages, and enums.
135+
Protols provides a list of symbols in the current document, including nested symbols such as messages and enums. This allows for easy navigation and reference.
124136

125137
### Go to Definition
126138

127-
Jump to the definition of any custom symbol, even across package boundaries.
139+
Jump directly to the definition of any custom symbol, including those in other files or packages. This feature works across package boundaries.
128140

129141
### Hover Information
130142

131-
Displays comments and documentation for protobuf symbols on hover. Works seamlessly across package boundaries.
143+
Hover over any symbol to get detailed documentation and comments associated with it. This works seamlessly across different packages and namespaces.
132144

133145
### Rename Symbols
134146

135-
Allows renaming of symbols like messages and enums, along with all their usages across packages. Currently, renaming fields within symbols is not supported directly.
147+
Rename symbols like messages or enums, and Propagate the changes throughout the codebase. Currently, field renaming within symbols is not supported.
136148

137149
### Find References
138150

139-
Allows user defined types like messages and enums can be checked for references. Nested fields are completely supported.
151+
Find all references to user-defined types like messages or enums. Nested fields are fully supported, making it easier to track symbol usage across your project.
140152

141153
---
142154

143-
## Contributing
155+
## 🤝 Contributing
144156

145-
We welcome contributions from the community! If you’d like to help improve **protols**, here’s how you can get started:
157+
We welcome contributions from developers of all experience levels! To get started:
146158

147-
1. Fork the repository and clone it to your machine.
148-
2. Make your changes in a new branch.
149-
3. Run the tests to ensure everything works properly.
150-
4. Open a pull request with a description of the changes.
159+
1. **Fork** the repository and clone it to your local machine.
160+
2. Create a **new branch** for your feature or fix.
161+
3. Run the tests to ensure everything works as expected.
162+
4. **Open a pull request** with a detailed description of your changes.
151163

152164
### Setting Up Locally
153165

154166
1. Clone the repository:
167+
155168
```bash
156169
git clone https://github.com/coder3101/protols.git
157170
cd protols
158171
```
159172

160-
2. Build and test your changes:
173+
2. Build and test the project:
174+
161175
```bash
162176
cargo build
163177
cargo test
164178
```
179+
165180
---
166181

167-
## License
182+
## 📄 License
168183

169-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
184+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.
185+
186+
---

0 commit comments

Comments
 (0)