FAQs for watsonx Code Assistant
Learn about watsonx Code Assistant.
What is watsonx Code Assistant?
IBM® watsonx™ Code Assistant is an innovative, generative AI coding companion that offers robust, contextually aware assistance for popular programming languages that include Go, C, C++, Java, JavaScript, Python, TypeScript, and more. Seamlessly integrated into your IDE, you can accelerate your productivity and simplify coding tasks, all with trust, security, and compliance.
How does watsonx Code Assistant integrate with my current development environment?
IBM watsonx Code Assistant seamlessly integrates with popular development environments like Visual Studio Code and Eclipse, so you can use your existing workflow.
For more information, see the documentation for your IDE:
What coding tasks can I do with watsonx Code Assistant?
You can use watsonx Code Assistant to:
- Get code suggestions
- Explain code
- Document code
- Generate unit tests
- Translate code from one language to another
- Get answers from IBM documentation
How do I get code suggestions?
Use chat conversations: Use natural language prompts to generate code suggestions. Use a chat conversation to enter a prompt that explains the code you need, and watsonx Code Assistant generates something you can choose to use.

Reference code: To ask questions or refine a specific file, class, function, or method in your workspace, you can use a code reference. These references provide important context and can help to increase the accuracy of the
answer. As part of your chat message, type the @
symbol to see a list of files, classes, and methods from your workspace. Click to select the reference, and watsonx Code Assistant sends the contents of the reference as part
of your message.

Code completion: Or, complete code in the editor. Start typing a line of code, then pause. IBM watsonx Code Assistant adds a code suggestion to complete the line that you typed.

You can also get a multiline code suggestion. Start typing a line of code, then use a keyboard shortcut, and watsonx Code Assistant adds a multiline code suggestion.

Or, enter a comment that describes the code you want.

For more information, see the documentation for Getting code suggestions.
How do I get a code explanation?
Use generative AI to analyze and summarize your code to understand what the code does. Click the Explain option that precedes a code block or enter /explain
in a chat conversation. IBM watsonx Code Assistant analyzes
the code and provides a detailed explanation of what the code does.
For more information, see the documentation for Explaining code.
How do I add code documentation?
Generate comment lines that document what your code does. Click the Document option that precedes a code block or enter /document
in a chat conversation. IBM watsonx Code Assistant analyzes the code and adds comments
that document what the code does.
For more information, see the documentation for Documenting code.
How do I generate unit tests?
Create unit tests to evaluate your code functions. Click the Unit Test option that precedes a code block or enter /unit-test
in a chat conversation. IBM watsonx Code Assistant analyzes the code and creates a unit
test.
For more information, see the documentation for Generating unit tests.
How do I translate code from one language to another?
Use watsonx Code Assistant to translate code. In a chat conversation, use the syntax translate [from <source language >] to <target_language> <code reference>
For more information, see the documentation for Translating code from one language to another.
How do I get answers from IBM documentation?
Use chat to ask questions that reference IBM and Red Hat product documentation.
The chat syntax is:
/docs [collection:<collection_name>] <your question>
The collection_name
is optional. If no collection is specified, ibm_docs
is used.
Available documentation collections are:
Collection | Source | URL reference |
---|---|---|
ibm_docs |
IBM Documentation | https://www.ibm.com/docs |
cloud_docs |
IBM Cloud Docs | https://cloud.ibm.com/docs/ |
redhat |
Red Hat Documentation | https://docs.redhat.com/products |
ibm_redbooks |
IBM Redbooks publications | https://www.redbooks.ibm.com/ |
support_docs |
IBM Support content | https://www.ibm.com/support/ |
general_technical_docs |
IBM Research and SecurityIntelligence | https://research.ibm.com/ and https://securityintelligence.com/articles |
For more information, see the documentation for Getting answers from IBM documentation
What are the built-in commands that I can use when I write prompts?
Use these built-in commands to start or construct a prompt:
Command | Description | For more information |
---|---|---|
@ |
Reference code in your workspace | Referencing code in your workspace |
/document |
Generate documentation for a referenced file or a method or a class in the active workspace | Generating documentation |
/docs |
Ask questions that reference IBM and Red Hat product documentation | Getting answers from IBM documentation |
/explain |
Use generative AI to analyze and summarize your code to understand what the code does | Explaining code |
/help |
Get quick assistance about tasks | Type /help in the chat |
/unit-test |
Generate unit tests for various programming languages | Generating unit tests |
/translate |
Translate code from one language to the other | Translating code |
Can I modernize or upgrade Enterprise Java applications?
Standard plan
For use with the Standard plan, IBM watsonx Code Assistant for Enterprise Java Applications adds features for Java application upgrades and modernization, and enhanced code explanation, unit test generation, and fixing Java unit tests.
Java runtime modernization
Analyze your Java application runtime and modernize it to a more lightweight, flexible, and efficient runtime. Receive a prescriptive plan that describes the changes that are needed to modernize your application, with a detailed assessment of complexity and required development effort. Use automation to quickly implement code and configuration changes. Transform code with generative Al assistance to resolve more complex issues.
For more information, see the documentation for Modernizing Java applications.
Java version upgrade
Identify changes required to upgrade Java code, automatically apply fixes, and use generative AI to transform Java code. Receive a prescriptive plan that describes the changes that are needed to upgrade your application, with a detailed assessment of complexity and required development effort. Use automation to quickly implement code and configuration changes. Transform code with generative Al assistance to resolve more complex issues.
For more information, see the documentation for Upgrading the Java version for your application.
Explain Java applications
With the Standard plan, you can generate an explanation of your Java application. For more information, see the documentation for Explaining Java applications.
Generate and fix Java unit tests
Use generative AI to create tests that help maintain critical application functions. With the Standard plan, create enhanced unit tests to evaluate your code functions. You can also use generative AI to fix Java unit tests.
For more information, see the documentation for Generating unit tests and Fixing unit tests.
How does watsonx Code Assistant differentiate between similar code contexts to avoid incorrect suggestions?
IBM watsonx Code Assistant uses context-aware generation, meaning it analyzes surrounding code, function names, parameters, and even previous edits to tailor suggestions. This minimizes out-of-context completions and improves relevance, especially in complex or multi-module applications.
How scalable is watsonx Code Assistant for larger projects or teams?
IBM watsonx Code Assistant is available in both on-premises and on SaaS models that provide you with the flexibility you need. It's highly scalable and suitable for individual developers and large teams that work on complex projects.
For more information, see the documentation:
What security features does watsonx Code Assistant include to help ensure the safety and integrity of my code?
IBM watsonx Code Assistant is built on IBM Granite models and includes robust security features, such as IP indemnity, code similarity checks, and hardware-accelerated transparent memory encryption to protect your organization's intellectual property and help ensure code integrity.
Where are my chat conversations stored?
IBM watsonx Code Assistant stores all your chat conversations locally in your file system under <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.
Does watsonx Code Assistant collect telemetry data?
IBM watsonx Code Assistant does not collect any telemetry data. In general, watsonx Code Assistant does not send any data that it processes to a third party, IBM included.
What are the pricing plans, and what does each plan include?
IBM offers flexible pricing plans, including subscription-based options for different budgetary needs. Refer to the plan listings in the IBM Cloud catalog.
Which programming languages are supported by watsonx Code Assistant?
IBM watsonx Code Assistant supports 116 programming languages, including Python, Java, C, C++, Go, JavaScript, and TypeScript.
How does watsonx Code Assistant support enterprise innovation at scale?
By removing routine friction in the development process, like writing boilerplate, onboarding new devs, and maintaining code quality, watsonx Code Assistant enables teams to focus more on business logic and experimentation.
How does watsonx Code Assistant maintain code consistency across a distributed development team?
IBM watsonx Code Assistant promotes consistency by generating code that is aligned with shared organizational patterns, such as naming conventions, architecture standards, and commenting styles. By grounding watsonx Code Assistant with your team’s existing repositories and by using watsonx Code Assistant within IDEs integrated with version control systems, teams can reduce mistakes and rework during code reviews.
What data sources are used to train the watsonx Code Assistant models?
The watsonx Code Assistant models gather training data from various sources depending on which platform it's supporting. For more information, see IBM watsonx Code Assistant model details
Can I provide feedback about the models?
You can provide feedback on your experiences, including suggestions for when your results don't match your expectations. For more information about providing feedback, see the IBM Data and AI Ideas Portal for Customers.