Configuring

Learn how to configure the IBM® watsonx Code Assistant™ for Z Understand Visual Studio Code extension.

Setting the logging level

The Z Understand channel in the Output panel provides logging information for the Z Understand extension. To set the logging level, complete the following steps:
  1. Open the Visual Studio Code Command Palette by selecting View > Command Palette from the Visual Studio Code menu.
  2. Enter Preferences: Open User Settings in the command palette.
  3. Search for IBM watsonx Code Assistant for Z to locate the extension settings.
  4. Select the required logging level from Z Understand > Logging: Level.

Setting the Z Understand server address

The IBM watsonx Code Assistant for Z Visual Studio Code extension must be configured with the URL of the Refactoring services. To configure the server, complete the following steps:
  1. Open the Visual Studio Code Command Palette by selecting View > Command Palette from the Visual Studio Code menu.
  2. Enter Preferences: Open User Settings in the command palette.
  3. Search for IBM watsonx Code Assistant for Z to locate the extension settings.
  4. Enter the URL of the Refactoring services as the Z Code Assistant > Understand: URL property value.

Managing certificates

If your Refactoring services uses an untrusted or self-signed certificate, you must add the refactoring-assistant-ui.crt from the Refactoring services to the trust chain of your operating system.
  • On MacOS, double-click the certificate to install it by using the Keychain Access tool. In the same tool, change the certificate’s trust setting to Always Trust.
  • On Windows, double-click the certificate to install it by using the Certificate MMC snap-in. For self-signed certificates, make sure that it is installed to Trusted Root Certification Authorities folder.
If the certificate is signed by intermediate or root certificate authorities that are unknown to the operating system, you must complete the following additional steps:
  1. Add the intermediate and root certificates to the trust chain of your operating system.
  2. Save the certificate chain as a file in PEM format, arranging the certificates' information in a hierarchical order so that the trusted root certificate details appear at the end of the file. Then, set the absolute path to the PEM file as the value of the Z Code Assistant > Understand: Certificate setting.
Note: A certificate chain is a sequence of digital certificates where each certificate is validated by the subsequent one, connecting to a trusted root certificate. It ensures the authenticity of the certificate by linking it to a trusted authority.
Note: A PEM (Privacy-Enhanced Mail) format certificate is a Base64-encoded text file that contains cryptographic keys, certificates, or related information. It is commonly used for SSL certificates and has a file extension such as .pem, .crt, or .key.

Enabling experimental features

2.1.0+
If you are interested in accessing and testing new features before they are officially released, complete the following steps to enable experimental features:
  1. Open the Visual Studio Code Command Palette by selecting View > Command Palette from the Visual Studio Code menu.
  2. Enter Preferences: Open User Settings in the command palette.
  3. Search for IBM watsonx Code Assistant for Z Understand to locate the extension settings.
  4. Select the Z Understand: Experimental Features checkbox.

Enabling the Code Generation Hints: Cursors feature

The Code Generation Hints: Cursors feature inserts SQL cursor declarations as additional comments to generated code, which helps to improve the quality of the resulting Java™ code after transformation. To enable the feature, complete the following steps:
  1. Open the Visual Studio Code Command Palette by selecting View > Command Palette from the Visual Studio Code menu.
  2. Enter Preferences: Open User Settings in the command palette.
  3. Search for IBM watsonx Code Assistant for Z Understand to locate the extension settings.
  4. Select the z Understand > Code Generation Hints: Cursors checkbox.
For your reference, see the following sample-generated code with the SQL cursor declarations when the Code Generation Hints: Cursors feature is enabled.
The image shows sample generated code with the SQL cursor declarations.

Setting the authentication callback port

Z Understand authentication is processed in a web browser, which redirects to Visual Studio Code after login. The Z Code Assistant > Understand > : Callback Port Visual Studio Code settings determine the local port to monitor for this redirect. To configure the callback port, complete the following steps:
  1. Open the Visual Studio Code Command Palette by selecting View > Command Palette from the Visual Studio Code menu.
  2. Enter Preferences: Open User Settings in the command palette.
  3. Search for IBM watsonx Code Assistant for Z Understand to locate the extension settings.
  4. If you configure Z Understand, then enter the local port that is available as the Z Code Assistant > Understand: Callback Port property value. If you are using an earlier version of Z Understand, then verify the redirect port with your administrator.

Generating Request and Response Copybooks 2.5.0+

Z Understand generates request and response copybooks for the generated service. The request copybook outlines the input parameters that are required for the service, while the response copybook defines the output produced by the service. To enable copybook generation, complete the following steps:
  1. Open the Visual Studio Code Command Palette by selecting View > Command Palette from the Visual Studio Code menu.
  2. Enter Preferences: Open User Settings in the command palette.
  3. Search for IBM watsonx Code Assistant for Z Understand to locate the extension settings.
  4. Select the Z Understand > Generate Request Response Copybooks.

Copying a source while requesting a code explanation

Remote source files must be copied to the local workspace when you perform a code explanation. The Copy On Explain setting determines whether you are prompted on each code explanation request. To ensure the remote source is always copied, complete the following steps:
  1. Open the Visual Studio Code Command Palette by selecting View > Command Palette from the Visual Studio Code menu.
  2. Enter Preferences: Open User Settings in the command palette.
  3. Search for IBM watsonx Code Assistant for Z Understand to locate the extension settings.
  4. Select the Z Understand: Copy On Explain checkbox.