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
Copy file name to clipboardExpand all lines: README.md
+24-1Lines changed: 24 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,6 +58,24 @@ Then, configure it in your `init.lua` using [nvim-lspconfig](https://github.com/
58
58
require'lspconfig'.protols.setup{}
59
59
```
60
60
61
+
#### Setting Include Paths in Neovim
62
+
63
+
For dynamic configuration of include paths, you can use the `before_init` callback to set them via `initializationParams`:
64
+
65
+
```lua
66
+
require'lspconfig'.protols.setup{
67
+
before_init=function(_, config)
68
+
config.init_options= {
69
+
include_paths= {
70
+
"/usr/local/include/protobuf",
71
+
"vendor/protos",
72
+
"../shared-protos"
73
+
}
74
+
}
75
+
end
76
+
}
77
+
```
78
+
61
79
### Command Line Options
62
80
63
81
Protols supports various command line options to customize its behavior:
@@ -106,7 +124,12 @@ protoc = "protoc"
106
124
107
125
The `[config]` section contains stable settings that should generally remain unchanged.
108
126
109
-
-`include_paths`: These are directories where `.proto` files are searched. Paths can be absolute or relative to the LSP workspace root, which is already included in the `include_paths`. You can also specify this using the `--include-paths` flag in the command line. The include paths from the CLI are combined with those from the configuration. While configuration-based include paths are specific to a workspace, the CLI-specified paths apply to all workspaces on the server.
127
+
-`include_paths`: These are directories where `.proto` files are searched. Paths can be absolute or relative to the LSP workspace root, which is already included in the `include_paths`. You can also specify include paths using:
128
+
-**Configuration file**: Workspace-specific paths defined in `protols.toml`
129
+
-**Command line**: Global paths using `--include-paths` flag that apply to all workspaces
130
+
-**Initialization parameters**: Dynamic paths set via LSP `initializationParams` (useful for editors like Neovim)
131
+
132
+
All include paths from these sources are combined when resolving proto imports.
0 commit comments