XENDR EditorA language syntax highlighter and code completion extension for editing XENDR files, a XULE output that produces inline XBRL from existing taxonomies and instance documents in CSV, HTML, XML or JSON formats. ExamplesCheck out the library of example HTML templates. FeaturesHighlighting
The highlighting is applied only inside recognized XENDR elements. Namespaces cannot be resolved syntactically, so any tag that ends with a recognized XENDR tag name works. For example Inside XENDR elements, it highlights the code replicating the Textmate rules present in the XULE extension, with minor modifications to better handle word boundaries around HTML tags. The rules' regular expressions and the associated token categories could be improved, but have been kept as-is for consistency with the original XULE extension. Diagnostics and completionsThe key idea is to reuse the existing XULE extension to resolve the diagnostics and completions of XULE code inside the HTML. For this, we generate a The XULE code is enriched with namespaces, output statements, and some list() expressions to make the file semantically correct, but the functionality of the XULE code is never altered. To generate the XULE file from the XENDR file in real time, we leverage a language server that tracks and understands XENDR files. Language serverThe program flows linearly in the language server:
If the file has diagnostics, the extension will detect them and show them correctly positioned over the html file. If the edit triggered a completion request, the extension redirects the request to the XULE extension (pointing to the generated XULE file). The returned completions are added to the possible completions in the html file. |