Back to Extensions Directory
Read the complete README
coc-xml
Heyward FannXML extension for coc.nvim
Installation CommandVim prompt
:CocInstall coc-xml
GitHub owner
Heyward FannVersion
v1.14.2npm package
coc-xmlRequirements
coc ^0.0.80
License
MIT
Repository
GitHubnpm latest published 2026-04-22Registry checked 2026-08-23Registry summary
Published Package Summary
coc-xml
fork of vscode-xml, provides support for creating and editing XML documents, based on the LemMinX XML Language Server, running with Java.
Install
:CocInstall coc-xml
Requirements
- Java JDK (or JRE) 8 or more recent
- Ensure Java path is set in either:
xml.java.homeorjava.homeincoc-settings.json- Environment variable
JAVA_HOMEorJDK_HOME
License
MIT
- XML extension for coc.nvim
Activation Events
- onLanguage:xml
- onLanguage:xslt
Developer Resources
Want to build, test, or contribute to coc.nvim extensions? Explore our official SDK and testing toolkits.
Open Developer GuideVersion History
This published npm package does not include a history.md or changelog.md file. Browse its npm versions or repository releases for available release information.
Contributed Commands
All contributes.commands entries from the published package manifest for coc-xml@1.14.2.
| Command (:CocCommand) | Description |
|---|---|
| xml.show.references | Show XML references |
| xml.updateLanguageServer | Download latest version of LemMinX from repo.eclipse.org |
Configuration Schema
All contributes.configuration entries from the published package manifest, including each raw property schema for coc-settings.json.
xml.colorsarray
Allows colors for the given file name patterns.
Default: []
Raw JSON Schema
{
"type": "array",
"items": {
"type": "object",
"required": [
"pattern",
"expressions"
],
"properties": {
"pattern": {
"type": "string",
"description": "matches the files that colors declared with `expressions` applies to.\n\nMore information on the glob syntax: https://docs.oracle.com/javase/tutorial/essential/io/fileOps.html#glob"
},
"expressions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"xpath": {
"type": "string",
"description": "The color DOM node (attribute, text) declared with XPath (ex: foo/@color, foo/text())"
}
}
},
"default": [],
"required": [
"xpath"
]
}
}
},
"scope": "window",
"default": [],
"description": "Allows colors for the given file name patterns."
}xml.catalogsarray
Register XML catalog files.
Default: []
Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"scope": "window",
"default": [],
"description": "Register XML catalog files."
}xml.java.homestring | null
Specifies the folder path to the JDK (11 or more recent) used to launch the XML Language Server if the Java server is being run.
On Windows, backslashes must be escaped, i.e.
`"xml.java.home": "C:\\Program Files\\Java\\jdk11"`.
Default: null
Raw JSON Schema
{
"type": [
"string",
"null"
],
"scope": "window",
"default": null,
"description": "Specifies the folder path to the JDK (11 or more recent) used to launch the XML Language Server if the Java server is being run.\nOn Windows, backslashes must be escaped, i.e.\n`\"xml.java.home\": \"C:\\\\Program Files\\\\Java\\\\jdk11\"`."
}xml.referencesarray
Allows references for the given file name patterns.
Default: []
Raw JSON Schema
{
"type": "array",
"items": {
"type": "object",
"required": [
"pattern",
"expressions"
],
"properties": {
"prefix": {
"type": "string",
"description": "The prefix to use (ex : '#') for from for all the declared reference expressions."
},
"pattern": {
"type": "string",
"description": "matches the files that reference declared with `expressions` applies to.\n\nMore information on the glob syntax: https://docs.oracle.com/javase/tutorial/essential/io/fileOps.html#glob"
},
"multiple": {
"type": "boolean",
"description": "true if the from attribute, text can declare several from references and false otherwise for all the declared reference expressions."
},
"expressions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"to": {
"type": "string",
"description": "The to reference DOM node (attribute, text) declared with XPath (ex: foo/@attr, foo/text())."
},
"from": {
"type": "string",
"description": "The from reference DOM node (attribute, text) declared with XPath (ex: foo/@attr, foo/text())."
},
"prefix": {
"type": "string",
"description": "The prefix to use (ex : '#') for from."
},
"multiple": {
"type": "boolean",
"description": "true if the from attribute, text can declare several from references and false otherwise."
}
}
},
"default": [],
"required": [
"from",
"to"
]
}
}
},
"scope": "window",
"default": [],
"description": "Allows references for the given file name patterns."
}xml.logs.clientboolean
Enable/disable logging to the Output view. Default is `true`.
Default: true
Raw JSON Schema
{
"type": "boolean",
"default": true,
"description": "Enable/disable logging to the Output view. Default is `true`."
}xml.trace.serverstring
Traces the communication between VS Code and the XML language server in the Output view. Default is `off`.
Default: "off"
Raw JSON Schema
{
"enum": [
"off",
"messages",
"verbose"
],
"type": "string",
"scope": "window",
"default": "off",
"description": "Traces the communication between VS Code and the XML language server in the Output view. Default is `off`."
}xml.format.legacyboolean
Enable/disable legacy formatter. Default is `false`.
Default: false
Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"description": "Enable/disable legacy formatter. Default is `false`."
}xml.server.vmargsstring | null
Specifies extra VM arguments used to launch the XML Language Server. Eg. use `-Xmx1G -XX:+UseG1GC -XX:+UseStringDeduplication` to increase the heap size to 1GB and enable String deduplication with the G1 Garbage collector.
Default: "-Xmx64M"
Raw JSON Schema
{
"type": [
"string",
"null"
],
"scope": "window",
"default": "-Xmx64M",
"description": "Specifies extra VM arguments used to launch the XML Language Server. Eg. use `-Xmx1G -XX:+UseG1GC -XX:+UseStringDeduplication` to increase the heap size to 1GB and enable String deduplication with the G1 Garbage collector."
}xml.format.enabledboolean
Enable/disable ability to format document. Default is `true`.
Default: true
Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"description": "Enable/disable ability to format document. Default is `true`."
}xml.server.workDirstring
Set a custom folder path for cached XML Schemas. An absolute path is expected, although the `~` prefix (for the user home directory) is supported. Default is `~/.lemminx`.
Default: "~/.lemminx"
Raw JSON Schema
{
"type": "string",
"scope": "window",
"default": "~/.lemminx",
"description": "Set a custom folder path for cached XML Schemas. An absolute path is expected, although the `~` prefix (for the user home directory) is supported. Default is `~/.lemminx`."
}xml.symbols.enabledboolean
Enable/disable document symbols (Outline). Default is `true`. No symbols are given if `"xml.symbols.enabled": false`.
Default: true
Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"description": "Enable/disable document symbols (Outline). Default is `true`. No symbols are given if `\"xml.symbols.enabled\": false`."
}xml.symbols.filtersarray
Allows XML symbols filter to be associated to file name patterns.
Default: []
Raw JSON Schema
{
"type": "array",
"items": {
"type": "object",
"required": [
"pattern",
"expressions"
],
"properties": {
"pattern": {
"type": "string",
"description": "File glob pattern. Example: `**/*.Format.ps1xml`\n\nMore information on the glob syntax: https://docs.oracle.com/javase/tutorial/essential/io/fileOps.html#glob"
},
"expressions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"xpath": {
"type": "string",
"description": "The XPath expression of the filter."
},
"excluded": {
"type": "boolean",
"description": "Exclude/Include the node which matches the XPath expression."
},
"inlineAttribute": {
"type": "boolean",
"description": "Whether or not to show an attribute expression inline with the owning element instead of nested."
},
"showAttributeName": {
"type": "boolean",
"description": "Whether or not the attribute expression name should be shown along with its value (for inline attributes only)."
}
},
"description": "The XML symbol expression."
},
"default": [],
"description": "Array of XML symbol expressions"
}
}
},
"scope": "window",
"default": [],
"description": "Allows XML symbols filter to be associated to file name patterns."
}xml.codeLens.enabledboolean
Enable/disable XML CodeLens. Default is `false`.
Default: false
Raw JSON Schema
{
"type": "boolean",
"default": false,
"description": "Enable/disable XML CodeLens. Default is `false`. "
}xml.fileAssociationsarray
Allows XML schemas/ DTD to be associated to file name patterns.
Example:
```json
[{
"pattern": "file1.xml",
"systemId": "path/to/file.xsd"
},
{
"pattern": "**/*.xsd",
"systemId": "http://www.w3.org/2001/XMLSchema.xsd"
}]
```
Default: []
Raw JSON Schema
{
"type": "array",
"items": {
"type": "object",
"required": [
"pattern",
"systemId"
],
"properties": {
"pattern": {
"type": "string",
"description": "File glob pattern. Example: `**/*.Format.ps1xml`\n\nMore information on the glob syntax: https://docs.oracle.com/javase/tutorial/essential/io/fileOps.html#glob"
},
"systemId": {
"type": "string",
"description": "The path or URL to the XML schema (XSD or DTD)."
}
}
},
"scope": "window",
"default": [],
"description": "Allows XML schemas/ DTD to be associated to file name patterns.\n\nExample:\n```json\n[{\n \"pattern\": \"file1.xml\",\n \"systemId\": \"path/to/file.xsd\"\n},\n{\n \"pattern\": \"**/*.xsd\",\n \"systemId\": \"http://www.w3.org/2001/XMLSchema.xsd\"\n}]\n```"
}xml.symbols.excludedarray
Disable document symbols (Outline) for the given file name patterns. Updating file name patterns does not automatically reload the Outline view for the relevant file(s). Each file must either be reopened or changed, in order to trigger an Outline view reload.
Example:
```
[
"**/*LargeFile.xml"
]```.
Default: []
Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"scope": "window",
"default": [],
"description": "Disable document symbols (Outline) for the given file name patterns. Updating file name patterns does not automatically reload the Outline view for the relevant file(s). Each file must either be reopened or changed, in order to trigger an Outline view reload.\n\nExample:\n```\n[\n \"**/*LargeFile.xml\"\n]```."
}xml.validation.enabledboolean
Enable/disable all validation. Default is `true`.
Default: true
Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"description": "Enable/disable all validation. Default is `true`."
}xml.validation.filtersarray
Default: [{"schema":{"enabled":"never"},"pattern":"**.exsd","noGrammar":"ignore"},{"pattern":"**{.project,.classpath,plugin.xml,feature.xml,category.xml,.target,.product}","noGrammar":"ignore"}]
Raw JSON Schema
{
"type": "array",
"items": {
"type": "object",
"required": [
"pattern"
],
"properties": {
"pattern": {
"type": "string",
"description": "File glob pattern. Example: `**/*.Format.ps1xml`\n\nMore information on the glob syntax: https://docs.oracle.com/javase/tutorial/essential/io/fileOps.html#glob"
}
}
},
"default": [
{
"schema": {
"enabled": "never"
},
"pattern": "**.exsd",
"noGrammar": "ignore"
},
{
"pattern": "**{.project,.classpath,plugin.xml,feature.xml,category.xml,.target,.product}",
"noGrammar": "ignore"
}
]
}xml.format.maxLineWidthinteger
Max line width. Set to `0` to disable this setting. Default is `100`. Not supported by legacy formatter.
Default: 100
Raw JSON Schema
{
"type": "integer",
"scope": "window",
"default": 100,
"description": "Max line width. Set to `0` to disable this setting. Default is `100`. Not supported by legacy formatter."
}xml.format.emptyElementsstring
Expand/collapse empty elements. Default is `ignore`.
Default: "ignore"
Raw JSON Schema
{
"enum": [
"ignore",
"collapse",
"expand"
],
"type": "string",
"scope": "window",
"default": "ignore",
"description": "Expand/collapse empty elements. Default is `ignore`."
}xml.format.preserveSpacearray
Element names for which spaces will be preserved. Not supported by legacy formatter.
Default: ["xsl:text","xsl:comment","xsl:processing-instruction","literallayout","programlisting","screen","synopsis","pre","xd:pre","style","script"]
Raw JSON Schema
{
"type": "array",
"items": {
"type": "string"
},
"scope": "window",
"default": [
"xsl:text",
"xsl:comment",
"xsl:processing-instruction",
"literallayout",
"programlisting",
"screen",
"synopsis",
"pre",
"xd:pre",
"style",
"script"
],
"description": "Element names for which spaces will be preserved. Not supported by legacy formatter."
}xml.validation.noGrammarstring
The message severity when a document has no associated grammar. Default is `hint`.
Default: "hint"
Raw JSON Schema
{
"enum": [
"ignore",
"hint",
"info",
"warning",
"error"
],
"type": "string",
"scope": "window",
"default": "hint",
"description": "The message severity when a document has no associated grammar. Default is `hint`."
}xml.format.joinCDATALinesboolean
Set to `true` to join lines in CDATA content during formatting. Default is `false`.
Default: false
Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"description": "Set to `true` to join lines in CDATA content during formatting. Default is `false`."
}xml.format.splitAttributesstring
Split multiple attributes each onto a new line or align attributes to the first. Default is `preserve`. Indicate level of indentation with `#xml.format.splitAttributesIndentSize#`.
Default: "preserve"
Raw JSON Schema
{
"enum": [
"preserve",
"splitNewLine",
"alignWithFirstAttr"
],
"type": "string",
"scope": "window",
"default": "preserve",
"description": "Split multiple attributes each onto a new line or align attributes to the first. Default is `preserve`. Indicate level of indentation with `#xml.format.splitAttributesIndentSize#`."
}xml.preferences.quoteStylestring
Preferred quote style to use for completion: `single` quotes, `double` quotes. Default is `double`.
Default: "double"
Raw JSON Schema
{
"enum": [
"single",
"double"
],
"type": "string",
"scope": "window",
"default": "double",
"description": "Preferred quote style to use for completion: `single` quotes, `double` quotes. Default is `double`."
}xml.format.joinCommentLinesboolean
Join comment content on format. Default is `false`.
Default: false
Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"description": "Join comment content on format. Default is `false`."
}xml.format.joinContentLinesboolean
Normalize the whitespace of content inside an element. Newlines and excess whitespace are removed. Default is `false`.
Default: false
Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"description": "Normalize the whitespace of content inside an element. Newlines and excess whitespace are removed. Default is `false`."
}xml.completion.autoCloseTagsboolean
Enable/disable autoclosing of XML tags. Default is `true`.
IMPORTANT: Turn off `#editor.autoClosingTags#` for this to work.
Default: true
Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"description": "Enable/disable autoclosing of XML tags. Default is `true`. \n\nIMPORTANT: Turn off `#editor.autoClosingTags#` for this to work."
}xml.filePathSupport.mappingsarray
Allows file path for the given file name patterns.
Default: []
Raw JSON Schema
{
"type": "array",
"items": {
"type": "object",
"required": [
"pattern",
"expressions"
],
"properties": {
"pattern": {
"type": "string",
"description": "matches the files that file path declared with `expressions` applies to.\n\nMore information on the glob syntax: https://docs.oracle.com/javase/tutorial/essential/io/fileOps.html#glob"
},
"expressions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"xpath": {
"type": "string",
"description": "The file path DOM node (attribute, text) declared with XPath (ex: foo/@path, foo/text())"
},
"filter": {
"type": "array",
"items": {
"type": "string"
},
"description": "String array which contains allowed file extensions (ex: [\".png\", \".gif\", \".jpg\"])"
},
"separator": {
"type": "string",
"description": "Separator character to use if multiple file paths are allowed (ex: \";\")"
}
}
},
"default": [],
"required": [
"xpath"
]
}
}
},
"scope": "window",
"default": [],
"description": "Allows file path for the given file name patterns."
}xml.format.enforceQuoteStylestring
Enforce `preferred` quote style (set by `#xml.preferences.quoteStyle#`) or `ignore` quote style when formatting. Default is `ignore`.
Default: "ignore"
Raw JSON Schema
{
"enum": [
"preferred",
"ignore"
],
"type": "string",
"scope": "window",
"default": "ignore",
"description": "Enforce `preferred` quote style (set by `#xml.preferences.quoteStyle#`) or `ignore` quote style when formatting. Default is `ignore`.",
"markdownEnumDescriptions": [
"Use preferred quote style set by `xml.preferences.quoteStyle` when formatting.",
"Ignore quote style formatting."
]
}xml.format.preservedNewlinesinteger
Preserve new lines that separate tags. The value represents the maximum number of new lines per section. A value of 0 removes all new lines. Default is `2`.
Default: 2
Raw JSON Schema
{
"enum": [
0,
1,
2,
3
],
"type": "integer",
"scope": "window",
"default": 2,
"description": "Preserve new lines that separate tags. The value represents the maximum number of new lines per section. A value of 0 removes all new lines. Default is `2`."
}xml.symbols.maxItemsComputedinteger
The maximum number of outline symbols and folding regions computed (limited for performance reasons). Default is `5000`.
Default: 5000
Raw JSON Schema
{
"type": "integer",
"default": 5000,
"description": "The maximum number of outline symbols and folding regions computed (limited for performance reasons). Default is `5000`. "
}xml.validation.schema.enabledstring
Enable/disable schema based validation. Default is `always`. Ignored if `#xml.validation.enabled#` is set to `false`.
Default: "always"
Raw JSON Schema
{
"enum": [
"always",
"never",
"onValidSchema"
],
"type": "string",
"scope": "window",
"default": "always",
"description": "Enable/disable schema based validation. Default is `always`. Ignored if `#xml.validation.enabled#` is set to `false`.",
"markdownEnumDescriptions": [
"Enable schema based validation.",
"Disable schema based validation.",
"Enable schema based validation only when the declared xsi:schemaLocation hint or xsi:noNamespaceSchemaLocation is valid for the root element."
]
}xml.format.preserveEmptyContentboolean
Preserve empty content/whitespace in a tag. Default is `false`. Supported only with legacy formatter.
Default: false
Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"description": "Preserve empty content/whitespace in a tag. Default is `false`. Supported only with legacy formatter."
}xml.validation.xInclude.enabledboolean
Enable/disable validation for `xi:include`. Default is `false`.
Default: false
Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"description": "Enable/disable validation for `xi:include`. Default is `false`."
}xml.format.closingBracketNewLineboolean
The option to put a closing bracket on a newline when `#xml.format.splitAttributes#` is `true`. Default value is `false`.
Default: false
Raw JSON Schema
{
"type": "boolean",
"default": false,
"description": "The option to put a closing bracket on a newline when `#xml.format.splitAttributes#` is `true`. Default value is `false`. "
}xml.format.grammarAwareFormattingboolean
Use Schema/DTD grammar information while formatting. Default is `true`. Not supported by legacy formatter.
Default: true
Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"description": "Use Schema/DTD grammar information while formatting. Default is `true`. Not supported by legacy formatter."
}xml.format.xsiSchemaLocationSplitstring
Split `xsi:schemaLocation` content. Default is `onPair`.
Default: "onPair"
Raw JSON Schema
{
"enum": [
"onElement",
"onPair",
"none"
],
"type": "string",
"scope": "window",
"default": "onPair",
"description": "Split `xsi:schemaLocation` content. Default is `onPair`.",
"markdownEnumDescriptions": [
"Put a new line after each namespace and URI, arranging them into one column.",
"Put a new line after each URI, arranging the content into pairs of namespace and URI.",
"Ignore `xsi:schemaLocation` content formatting."
]
}xml.validation.namespaces.enabledstring
Enable/disable namespaces validation. Default is `always`. Ignored if `#xml.validation.enabled#` is set to `false`.
Default: "always"
Raw JSON Schema
{
"enum": [
"always",
"never",
"onNamespaceEncountered"
],
"type": "string",
"scope": "window",
"default": "always",
"description": "Enable/disable namespaces validation. Default is `always`. Ignored if `#xml.validation.enabled#` is set to `false`.",
"markdownEnumDescriptions": [
"Enable namespaces validation.",
"Disable namespaces validation.",
"Enable namespaces validation only when the root element declares an xmlns namespace."
]
}xml.symbols.showReferencedGrammarsboolean
Show referenced grammars in the Outline. Default is `true`.
Default: true
Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"description": "Show referenced grammars in the Outline. Default is `true`."
}xml.validation.disallowDocTypeDeclboolean
Enable/disable if a fatal error is thrown if the incoming document contains a DOCTYPE declaration. Default is `false`.
Default: false
Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"description": "Enable/disable if a fatal error is thrown if the incoming document contains a DOCTYPE declaration. Default is `false`."
}xml.format.spaceBeforeEmptyCloseTagboolean
Insert space before end of self closing tag.
Example:
```<tag/> -> <tag />```. Default is `true`.
Default: true
Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"description": "Insert space before end of self closing tag. \nExample:\n ```<tag/> -> <tag />```. Default is `true`."
}xml.foldings.includeClosingTagInFoldboolean
Minimize the closing tag after folding. Default is `false`.
Default: false
Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"description": "Minimize the closing tag after folding. Default is `false`."
}xml.format.splitAttributesIndentSizenumber
How many levels to indent the attributes by when `#xml.format.splitAttributes#` is `true`. Default value is `2`.
Default: 2
Raw JSON Schema
{
"type": "number",
"default": 2,
"description": "How many levels to indent the attributes by when `#xml.format.splitAttributes#` is `true`. Default value is `2`. "
}xml.downloadExternalResources.enabledboolean
Download external resources like referenced DTD, XSD. Default is `true`.
Default: true
Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"description": "Download external resources like referenced DTD, XSD. Default is `true`."
}xml.completion.autoCloseRemovesContentboolean
Enable/disable the content of an element being removed when the element start tag is turned into a self-closing tag. The default setting is to remove the content.
Default: true
Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"description": "Enable/disable the content of an element being removed when the element start tag is turned into a self-closing tag. The default setting is to remove the content."
}xml.format.preserveAttributeLineBreaksboolean
Preserve line breaks that appear before and after attributes. This setting is overridden if `#xml.format.splitAttributes#` is set to `splitNewLine` or `alignWithFirstAttr`. Default is `true`.
Default: true
Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": true,
"description": "Preserve line breaks that appear before and after attributes. This setting is overridden if `#xml.format.splitAttributes#` is set to `splitNewLine` or `alignWithFirstAttr`. Default is `true`."
}xml.validation.resolveExternalEntitiesboolean
Enable/disable resolve of external entities. Default is `false`.
Default: false
Raw JSON Schema
{
"type": "boolean",
"scope": "window",
"default": false,
"description": "Enable/disable resolve of external entities. Default is `false`."
}xml.preferences.showSchemaDocumentationTypestring
Specifies the source of the XML schema documentation displayed on hover and completion. Default is `all`.
Default: "all"
Raw JSON Schema
{
"enum": [
"documentation",
"appinfo",
"all",
"none"
],
"type": "string",
"scope": "window",
"default": "all",
"description": "Specifies the source of the XML schema documentation displayed on hover and completion. Default is `all`.",
"markdownEnumDescriptions": [
"Documentation comes from the `xs:documentation` element.",
"Documentation comes from the `xs:appinfo` element.",
"Documentation comes from the `xs:documentation` and `xs:appinfo` elements.",
"Displays no documentation."
]
}