This documentation applies to the on-premises installation of watsonx Code Assistant on IBM Software Hub. For IBM Cloud documentation, see Installing the extension for Visual Studio Code.
Installing the extension for Visual Studio Code
Create an API key and add the watsonx Code Assistant extension to your Microsoft Visual Studio Code editor.
Compatibility
The extension is compatible with Visual Studio Code 1.86.x and later.
Before you begin
To set up your extension, you need these items from your IBM Software Hub administrator:
- URL of your organization's instance of IBM Software Hub instance
- An IBM Software Hub username
Create a platform API key on IBM Software Hub
Each developer uses a personal API key to log in to the extension.
To create a platform API key, follow the instructions in Generating API keys for authentication.
Install the extension
You can install the plug-in from the Visual Studio Marketplace or from within your Visual Studio Code editor.
From the Visual Studio Marketplace
To install from the Visual Studio Marketplace:
-
Choose the installation for the type of work that you plan to do:
- For integrated generative AI for code suggestions, code explanations, code documentation, and unit tests, open the watsonx Code Assistant page in the Visual Studio Marketplace.
- To add enterprise Java modernization capabilities, enhanced code explanation, and enhanced unit test generation, open the watsonx Code Assistant for Enterprise Java Applications page in the Visual Studio Marketplace.
-
Click Install on the Marketplace page.
-
In Visual Studio Code, click Install on the extension.
From the Visual Studio Code editor
To install from your Visual Studio Code editor:
-
In your Visual Studio Code editor, click the Extensions icon.
-
Choose the installation for the type of work that you plan to do:
- For integrated generative AI for code suggestions, code explanations, code documentation, and unit tests, search for
watsonx Code Assistant. - To add enterprise Java modernization capabilities, enhanced code explanation, and enhanced unit test generation, search for
watsonx Code Assistant for Enterprise Java Applications.
- For integrated generative AI for code suggestions, code explanations, code documentation, and unit tests, search for
-
Select the extension that you need, then click Install.
Update settings with IBM Software Hub URL and username
You need to add the IBM Software Hub URL and username to the extension settings. Contact your IBM Software Hub administrator for help.
-
In Visual Studio Code, open the extension settings for watsonx Code Assistant.
-
In Wca: Api Url, enter the URL for your organization's instance of IBM Software Hub.
-
In Wca: User Name, enter your IBM Software Hub username.
-
Restart the extension to apply the changes.
Open the extension
To open watsonx Code Assistant:
-
Click the watsonx Code Assistant icon
.
-
Click Log in, then enter your IBM Software Hub platform API key.
Set up your enterprise Java environment
If you 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.
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:
-
In Visual Studio Code, click View, then click Output.
-
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:
-
In Visual Studio Code, open the extension settings for watsonx Code Assistant.
-
In Wca: Log level, switch from the default of
INFOto another setting such asWARN.
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:
-
In Visual Studio Code, click the Extensions icon to open the panel.
-
Click the watsonx Code Assistant extension.
-
Click Disable or Uninstall.