Edit online

Content Completion Assistant in JSON

Oxygen XML Editor includes an intelligent Content Completion Assistant that offers proposals for inserting JSON structures that are valid at the current editing location.

The Content Completion Assistant is enabled by default. To disable it, open the Preferences dialog box (Options > Preferences), go to Editor > Content Completion, and deselect the Enable content completion option.

Figure 1. Content Completion Assistant in JSON

Content Completion and the Associated Schema

The Content Completion Assistant feature is schema-driven and the list of proposals in the Content Completion Assistant depend on the associated JSON Schema. For information about ways to associate a schema to a JSON document, see the Associating a Schema to JSON Documents section.

If a JSON document does not have a schema associated, Oxygen XML Editor automatically learns the document structure as editing events occur and will offer content completion proposals accordingly. Note that this feature is disabled for documents that contain more than one million characters.

Using the Content Completion Assistant in JSON

The feature is activated in Text mode for JSON documents by:
  • Typing a quote symbol (") to insert a property or value.
  • Pressing Ctrl + Space or Alt + ForwardSlash (Command + Option + ForwardSlash on macOS).

The feature is activated in Author mode by using the Enter key.

You can navigate through the list of proposals by using the Up and Down keys on your keyboard. In some cases, the Content Completion Assistant displays a documentation window with information about the particular proposal. You can also change the size of the documentation window by dragging its top, right, and bottom borders.

To insert the selected proposal, press Enter or Tab.

Types of Proposals Listed in the Content Completion Assistant for JSON

The proposals that populate the Content Completion Assistant for JSON documents depend on the structure defined in the associated JSON Schema. The types of structure proposed in the content completion window include:
  • JSON properties
  • JSON values
  • JSON arrays
  • JSON objects

The number and type of proposals displayed by the Content Completion Assistant is dependent on the cursor's current position in the JSON document and the child items displayed within a given context are defined by the structure of the specified JSON Schema.

Code Templates in the Content Completion

Oxygen XML Editor includes a set of built-in code templates for JSON documents that can be selected from the Content Completion Assistant. The code templates are displayed with a symbol in the content completion list. You can also define your own code templates and share them with others. For more information, see Code Templates.