A list of system properties supported by the CodeProber server. These are passed as Java system properties, e.g java -Dkey=val -jar codeprober.jar etc. Most properties must be explicitly set in the terminal (or use jvmArgs in the gradle plugin). A small number of properties are possible to set programatically in your CodeProber_parse function. For example:

public static Object CodeProber_parse(String[] args) {
  System.setProperty("cpr.type_identification_style", "NODE_LABEL");
  // ... then proceed with actual parsing ...
}

This works because CodeProber only reads certain properties after calling CodeProber_parse. The properties for which this works are marked with Y in the Late Read column.

Common properties

These are common, may be of interest to most developers.

Key Default Value Meaning Late Read
cpr.type_identification_style REFLECTION CodeProber tries keeping track of AST nodes while the user is making modifications to the source document of the tracked node. This is achieved with “Node Locators” (see paper for details). Node locators sometimes use the “type” of a tracked AST node as a search criteria. By default, the “type” is the Java class. However, for “wrapper” implementations, all nodes have the same Java class. This makes the node tracking significantly worse. To overcome this, you may want to set this property to NODE_LABEL. If you do, then CodeProber will use the result of cpr_nodeLabel as the type instead. Y
cpr.workspace null Set a directory to be used as a workspace (~“file system”) in the CodeProber UI. This becomes a persistent directory for CodeProber content to be saved to/loaded from. CodeProber will also store some metadata in the workspace, such as what probes are currently active. This is stored in directories called .cpr. You may want to add workspace/**/.cpr to your .gitignore. N
cpr.workspaceFilePattern null Set a regex to filter the file names visible in cpr.workspace. Note that .cpr directories (those with metadata) are always filtered out. N
cpr.backing_file null Set a file to represent the text content inside the CodeProber editor. Changes in CodeProber get saved to disk, and vice versa. This can be seen as a smaller, single-file version of cpr.workspace. You cannot use cpr.workspace and cpr.backing_file simultaneously. N

Uncommon properties

Highly specialized and/or legacy properties, should generally be avoided. If you look in the codebase you may find more properties that are not in this list. They are even more specialized/legacy and should definitely be avoided.

Key Default Value Meaning Late Read
cpr.session_logger_dir null A place to write session logs. This is a feature that makes CodeProber store a tiny JSON object for most interactions that reach the server. For example, this logs each request type and timestamp, when the client connects to the server, etc. The collected files are written to disk in the path specified by this property. Nothing is ever sent over the network, it only writes to disk. This is used for gathering data on CodeProber usage, but is not of interest to most normal users. N
cpr.resetASTStateOnParse true If true, then call state().reset() on newly parsed AST roots. This property was introduced to work around JastAdd’s circular evaluation state not being reset. Normally, JastAdd tools are used on the terminal, where they compute something very briefly and then shut down. While computing, JastAdd maintains a “state” that tracks circular attribute evaluations. If attribute evaluation results in an exception being thrown, this state does not get correctly reset. Normally this is not a problem, since the JVM is likely to shut down after an exception. However, CodeProber will catch the exception, and keep using the same JVM state, meaning the incorrect circular state is retained. By leaving this property on true, CodeProber always resets the state “just in case”. N
cpr.verbose false Intended for increasing logging verbosity. Currently only affects --test. N