Nova

Extensions


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:

  • process is to run the Language Server itself
  • network is to download schemas and cache them to ~/.lemmix
  • filesystem is 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.

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>

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.


Changelog

Version 0.3.0

  • Tree sitter support! Added support for <tree-sitter> syntax in https://www.nova.app/syntax xml files.
  • Update the language server from 0.21.0 to 0.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

0.18.1, 0.18.2, 0.18.3, 0.19.0, 0.19.1, 0.20.0, 0.21.0

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=true on <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