Recommended autocomplete for developing extensions?

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:

  • Install the TypeScript extension and install the @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.
  • Install the JSON extension to get autocompletion, validation, and hover-help within the extension.json file.
5 Likes

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.

2 Likes

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 :rofl: 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ā€¦

2 Likes

(:eyes: 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!)

1 Like

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.

1 Like

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 :sweat_smile:), 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.

2 Likes

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.

1 Like

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.

4 Likes

See also these GitHub repos with handwritten IDLs for Nova syntax grammars:

2 Likes

Hey Iā€™m just seeing this, it sounds like I already did exactly what you said not to do :upside_down_face:. 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

1 Like

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. :pray:

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.)