Provides Docs-YAML support via yaml-language-server.
Note: This extension has been republished as Microsoft docs-yaml, and is now part of the Docs Authoring Pack. Please install the new version and uninstall the Gizmos version for ongoing updates and support.
There are two categories of files that we run schema validation against:
-
For YAMLMime-based YAML file, we use the the YAMLMime to match the schema which we will use to do validation according to our config.
Those schemas are hold on this repository, Once schema files get updated, the extension will automatically pick up the latest version after a small latency (around 10min). There is no need to reopen or reload the extension.
But if a new schema is added to this repository, to use it, we need to update this config and release extension with new version -
For toc file, there is no YAMLMime in the beginning of file, we use the filename to match the schema, and it is case-sensitive,
toc.yml
andTOC.yml
will both be applied schema validation(buttoc.yaml
will not).
The schema used for toc YAML file is now built in the extension, and we are going to move it to schema repository in the future.
- The code intellisense is more intelligent now, extension can provide the intellisense according to the schema structure but not just text mapping.(v0.1.8 and later)
- Extension can generate input template for
object
(including required propertied and optional properties with default value).(v0.1.8 and later) - You can type a
-
to trigger the intellisense for generating a new array item.(v0.1.8 and later)
- Apply schema validation according to the YAMLMime
- Detects errors such as:
- Invalid property value type
- Out of enum scope
- Required property is missing
- Unexpected property
- Generate input template for whole YAML file
For now, the VSCode don't support auto-completion on a comment, so do not type
#
to get intellisense, just typeYamlMime
or YAMLMime type.
- Generate input template for an object(if provided by schema)
Including required properties and optional properties with default value
- Support properties intellisense(if provided by schema)
- Enumerated property value recommendation(if provided by schema)
Intellisense is automatically triggered by what you have typed, but you can also hit Ctrl + Space to get what you can type.
- Hovering over a property shows description if provided by schema
A YAML syntax to identify the mime type of this YAML document, which will decide the applied schema type e.g.
### YamlMime:Module
....
- YAMLMime should be the first line
- There are should be a space between triple
#
and case-sensitiveYamlMime
- There are should not be extra space between
YamlMime
, Mime-type and:
- Install prerequisites:
- latest Visual Studio Code
- Node.js v6.0.0 or higher
- Fork this repository.
- Build this project.
# clone your forked repository $ git clone https://github.com/{your-github-name}/docs-yaml $ cd docs-yaml # install npm dependencies $ npm install # compile $ npm run compile # open the project in vscode $ code .
- Make changes as necessary and the run the code using F5. Refer to VS Code documentation on how to run and debug the extension.
- Create a pull-request to GitHub repository and we will review, merge it and publish new version extension regularly.
Coming soon.
All contributions are welcome!