For easier development of element templates, modellers and developers usually want two things:
- syntax highlighting
The following explains how to easily obtain both in Visual-Studio-Code.
The following options are available to obtain automatic completion for element-templates.
Element templates generated by Miranum-Console
With Miranum-IDE generated element templates automatically contain support for auto-complete in VS-Code. So you don't have to do anything in this case.
If you have your own element-templates you can achieve auto-completion in VS-Code by adding a "$schema" property at the top of the template. Camunda's schema for element templates can be found at: https://unpkg.com/@camunda/element-templates-json-schema/resources/schema.json
It should look like this:
Automatic completion for all schemas
With the following steps, you can obtain automatic completion by default in VS-Code:
go to your settings in VS-Code (located at: Code/File -> Preferences -> Settings).
search for "JSON" and click on "Edit in settings.json".
Enjoy auto-completion and suggestions by using the key combination: *Ctrl + Space
Credit to FrontAid and their blog.
JSON Syntax Highlighting
If your element templates do not end in .json, you will need to explain this to VS code first. For this, please follow steps 1 and 2 as given in autocompletion-for-all-schemas to get to the "settings.json". In this, file associations can be defined under "files.associations". So you enter your extension as the key and ".json" as the value. Here is an example in which element templates end in ".element-template".