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
+8-3Lines changed: 8 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ The following settings are supported:
52
52
*`yaml.schemas`: Helps you associate schemas with files in a glob pattern
53
53
*`yaml.schemaStore.enable`: When set to true, the YAML language server will pull in all available schemas from [JSON Schema Store](http://schemastore.org/)
54
54
*`yaml.schemaStore.url`: URL of a schema store catalog to use when downloading schemas.
55
-
*`yaml.customTags`: Array of custom tags that the parser will validate against. It has two ways to be used. Either an item in the array is a custom tagsuch as "!Ref" and it will automatically map !Ref to a scalar, or you can specify the type of the object !Ref should be, e.g. "!Ref sequence". The type of object can be either scalar (for strings and booleans), sequence (for arrays), mapping (for objects).
55
+
*`yaml.customTags`: Array of custom tags that the parser will validate against. It has three ways to be used. A tag without a type, such as "!Ref", is treated as a scalar tag. A tag with a node type, such as "!Ref sequence", specifies the YAML node type that the tag is written on. A tag with a node type and return type, such as "!FindInMap sequence:string", also specifies the schema type that the tagged value evaluates to. Supported node types are scalar, sequence, and mapping. Supported return types are string, number, integer, boolean, null, array, and object. The return type aliases scalar, sequence, and mapping are accepted as string, array, and object.
56
56
*`yaml.maxItemsComputed`: The maximum number of outline symbols and folding regions computed (limited for performance reasons).
57
57
*`yaml.disableDefaultProperties`: Disable adding not required properties with default values into completion text (default is false).
58
58
*`yaml.suggest.parentSkeletonSelectedFirst`: If true, the user must select some parent skeleton first before autocompletion starts to suggest the rest of the properties. When the YAML object is not empty, autocompletion ignores this setting and returns all properties and skeletons.
@@ -105,11 +105,13 @@ To use the custom tags in your YAML file, you need to first specify the custom t
105
105
"yaml.customTags": [
106
106
"!Scalar-example scalar",
107
107
"!Seq-example sequence",
108
-
"!Mapping-example mapping"
108
+
"!Mapping-example mapping",
109
+
"!Seq-as-string-example sequence:string"
109
110
]
110
111
```
111
112
112
-
The !Scalar-example would map to a scalar custom tag, the !Seq-example would map to a sequence custom tag, the !Mapping-example would map to a mapping custom tag.
113
+
The !Scalar-example would map to a scalar custom tag, the !Seq-example would map to a sequence custom tag, and the !Mapping-example would map to a mapping custom tag.
114
+
The !Seq-as-string-example would map to a sequence custom tag, and the whole tagged value would be treated as a string during schema validation.
113
115
114
116
You can then use the newly defined custom tags inside the YAML file:
Copy file name to clipboardExpand all lines: package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -225,7 +225,7 @@
225
225
"yaml.customTags": {
226
226
"type": "array",
227
227
"default": [],
228
-
"description": "Custom tags for the parser to use"
228
+
"description": "Custom tags for the parser to use. Supported formats are \"!Tag\" for a scalar tag, \"!Tag nodeType\" to specify the YAML node type, and \"!Tag nodeType:returnType\" to specify both the YAML node type and the schema type the tagged value evaluates to."
0 commit comments