Chapter 5. Using MTA with Developer Lightspeed in IDE
You must configure the following settings in Red Hat Developer Lightspeed for migration toolkit for applications:
- Visual Studio Code IDE settings.
- Profile settings that provide context before you request a code fix for a particular application.
5.1. Configuring the Red Hat Developer Lightspeed for MTA IDE settings Copy linkLink copied to clipboard!
After you install the MTA extension in Visual Studio (VS) Code, you must provide your large language model (LLM) credentials to activate Red Hat Developer Lightspeed for MTA settings in Visual Studio (VS) Code.
Red Hat Developer Lightspeed for MTA settings are applied to all AI-assisted analysis that you perform by using the MTA extension. The extension settings can be broadly categorized into debugging and logging, Red Hat Developer Lightspeed for MTA settings, analysis related settings, and Solution Server settings.
Prerequisites
In addition to the overall prerequisites, you have configured the following:
- You completed the Solution Server configurations in Tackle custom resource if you opt to use the Solution Server.
Procedure
Go to the Red Hat Developer Lightspeed for MTA settings in one of the following ways:
-
Click
Extensions > MTA Extension for VSCode > Settings
-
Type
Ctrl + Shift + P
orCmd + Shift + P
on the search bar to open the Command Palette and enterPreferences: Open Settings (UI)
. Go toExtensions > MTA
to open the settings page.
-
Click
- Configure the settings described in the following table:
Settings | Description |
---|---|
Log level |
Set the log level for the MTA binary. The default log level is |
Analyzer path | Specify an MTA custom binary path. If you do not provide a path, Red Hat Developer Lightspeed for MTA uses the default path to the binary. |
Auto Accept on Save | This option is enabled by default. When you accept the changes suggested by the LLM, the updated code is saved automatically in a new file. Disable this option if you want to manually save the new file after accepting the suggested code changes. |
Gen AI:Enabled | This option is enabled by default. It enables you to get code fixes by using Red Hat Developer Lightspeed for MTA with a large language model. |
Gen AI: Agent mode | Enable the experimental Agentic AI flow for analysis. Red Hat Developer Lightspeed for MTA runs an automated analysis of a file to identify issues and suggest resolutions. After you accept the solutions, Red Hat Developer Lightspeed for MTA makes the changes in the code and re-analyzes the file. |
Gen AI: Excluded diagnostic sources |
Add diagnostic sources in the |
Cache directory | Specify the path to a directory in your filesystem to store cached responses from the LLM. |
Trace directory | Configure the absolute path to the directory that contains the saved LLM interaction. |
Trace enabled | Enable to trace MTA communication with the LLM model. Traces are stored in the trace directory that you configured. |
Demo mode |
Enable to run Red Hat Developer Lightspeed for MTA in demo mode that uses the LLM responses saved in the |
Solution Server:URL |
Edit the configurations for the Solution Server in
|
Debug:Webview | Enable debug level logging for Webview message handling in VS Code. |
See Configuring the solution server settings for an example Solution Server configuration.
5.2. Configuring the Solution Server settings Copy linkLink copied to clipboard!
You need a Keycloak realm and the Solution Server URL to connect Red Hat Developer Lightspeed for MTA extension with the Solution Server.
Prerequisites
- The Solution Server URL is available.
- An administrator configured the Keycloak realm for the Solution Server.
Procedure
-
Type
Ctrl + Shift + P
orCmd + Shift + P
on the search bar and enterPreferences:Open User Settings (JSON)
. -
In the
settings.json
file, enterCtrl + SPACE
to enable the auto-complete for the Solution Server configurable fields. Modify the following configuration as necessary:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteWhen you enable Solution Server authentication for the first time, you must enter the
username
andpassword
in the VS Code search bar.TipEnter
MTA: Restart Solution Server
in the Command Palette to restart the Solution Server.
5.3. Configuring the Red Hat Developer Lightspeed for MTA profile settings Copy linkLink copied to clipboard!
You can use the Visual Studio (VS) Code plugin to run an analysis to discover issues in the code. You can optionally enable Red Hat Developer Lightspeed for migration toolkit for applications to get AI-assisted code suggestions.
To generate code changes using Red Hat Developer Lightspeed for MTA, you must configure a profile that contains all the necessary configurations, such as source and target technologies and the API key to connect to your chosen large language model (LLM).
Prerequisites
- You completed the Solution Server configurations in Tackle custom resource if you opt to use the Solution Server.
- You opened a Java project in your VS Code workspace.
Procedure
Open the
MTA View Analysis
page in either of the following ways:-
Click the book icon on the
MTA: Issues
pane of the MTA extension. -
Type
Ctrl + Shift + P
orCmd + Shift + P
on the search bar to open the Command Palette and enterMTA:Open Analysis View
.
-
Click the book icon on the
Click the settings button on the
MTA View Analysis
page to configure a profile for your project. TheGet Ready to Analyze
pane lists the following basic configurations required for an analysis:Verification
After you complete the profile configuration, close the
Get Ready to Analyze
pane. You can verify that your configuration works by running an analysis.
Profile settings | Description |
---|---|
Select profile | Create a profile that you can reuse for multiple analyses. The profile name is part of the context provided to the LLM for analysis. |
Configure label selector | A label selector filters rules for analysis based on the source or target technology. Specify one or more target or source technologies (for example, cloud-readiness). Red Hat Developer Lightspeed for MTA uses this configuration to determine the rules that are applied to a project during analysis. If you mentioned a new target or a source technology in your custom rule, you can type that name to create and add the new item to the list. Note You must configure either target or source technologies before running an analysis. |
Set rules | Enable default rules and select your custom rule that you want MTA to use for an analysis. You can use the custom rules in addition to the default rules. |
Configure generative AI |
This option opens the |
See for Configuring LLM provider settings to complete the LLM provider configuration.