You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://github.com/coder3101/protols/actions/workflows/ci.yml)
5
5
6
-
**WARNING** : Master branch is undergoing a massive refactoring, please use last relesed tag instead.
7
-
8
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.
9
7
10
-

11
-
12
8
## ✨ Features
13
9
14
10
- ✅ **Code Completion**: Auto-complete messages, enums, and keywords in your `.proto` files.
15
-
- ✅ **Diagnostics**: Syntax errors and import error detected with the tree-sitter parser.
11
+
- ✅ **Diagnostics**: Syntax errors, import error detected with the tree-sitter and advanced diagnostics from `protoc` parser.
16
12
- ✅ **Document Symbols**: Navigate and view all symbols, including messages and enums.
17
13
- ✅ **Code Formatting**: Format `.proto` files using `clang-format` for a consistent style.
18
14
- ✅ **Go to Definition**: Jump to the definition of symbols like messages or enums and imports.
@@ -29,9 +25,7 @@
29
25
-[For Visual Studio Code](#for-visual-studio-code)
@@ -78,16 +72,12 @@ Protols is configured using a `protols.toml` file, which you can place in any di
78
72
### Sample `protols.toml`
79
73
80
74
```toml
81
-
[config]# Base configuration; these are considered stable and should not change
75
+
[config]
82
76
include_paths = ["foobar", "bazbaaz"] # Include paths to look for protofiles during parsing
83
-
disable_parse_diagnostics = true# Disable diagnostics for parsing
84
-
85
-
[config.experimental] # experimental configuration; this should be considered unsafe and not fully tested
86
-
use_protoc_diagnostics = true# use diagnostics from protoc
87
-
protoc_path = "protoc"# Path to proto compiler (protoc)
88
77
89
-
[formatter] # Formatter specific configuration
90
-
clang_format_path = "/usr/bin/clang-format"# clang-format binary to execute in formatting
78
+
[config.path]
79
+
clang_format = "clang-format"
80
+
protoc = "protoc"
91
81
```
92
82
93
83
### Configuration Sections
@@ -96,21 +86,14 @@ clang_format_path = "/usr/bin/clang-format" # clang-format binary to execute in
96
86
97
87
The `[config]` section contains stable settings that should generally remain unchanged.
98
88
99
-
-`include_paths`: Directories to search for `.proto` files. Absolute or relative to LSP workspace root.
100
-
-`disable_parse_diagnostics`: Set to `true` to disable tree-sitter parse diagnostics during parsing.
101
-
102
-
#### Experimental Configuration
103
-
104
-
The `[config.experimental]` section contains settings that are in development or not fully tested.
105
-
106
-
-`use_protoc_diagnostics`: Enable diagnostics from the `protoc` compiler when set to `true`.
107
-
-`protoc_path`: Uses protoc from this path for diagnostics
89
+
-`include_paths`: Directories to search for `.proto` files. Absolute or relative to LSP workspace root. Worspace root is already included in include_paths
108
90
109
-
#### Formatter Configuration
91
+
#### Path Configuration
110
92
111
-
The `[formatter]` section allows configuration for code formatting.
93
+
The `[config.path]` section contains path for various tools used by LSP.
112
94
113
-
-`clang_format_path`: Specify the path to the `clang-format` binary.
95
+
-`clang_format`: Uses clang_format from this path for formatting
96
+
-`protoc`: Uses protoc from this path for diagnostics
114
97
115
98
---
116
99
@@ -124,7 +107,7 @@ Protols offers a rich set of features to enhance your `.proto` file editing expe
124
107
125
108
### Diagnostics
126
109
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.
110
+
Syntax errors are caught by the tree-sitter parser, which highlights issues directly in your editor. More advanced error reporting, is done by `protoc` which runs after a file saved. You must have `protoc`installed and added to your path or you can specify its path in the configuration above
0 commit comments