Chapter 4. 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.
4.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 analyses 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 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 + PorCmd + Shift + Pon the search bar to open the Command Palette and enterPreferences: Open Settings (UI). Go toExtensions > MTAto open the settings page.
-
Click
Configure the settings described in the following table:
Expand Table 4.1. Red Hat Developer Lightspeed for MTA extension settings Settings Description Log level
Set the log level for the MTA binary. The default log level is
debug. The log level increases or decreases the verbosity of logs.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
settings.jsonfile. The issues generated by such diagnostic sources are excluded from the automated Agentic AI analysis.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
cachedirectory for analysis.Debug:Webview
Enable debug level logging for Webview message handling in VS Code.
4.2. 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 Analysispage in either of the following ways:-
Click the book icon on the
MTA: Issuespane of the MTA extension. -
Type
Ctrl + Shift + PorCmd + Shift + Pon 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 Analysispage to configure a profile for your project. TheGet Ready to Analyzepane lists the following basic configurations required for an analysis:Verification
After you complete the profile configuration, close the
Get Ready to Analyzepane. 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 Configuring LLM provider settings to complete the LLM provider configuration.