IBM Cloud Docs
Installing the extension for Visual Studio Code

Installing the extension for Visual Studio Code

watsonx Code Assistant

Create an API key and add the watsonx Code Assistant extension to your Microsoft Visual Studio Code editor.

Create an API key on IBM Cloud

Instead of a username and password, each developer uses a personal API key to log in.

To create an API key:

  1. Log in to IBM Cloud API Keys

    Ensure you are using the IBM Cloud account where your organization's instance of watsonx Code Assistant is provisioned.

  2. Click Create.

  3. Enter IBM watsonx Code Assistant API key as the name for your API key. Optionally, enter a description.

  4. Click Create.

  5. Click Download or Copy and store the API key in a safe location.

    The key is only available for 296 seconds. Make sure to store it somewhere where you can find it later.

Install the extension

Choose the installation for the plan that you are using.

The following table lists the plan, a description of the plan, and a link to the extension.

Plan descriptions
Plan Description Extension name
Trial plan Limited free trial with integrated generative AI chat for code watsonx Code Assistant
Essentials plan Integrated generative AI for code suggestions, code explanations, code documentation, and unit tests watsonx Code Assistant
Standard plan All the features of the Essentials plan, plus enterprise Java modernization capabilities, enhanced code explanation, and enhanced unit test generation watsonx Code Assistant for Enterprise Java Applications

For complete plan details, see:

Standard plan For the Standard plan installation, two entries appear in your Visual Studio Code Extensions panel, one for watsonx Code Assistant and one for watsonx Code Assistant for Enterprise Java Applications. The two extensions are dependencies for this installation.

From the Visual Studio Marketplace

To install from the Visual Studio Marketplace:

  1. Choose the installation for the plan that you are using.

    The following table lists the plan, a description of the plan, and a link to install the extension.

  2. Click Install on the Marketplace page.

  3. In Visual Studio Code, click Install on the extension.

From the Visual Studio Code editor

To install from your Visual Studio Code editor:

  1. In your Visual Studio Code editor, click the Extensions icon.

  2. Choose the installation for the plan that you are using:

    • Trial plan Essentials plan To install for Trial and Essentials plans, search for watsonx Code Assistant.
    • Standard plan To install for the Standard plan, search for watsonx Code Assistant for Enterprise Java Applications
  3. Select the extension that you need, then click Install.

Open the extension

To open watsonx Code Assistant:

  1. Click the watsonx Code Assistant icon watsonx Code Assistant icon.

  2. Click Log in, then enter your IBM watsonx Code Assistant API key.

Set up your enterprise Java environment

Standard plan If you're using the Standard plan and want to work with enterprise Java applications, you need to set up your environment. For more information, see Setting up your enterprise Java environment.

Secure your setup

IBM watsonx Code Assistant doesn't provide any additional security controls. Use these steps to properly secure your setup.

Your Visual Studio Code environment

Apply all Visual Studio Code updates to help ensure you have the latest security and bug fixes. For more information, see the Microsoft Documentation.

The watsonx Code Assistant extension logs are stored in *.log files under <your home directory>/.wca. These files are not encrypted, other than the encryption that your file system provides. Safeguard the logs against improper access.

Chat conversation storage

IBM watsonx Code Assistant stores all your chat conversations locally in your file system in <your home directory>/.wca/chat.db, in a database format defined by SQLite. IBM watsonx Code Assistant does not share these conversations with anyone. This file is not encrypted, other than the encryption that your file system provides. Safeguard this file against improper access.

Telemetry data

IBM watsonx Code Assistant does not collect any telemetry data. In general, watsonx Code Assistant doesn't send any data that it processes to a third party, IBM included.

Log out of your API key

If necessary, you can log out of your API key. Logging out and reentering your API key might help with any authentication issues you might encounter.

To log out:

  1. In Visual Studio Code, click the Accounts icon.

  2. Click the Your Name (WCA API Key) setting, then click Sign out.

Use the Output view to see activity details

You can use the Output view of Visual Studio Code to see details about what the extension is doing and logging, and check for any errors.

To open the Output view:

  1. In Visual Studio Code, click View, then click Output.

  2. In the Output view, use the dropdown menu to select WCA or WCA Language Server. Both provide more details about what the extension is doing.

To adjust the Output view and logging for the Visual Studio Code extension:

  1. In Visual Studio Code, open the extension settings for watsonx Code Assistant.

  2. In Wca: Log level, switch from the default of INFO to another setting such as WARN.

Disable or uninstall the extension

If necessary, you can disable the extension and keep it installed, or you can uninstall it completely.

To disable or uninstall the extension:

  1. In Visual Studio Code, click the Extensions icon to open the panel.

  2. Click the watsonx Code Assistant extension.

  3. Click Disable or Uninstall.