Extension Details

- XML
- by Rob Anderson
- 485 Recent Installs | 5765 Total Installs
- Adds XML linting, schema support and formatting to Nova
- Repository
- Bug Reports
-
Read & Write Files
-
Launch Subprocesses
-
This extension is allowed to:
Readme
XML Extension provides a deeper integration with XML through the use of schemas, XML validation, code completion, linting and optional document formatting. XML Extension also provides a schema for Nova's own Syntax definitions.

Work in Progress
This version of XML is a prerelease and not all functionality exists yet.
Things that are still to be done are on
GitHub Issues.
Requirements
XML Extension runs the eclipse/lemminx XML language server as a native binary
and has no external requirements.
Entitlements
XML Extension uses these entitlements for these purposes:
processis to run the Language Server itselfnetworkis to download schemas and cache them to~/.lemmixfilesystemis to read in XML files, write formatted files and cache schemas
Usage
XML Extension runs any time you open a local project with XML files in it, automatically lints all open files, then reports errors and warnings in Nova's Issues sidebar and the editor gutter:

XML Extension intelligently suggests completions for you as you write, based on the current documents associated schema.

XML Extension displays relevant documentation when you hover over symbols:

Commands
- Format will format the current XML document.
- Rename will rename the tag you have selected.
Configuration
To configure global preferences, open Extensions → Extension Library... then select XML's Preferences tab.
You can also configure preferences on a per-project basis in Project → Project Settings...
Associating Schemas
There are two schema languages for XML, DTD
and XSD. DTD files are simpler and shorter to write whereas XSD schemas are more verbose but provide greater functionality.
Schemas can be loaded relative to the XML file in question.
Nova Syntax Definitions
XML Extension uses a schema catalog to automatically register a schema for Nova Syntax definitions.
You can opt into it like this:
<?xml version="1.0" encoding="UTF-8"?>
<syntax name="javascript" xmlns="https://www.nova.app/syntax">
<!-- ... -->
</syntax>
Local Catalog
If your project uses its own catalog file(s) for mapping namespaces to schemas, you can point to them in the project's configuration settings for XML.
This will allow XML Extension to load mappings from your local files as well.
You may need to run the Restart XML Server command for these changes to take effect
Writing Schemas
W3 Schools has good tutorials for creating both DTD
and XSD schemas.
For an example, check out
Inventory.xml
and Intentory.xsd
in the example repo.
It shows how to structure a schema and associate it relatively.
Release Notes
Version 0.4.1
- Restart the server if
xml.catalogsis changed, the Language Server seems to need this - Reduce icon size for a smaller package
Version 0.4.0
- Added
Restart Servercommand - Upgraded the language server from
0.24.0to0.29.0, see it's GitHub releases for info
Version 0.3.0
- Tree sitter support! Added support for
<tree-sitter>syntax inhttps://www.nova.app/syntaxxml files. - Update the language server from
0.21.0to0.24.0, see it's GitHub releases for info - Build tooling updates
- Specify custom catalog files per-workspace, thanks @greystate!
Version 0.2.1
Update the language server from 0.18.0 to 0.21.0, see it's GitHub releases for info
All compiled code is now Open Source, if you fancy diving in to see what Yaml Extension is up to, you can
Version 0.2
Nova Syntax definitions improvements
- Add support for
<subsyntax>definitions - Allow
subsyntax=trueon<syntax>elements - Allow empty
<subscopes /> - Fix detectors so sub-elements can be re-used
Thanks to Martin Kopischke for the <subsyntax> bug report
Version 0.1.1
- Fix the LanguageServer not starting up correctly
Version 0.1
- Everything is new