|
25 | 25 | - [For Neovim](#for-neovim) |
26 | 26 | - [Setting Include Paths in Neovim](#setting-include-paths-in-neovim) |
27 | 27 | - [Command Line Options](#command-line-options) |
| 28 | + - [Examples](#examples) |
28 | 29 | - [For Visual Studio Code](#for-visual-studio-code) |
29 | 30 | - [Configuration](#%EF%B8%8Fconfiguration) |
30 | 31 | - [Sample `protols.toml`](#sample-protolstoml) |
|
45 | 46 | - [Packaging](#-packaging) |
46 | 47 | - [Contributing](#-contributing) |
47 | 48 | - [Setting Up Locally](#setting-up-locally) |
| 49 | + - [Option 1: Using Dev Containers (Easiest)](#option-1-using-dev-containers-easiest) |
| 50 | + - [Option 2: Manual Setup](#option-2-manual-setup) |
| 51 | + - [Debugging](#-debugging) |
48 | 52 | - [License](#-license) |
49 | 53 |
|
50 | 54 | --- |
@@ -87,19 +91,62 @@ require'lspconfig'.protols.setup{ |
87 | 91 |
|
88 | 92 | Protols supports various command line options to customize its behavior: |
89 | 93 |
|
90 | | -``` |
91 | | -protols [OPTIONS] |
| 94 | +```text |
| 95 | +Usage: protols [OPTIONS] |
92 | 96 |
|
93 | 97 | Options: |
94 | | - -i, --include-paths <INCLUDE_PATHS> Include paths for proto files, comma-separated |
95 | | - -V, --version Print version information |
96 | | - -h, --help Print help information |
| 98 | + -i, --include-paths <INCLUDE_PATHS> Include paths for proto files, comma-separated (can be used multiple times) |
| 99 | + -h, --help Print help |
| 100 | + -V, --version Print version |
| 101 | +
|
| 102 | +Transport: |
| 103 | + --stdio Use stdin/stdout for communication (default) |
| 104 | + --socket <ADDR> Use TCP communication with a specific address and port. Examples: "192.168.1.10:5005" or "0.0.0.0:5005" |
| 105 | + --port <PORT> Use TCP communication on localhost with a specific port. Example: "5005" |
| 106 | + --pipe <PATH> Use Unix domain socket (Linux/macOS) or Named Pipe (Windows). Examples: "/tmp/protols.sock" or "protols-pipe" (Windows) |
97 | 107 | ``` |
98 | 108 |
|
99 | | -For example, to specify include paths when starting the language server: |
| 109 | +#### Examples |
| 110 | + |
| 111 | +##### Specify include paths |
| 112 | + |
| 113 | +You can provide include paths using a comma-separated list or by repeating the |
| 114 | +flag: |
100 | 115 |
|
101 | 116 | ```bash |
102 | 117 | protols --include-paths=/path/to/protos,/another/path/to/protos |
| 118 | +# or |
| 119 | +protols -i /path/to/protos -i /another/path/to/protos |
| 120 | +``` |
| 121 | + |
| 122 | +##### Communication via TCP |
| 123 | +TCP transport is useful when the language server and the IDE run in different |
| 124 | +environments. |
| 125 | + |
| 126 | +- **Localhost only**: Connect within the same machine. |
| 127 | + ```bash |
| 128 | + protols --port 7301 |
| 129 | + ``` |
| 130 | +- **Container/Docker mode**: Listen on all interfaces to allow access from the |
| 131 | + host machine to the container. |
| 132 | + ```bash |
| 133 | + protols --socket 0.0.0.0:7301 |
| 134 | + ``` |
| 135 | +- **Specific interface**: Listen on a specific network IP. |
| 136 | + ```bash |
| 137 | + protols --socket 192.168.1.10:7301 |
| 138 | + ``` |
| 139 | + |
| 140 | +##### Communication via Unix Domain Socket |
| 141 | +On Linux or macOS, you can use a socket file for communication: |
| 142 | +```bash |
| 143 | +protols --pipe /tmp/protols.sock |
| 144 | +``` |
| 145 | + |
| 146 | +##### Communication via Named Pipes (Windows) |
| 147 | +On Windows, you can specify a pipe name. `protols` handles the `\\.\pipe\` prefix automatically: |
| 148 | +```bash |
| 149 | +protols --pipe protols-pipe |
103 | 150 | ``` |
104 | 151 |
|
105 | 152 | ### For Visual Studio Code |
@@ -265,6 +312,12 @@ testing. |
265 | 312 | cargo test |
266 | 313 | ``` |
267 | 314 |
|
| 315 | +### 🐞 Debugging |
| 316 | + |
| 317 | +If you want to contribute or debug the server logic, please refer to the |
| 318 | +[Debugging Guide](docs/debugging.md) for instructions on setting up a TCP-based |
| 319 | +debug session with VS Code and Neovim. |
| 320 | + |
268 | 321 | --- |
269 | 322 |
|
270 | 323 | ## 📄 License |
|
0 commit comments