Grab the addon: https://marketplace.visualstudio.com/items?itemName=redhat.vscode-xml
And add this to your config (settings.json
)
// schema for Powershell
"xml.fileAssociations": [
{
"systemId": "https://raw.githubusercontent.com/PowerShell/PowerShell/master/src/Schemas/Format.xsd",
"pattern": "**/*.Format.ps1xml"
},
{
"systemId": "https://raw.githubusercontent.com/PowerShell/PowerShell/master/src/Schemas/Types.xsd",
"pattern": "**/*.Types.ps1xml"
}
],
You don't need to download these, but the source is: https://github.com/PowerShell/PowerShell/tree/master/src/Schemas
// these have higher precendence than extensions
"files.associations": {
// always highlight .json as if they are .jsonc, because many are
"*.json": "jsonc",
// If you don't want an addon, you can still
// get xml syntax highlighting using:
"*.ps1xml": "xml",
"*.psm1": "powershell",
".batrc": "shellscript",
},
- using
$schema
in vs code: https://code.visualstudio.com/docs/languages/json#_json-schemas-and-settings
{
"$schema": "https://json.schemastore.org/coffeelint"
}
"json.schemas": [
{
"fileMatch": [
"/.babelrc"
],
"url": "https://json.schemastore.org/babelrc"
}
]