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: doc/developing_editor.md
+21-6
Original file line number
Diff line number
Diff line change
@@ -6,18 +6,33 @@ This documentation will give you some tips to help when you are going to support
6
6
## Config
7
7
There is two different config used by the promql-server.
8
8
9
-
### YAML configuration (cold configuration)
10
-
The first one is a classic yaml file which can be used to customize the server when it is starting. It has the following structure:
9
+
### Cold configuration (YAML or by environment)
10
+
The first one is a classic yaml file which can be used to customize the server when it is starting. It's specified by adding the `--config-file` command line flag when starting the language server.
11
+
12
+
It has the following structure:
11
13
12
14
```yaml
13
-
activate_rpc_log: false # It's a boolean in order to activate or deactivate the rpc log. It's deactivated by default
15
+
activate_rpc_log: false # It's a boolean in order to activate or deactivate the rpc log. It's deactivated by default and mainly useful for debugging the language server, by inspecting the communication with the language client.
14
16
log_format: "text"# The format of the log printed. Possible value: json, text. Default value: "text"
15
17
prometheus_url: "http://localhost:9090"# the HTTP URL of the prometheus server.
16
-
rest_api_port: 8080# When set, the server will be started as an HTTP server. Default value: 0
18
+
rest_api_port: 8080# When set, the server will be started as an HTTP server that provides a REST API instead of the language server protocol. Default value: 0
19
+
```
20
+
21
+
In case the file is not provided, it will read the configuration from the environment variables with the following structure:
Note: documentation and default value are the same for both configuration (yaml and environment)
31
+
19
32
### JSON configuration (hot configuration)
20
-
There is a second configuration which is used only at the runtime.
33
+
There is a second configuration which is used only at the runtime and can be sent by the language client over the `DidChangeConfiguration` API. It's used to sync configuration from the text editor to the language server.
34
+
35
+
It has the following structure:
21
36
22
37
```json
23
38
{
@@ -27,4 +42,4 @@ There is a second configuration which is used only at the runtime.
27
42
}
28
43
```
29
44
30
-
This configuration will be watched thanks to the method implemented `DidChangeConfiguration`
45
+
Using this way of changing configuration requires both providing those config options in the Text editor and sending them to the language server whenever they are changed.
0 commit comments