Configuring Your IDE

This topic describes how to configure IntelliJ and Eclipse to display the simulation language auto-completion, SV API JavaDoc and sv-lab.json validation and auto-completion.

IntelliJ IDEA configuration

This chapter describes how to configure simulation language auto-completion, the Java SV API JavaDoc and the sv-lab.json SV Lab configuration file autocompletion in IntelliJ. These instructions apply to IntelliJ version 2019.2.

Simulation language autocompletion

Every application and service model includes the sv-vsl.js, simulation language definition file file:

import * as sv from "../../../../../../lib/sv-vsl.js"

While the file itself is not needed when deploying and running the simulation, the import statement provides a valid path to the lib/sv-vsl.js file and enables auto-completion for the simulation language in the IDE. Auto-completion is accessible through <Ctrl><Space>.

SV API JavaDoc

To properly display the SV API JavaDoc in IntelliJ, you need to select both the library and JavaDoc JAR files at once when creating a library dependency. For example, select both lib/sv-lab-client-all-5.2.0.jar and lib/sv-lab-client-all-5.2.0-javadoc.jar in the file selection dialog box.

To display SV API JavaDoc in existing Maven projects, such as the demos provided with SV Lab, you must add the JavaDoc JAR file to the existing library dependency.

To add the JavaDoc JAR file:

  1. Select File/Project Structure.
  2. In the Project Structure dialog box, select Project Settings/Modules.
  3. Clieck the Dependencies tab, and select the sv-lab-all or sv-lab-client-all dependency
  4. Click the '+' and select the corresponding JavaDoc JAR file from the lib/ directory.

Note

Repeat the above steps each time you re-import a Maven project.

Press <Ctrl><Q> to view the SV Lab API JavaDoc:

SV Lab configuration file autocompletion and validation

This section describes how to register the JSON schema of the sv-lab.json files in IntelliJ. Registering the schema enables auto-completion and syntax checks, which can assist you in editing the Lab configuration within the IDE.

To register the schema:

  1. Select_File/Settings_ to open the Settings dialog box.
  2. Search for 'json schema'.
  3. Expand the Languages & Frameworks/Schemas and DTDs section and select JSON Schema Mappings.
  4. Click + to add new mapping. Browse for the lib/sv-lab-schema.json file.
  5. Click + and set the File path pattern to sv-lab*.json

After registering the JSON schema, the IDE suggests possible values when you press <Ctrl><Space>, among other helpful functions.

Eclipse configuration

This section describes how to display the SV API JavaDoc in a new or existing Maven project in Eclipse (such as the demos bundled with SV Lab). To enable JavaDoc display, you must add the JavaDoc JAR file to the SV Lab library dependency.

To add the JavaDoc JAR file:

  1. In the Package Explorer, right-click the sv-lab-all or sv-lab-client-all dependency and select Properties.
  2. Add the appropriate JavaDoc JAR file from the lib/ directory.

The editor displays the SV Lab API JavaDoc.