Displaying and Editing Code

You can display, navigate, and edit the code. The code viewer displays the generated code, or the input code for a reverse code configuration.

This task shows you how to:


Before you begin: Configure and run a code generation or a code reverse.

Navigate the Files And Display Code

The Files pane displays the existing configurations, the generated files, or the input files after a code reverse operation.

  1. From the Files pane, double-click an element.

    Note: In the Files tab, empty files are grayed out.

    The diagram viewer displays the code at the location of the chosen element.

    Files tab menu
    Code editing commands
    Minimap for navigating the code page

    To hide the miimap, press Ctrl+M or right-click the text editor to select Toggle Minimap.

  2. From the Files tab menu , use the following commands to collapse or filter the elements in the Software Producer Files tab:

    • Collapse All
    • Collapse Selected Recursively
    • Filter on Selection
  3. Right-click an element and select a command from the shortcut menu.

    Depending on the selected file, the following commands are proposed:
    OptionDescription
    Open in File Explorer Opens the local folder where the generated file is stored.
    Copy Path

    For a configuration: Copies the path to the local folder, or the file name.

    For a file or folder: Copies the absolute path, the file name, or the relative path

    Open with VS Code Opens the file with VS code.
    Delete Files Delete the selected files or folders.
    Note: From the file explorer, deleting folders with subfolders might be restricted. Use this command to delete folders with subfolders.
    Edit with Default Editor Opens the file in the editor associated with this file format.
    Open Specification
    • A configuration is selected: Opens the configuration specification.
    • A file is selected: Opens the element from which the file was generated (first displays the list of the different elements if multiple elements were used to generate the selected file).

    See Defining Specification Properties.

    Select in Containment tree
    • A configuration is selected: Opens the configuration specification.
    • A file is selected: Displays and selects the element from which the file was generated in the Containment tree (if there are multiple elements used, displays the list).
    Show changes of last operation Opens a new tab in the main pane and highlights the changes made by the last operation (the comparison is made against the file’s state after the last operation, not the current working copy).

    Compare working copy with... Opens a new tab in the code viewer and compares the current file with the selected version.

Edit the Code

  1. From the diagram menu in the code viewer, click Edit to enter the edit mode.
  2. To navigate in the code page, click the minimap .
  3. Edit the code.

    Tip: To open a code element in the Containment tree, click Go To.

  4. Click Save .