I have started dabbling developing some extensions of my own, and have noticed that autocomplete is a bit lackluster for extension development. Are there any recommended extensions to install to aid in nova extension development?
Thanks!
I have started dabbling developing some extensions of my own, and have noticed that autocomplete is a bit lackluster for extension development. Are there any recommended extensions to install to aid in nova extension development?
Thanks!
Plugging my own extensions, which I created for this reason:
@types/nova-editor
or @types/nova-editor-node
(more info) npm package in your workspace to get JavaScript or TypeScript autocompletion and validation for the Nova JS api.extension.json
file.I can only heartily recommend Cameronās extensions; they have been a mainstay of my own work on Nova extensions. Unluckily, there is no equivalent (I am aware of) for the XML side of things; having just about finished slogging my way though 3100 lines of syntax definition, I can tell you that would have been more than welcome.
I can only echo @kopischke ā @apexskierās extensions are the de facto āgold standardā for writing language-related extensions. They are quite extensive and use all kinds of tricks, sometimes not in a very obvious way, and additionally, they even incorporate some open-source Microsoft code which is also useful for a lot of functionality. From what Iāve been seeing on other extensions so far, @apexskierās extensions are sort of a meta-template (a framework?) for pretty much everything related to language extensionsā¦
@kopischke Iām going to be a fanatic user of your XML extension Looking forward to it! The current alternatives (including Novaās built-in one) are really limited, especially when it comes to validating XML; Iām not a VS Code user, but Iād love to have something like this in Nova, instead of manually copying and pasting XML to some online validation toolā¦
( GitHub - eclipse/lemminx: XML Language Server and a schema with Using XML Schemas if someone wants to attempt it, should work like my json extension. Just throwing it out there!)
Iām terribly sorry if my answer sounded as if I was developing a new syntax mode for XML; what I am actually developing is a syntax mode for fish shell scripting, which is done in XML. Not that I havenāt, in the months of wrestling with Novaās rather basic XML support, wished for a better XML extension, but I have resisted the urge to bikeshed until now.
Iāll admit I had a peek at lemminx while pondering the eternal āto bikeshed or not to bikeshedā question, but one of the issues I could see coming up is that there is no central repository of XML definitions one could use for Panicās formats. SGML and its descendant XML have always expected the definers of their formats to provide a canonical link to, originally, a DTD (yes, Iām old enough to actually remember those, from my hardcover copy of the original SGML standard, no less ), a Relax NG schema or an XML ācapital sā Schema, so, unless I am entirely mistaken, not only would you have to define the bloody thing, you would also have to host it.
Interesting. My json extension doesnāt rely on a central repository, but defines the schema locally and registers it internally. The update cycle on a centralized repository can be painful (see the DefinitelyTyped definitions which I went a different route with) and I figured the overlap of people writing nova extension manifests who donāt have access to the nova extension to be pretty small.
I figured the overlap of people writing nova extension manifests who donāt have access to the nova extension to be pretty small.
You are right, of course, but baking in support for Nova specific formats into a generic XML extension seems, to me at least, at odds with separation of concerns. I find this less concerning with JSON, which has no canonical way of supporting definition files out of the box, so anything is ad-hoc anyway (I always think of JSON Schema as āXML got it right, dang if weād ever admit itā), but that is not the case for XML.
See also these GitHub repos with handwritten IDLs for Nova syntax grammars:
Hey Iām just seeing this, it sounds like I already did exactly what you said not to do . I made nova-xml which adds xml linting with XSD and DTD definitions using lemmix and tried my hand at writing a schema for syntax definitions too ā https://github.com/robb-j/nova-xml/blob/main/XML.novaextension/README.md#associating-schemas
It uses a custom catalog to provide extra schemas without them having to be hosted ā catalog.xml
As always, if anyone has ideas of ways that Nova itself could help in this regard, feel free to send them my way! I canāt guarantee weāll be able to prioritize them with the current schedule being what it is, but itās good to know what developers want most.
It would be helpful if Nova could help me with Syntax validations. As-is, the Extension Console just logs vague errors when parsing syntax files:
Error loading syntax āZig.xmlā
The operation couldnāt be completed. (SKXMLDocumentErrorDomain error 111.)