This VS Code extension provides support for creating and editing XML documents, based on the LemMinX XML Language Server, running with Java.
- Syntax error reporting
- General code completion
- Auto-close tags
- Automatic node indentation
- Symbol highlighting
- Document folding
- Document links
- Document symbols and outline
- Renaming support
- Document Formatting
- DTD validation
- DTD completion
- DTD formatting
- XSD validation
- XSD based hover
- XSD based code completion
- XSL support
- XML catalogs
- File associations
- Code actions
- Schema Caching
See the changelog for the latest release.
You might also find useful information in the Online XML Documentation
or you can read this documentation inside vscode with the command Open XML Document
available with Ctrl+Shift+P
:
- Java JDK (or JRE) 8 or more recent
- Ensure Java path is set in either:
xml.java.home
in VSCode preferencesjava.home
in VSCode preferences- Environment variable
JAVA_HOME
orJDK_HOME
- Note: The path should end at the parent folder that contains the
bin
folder. Example Path:/usr/lib/jvm/java-1.8.0
ifbin
exists at/usr/lib/jvm/java-1.8.0/bin
. - Note: If the path is not set, the extension will attempt to find the path to the JDK or JRE.
See how to set java home for more information how this extension searches for Java.
The following settings are supported:
xml.java.home
: Set the Java path required to run the XML Language Server. If not set, falls back to either thejava.home
preference or theJAVA_HOME
orJDK_HOME
environment variables.xml.server.vmargs
: Specifies extra VM arguments used to launch the XML Language Server. Eg. use-Xmx1G -XX:+UseG1GC -XX:+UseStringDeduplication
to bypass class verification, increase the heap size to 1GB and enable String deduplication with the G1 Garbage collector.xml.server.workDir
: 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.trace.server
: Trace the communication between VS Code and the XML language server in the Output view. Default isoff
.xml.logs.client
: Enable/disable logging to the Output view. Default istrue
.xml.catalogs
: Register XML catalog files.xml.fileAssociations
: Allows XML schemas/ DTD to be associated to file name patterns.xml.format.enabled
: Enable/disable ability to format document. Default istrue
.xml.format.emptyElements
: Expand/collapse empty elements. Default isignore
.xml.format.enforceQuoteStyle
: Enforcepreferred
quote style (set byxml.preferences.quoteStyle
) orignore
quote style when formatting. Default isignore
.xml.format.joinCDATALines
: Set totrue
to join lines in CDATA content during formatting. Default isfalse
.xml.format.joinCommentLines
: Set totrue
to join lines in comments during formatting. Default isfalse
.xml.format.joinContentLines
: Normalize the whitespace of content inside an element. Newlines and excess whitespace are removed. Default isfalse
.xml.format.preserveAttributeLineBreaks
: Preserve line breaks that appear before and after attributes. Default isfalse
. IMPORTANT: This setting is overridden ifxml.format.splitAttributes
is set totrue
.xml.format.preserveEmptyContent
: Preserve empty content/whitespace in a tag. Default isfalse
.xml.format.preservedNewLines
: 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 is2
.xml.format.spaceBeforeEmptyCloseTag
: Insert space before end of self closing tag. Example:<tag/> -> <tag />
. Default istrue
.xml.format.splitAttributes
: Split multiple attributes each onto a new line. Default isfalse
.xml.format.splitAttributesIndentSize
: How many levels to indent the attributes by whenxml.format.splitAttributes
istrue
. Default value is2
.xml.preferences.quoteStyle
: Preferred quote style to use for completion:single
quotes,double
quotes. Default isdouble
.xml.autoCloseTags.enabled
: Enable/disable autoclosing of XML tags. Default istrue
. IMPORTANT: The following settings must be turned of for this to work:editor.autoClosingTags
,editor.autoClosingBrackets
.xml.codeLens.enabled
: Enable/disable XML CodeLens. Default isfalse
.xml.preferences.showSchemaDocumentationType
: Specifies the source of the XML schema documentation displayed on hover and completion. Default isall
.xml.validation.enabled
: Enable/disable all validation. Default istrue
.xml.validation.namespaces.enabled
: Enable/disable namespaces validation. Default isalways
. Ignored ifxml.validation.enabled
is set tofalse
.xml.validation.schema.enabled
: Enable/disable schema based validation. Default isalways
. Ignored ifxml.validation.enabled
is set tofalse
.xml.validation.disallowDocTypeDecl
: Enable/disable if a fatal error is thrown if the incoming document contains a DOCTYPE declaration. Default isfalse
.xml.validation.resolveExternalEntities
: Enable/disable resolve of external entities. Default isfalse
.xml.validation.noGrammar
: The message severity when a document has no associated grammar. Defaults tohint
.xml.symbols.enabled
: Enable/disable document symbols (Outline). Default istrue
.xml.symbols.excluded
: 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.xml.symbols.maxItemsComputed
: The maximum number of outline symbols and folding regions computed (limited for performance reasons). Default is5000
.xml.symbols.showReferencedGrammars
: Show referenced grammars in the Outline. Default istrue
.xml.symbols.filters
: Allows XML symbols filter to be associated to file name patterns.files.trimTrailingWhitespace
: Now affects XML formatting. Enable/disable trailing whitespace trimming when formatting an XML document. Default isfalse
.
- vscode-xml 1.14.0: A more customizable XML extension for VS Code
- Improved XML grammar binding and more in Red Hat VS Code XML extension 0.13.0
- Improved schema binding and more in Red Hat XML extension for VS Code 0.12.0 and LemMinX
- Eclipse LemMinX version 0.11.1
- What's new in the Visual Studio Code XML Extension 0.8.0
The LemMinX - XML Language Server can be extended to support custom completion, hover, validation, rename, etc. Please see the extensions documentation for more information.
This is an open source project open to anyone. Contributions are extremely welcome!
For information on getting started, refer to the CONTRIBUTING instructions.
CI builds can be installed manually by following these instructions:
-
Download the latest development VSIX archive from here.
(vscode-xml-XXX.vsix)
-
Go to the Extensions section in VSCode.
-
At the top right click the
...
icon. -
Select 'Install from VSIX...' and choose the visx file.
- File a bug in GitHub Issues,
- Chat with us on Gitter,
EPL 1.0, See LICENSE file.