Skip to content

CodeSnippet Editor

Content assist

Press [Ctrl + Space] to start the content assist. With [Enter] a resource can then be selected. ContentAssist

Content assist paging

There are severel content assist pages.

  • Page 1: Resources
  • Page 2: Text tokens
  • Page 3: Deprecated resources

Press [Ctrl + Space] to switch the pages.

Annotations

Annotations can be used to make comments within a code snippet. These are coloured accordingly and displayed in the Model-Inconsistoncy View.

Annotation in Codesnippet

Annotation in Codesnippet

Data type validation

UP provides the possibility of type validation within code snippets. The data types of variables are checked and it is ensured that no unsuitable data types are used when parameters are passed or assigned.

Activation of the data types validation

If it does not already exist, create a new resource of type ModelConfig. This contains the attribute 'datatypeValidation'. This can be used to activate the validation.

image2022-9-16_11-36-36

Check variable assignment and parameter passing

image2022-9-16_13-45-16

Allowed types for operations

image2022-9-17_14-31-37

image2022-9-17_14-32-5

image2022-9-17_14-32-36

Allowed types for operations

image2022-9-17_14-33-2

image2022-9-17_14-33-28

image2022-9-17_14-33-57

image2022-9-17_14-35-39

Type conversion

In the code snippet, typecasting can be used to cast explicitly from one type to another.

image2022-9-16_13-45-48

Allowed explicit and implicit type conversions

image2022-9-17_14-31-37