This VS Code extension provides support for creating and editing XML documents, based on the LSP4XML 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 project Wiki.
- Java JDK (or JRE) 8 or more recent
- Ensure Java path is set in either:
xml.java.homein VSCode preferencesjava.homein VSCode preferences- Environment variable
JAVA_HOMEorJDK_HOME - Note: The path should end at the parent folder that contains the
binfolder.
Example Path:/usr/lib/jvm/java-1.8.0ifbinexists 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.
The following settings are supported:
xml.trace.server: Trace the communication between VS Code and the XML Language Server in the Output view.xml.catalogs: Register XML catalog files.xml.logs.client: Enable/disable logging to the Output view.xml.fileAssociations: Associate XML Schemas to XML file patterns.xml.format.splitAttributes: Set totrueto split node attributes onto multiple lines during formatting. Defaults tofalse.xml.format.joinCDATALines: Set totrueto join lines in CDATA content during formatting. Defaults tofalse.xml.format.joinContentLines: Set totrueto join lines in node content during formatting. Defaults tofalse.xml.format.joinCommentLines: Set totrueto join lines in comments during formatting. Defaults tofalse.xml.format.preservedNewLines: Set the maximum amount of newlines between elements. Defaults to2.xml.format.preserveEmptyContent: Set totrueto preserve standalone whitespace content in an element. Defaults tofalse.xml.format.spaceBeforeEmptyCloseTag: Set totrueto insert space before the end of a self closing tag. Defaults totrue.xml.format.quotations: Set todoubleQuotesto format and only use", orsingleQuotesto format and only use'. Defaults todoubleQuotes.xml.format.enabled: Enable/disable formatting.xml.autoCloseTags.enabled: Enable/disable automatic tag closing.
Note 'editor.autoClosingBrackets' must be turned off to work.xml.server.vmargs: Extra VM arguments used to launch the XML Language Server. Requires VS Code restart.xml.validation.enabled: Set tofalseto disable all validation. Defaults totrue.xml.validation.schema: Set tofalseto disable schema validation. Defaults totrue.xml.validation.noGrammar: The message severity when a document has no associated grammar. Defaults tohint.xml.server.workDir: Set an absolute path for all cached schemas to be stored. Defaults to~/.lsp4xml.
Since 0.7.0:
xml.java.home: Set the Java path required to run the XML Language Server. If not set, falls back to either thejava.homepreference or theJAVA_HOMEorJDK_HOMEenvironment variables.xml.symbols.enabled: Enable/disable document symbols (Outline). Default istrue.
More detailed info in the Wiki.
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.
