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: docs/src/configuring-zed.md
+20-1Lines changed: 20 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -575,8 +575,13 @@ Each option controls displaying of a particular toolbar element. If all elements
575
575
The following settings can be overridden for specific language servers:
576
576
577
577
-`initialization_options`
578
+
-`settings`
578
579
579
-
To override settings for a language, add an entry for that language server's name to the `lsp` value. Example:
580
+
To override configuration for a language server, add an entry for that language server's name to the `lsp` value.
581
+
582
+
Some options are passed via `initialization_options` to the language server. These are for options which must be specified at language server startup and when changed will require restarting the language server.
583
+
584
+
For example to pass the `check` option to `rust-analyzer`, use the following configuration:
580
585
581
586
```json
582
587
"lsp": {
@@ -590,6 +595,20 @@ To override settings for a language, add an entry for that language server's nam
590
595
}
591
596
```
592
597
598
+
While other options may be changed at a runtime and should be placed under `settings`:
599
+
600
+
```json
601
+
"lsp": {
602
+
"yaml-language-server": {
603
+
"settings": {
604
+
"yaml": {
605
+
"keyOrdering": true// Enforces alphabetical ordering of keys in maps
606
+
}
607
+
}
608
+
}
609
+
}
610
+
```
611
+
593
612
## Format On Save
594
613
595
614
- Description: Whether or not to perform a buffer format before saving.
Copy file name to clipboardExpand all lines: docs/src/languages/yaml.md
+75-5Lines changed: 75 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ You can configure various [yaml-language-server settings](https://github.com/red
12
12
```json
13
13
"lsp": {
14
14
"yaml-language-server": {
15
-
"initialization_options": {
15
+
"settings": {
16
16
"yaml": {
17
17
"keyOrdering": true,
18
18
"format": {
@@ -32,9 +32,9 @@ Note, settings keys must be nested, so `yaml.keyOrdering` becomes `{"yaml": { "k
32
32
33
33
## Schemas
34
34
35
-
By default yaml-language-server will attempt to determine the correct schema for a given yaml file and retrieve the appropriate JSON Schema from [Json Schema Store].
35
+
By default yaml-language-server will attempt to determine the correct schema for a given yaml file and retrieve the appropriate JSON Schema from [Json Schema Store](https://schemastore.org/).
36
36
37
-
You can override this by [using an inlined schema] reference via a modeline comment at the top of your yaml file:
37
+
You can override any auto-detected schema via the `schemas` settings key (demonstrated above) or by providing an [inlined schema](https://github.com/redhat-developer/yaml-language-server#using-inlined-schema) reference via a modeline comment at the top of your yaml file:
You can disable this functionality entirely if desired:
47
+
You can disable the automatic detection and retrieval of schemas from the JSON Schema if desired:
48
48
49
49
```json
50
50
"lsp": {
51
51
"yaml-language-server": {
52
-
"initialization_options": {
52
+
"settings": {
53
53
"yaml": {
54
54
"schemaStore": {
55
55
"enable": false
@@ -59,3 +59,73 @@ You can disable this functionality entirely if desired:
59
59
}
60
60
}
61
61
```
62
+
63
+
## Custom Tags
64
+
65
+
Yaml-language-server supports [custom tags](https://github.com/redhat-developer/yaml-language-server#adding-custom-tags) which can be used to inject custom application functionality at runtime into your yaml files.
66
+
67
+
For example Amazon CloudFormation YAML uses a number of custom tags, to support these you can add the following to your settings.json:
0 commit comments