Edit mode supports multi-file modifications, enabling precise updates across multiple files based on your requirements and the current project environment. It facilitates iterative changes and code reviews, helping you complete code modification tasks efficiently and controllably.
Edit mode is available for Visual Studio Code only, not supported for Lingma IDE and JetBrains IDE plug-in.
Edit mode is the original AI Developer module. To use Edit mode, update Lingma to V2.5.0 or later in VS Code and JetBrains IDEs.
Edit mode offers the following core capabilities:
Project-level changes: Enables modification of multiple code files within a project based on the task description. Through multi-turn conversations, code optimization or snapshot rollbacks can be achieved to complete tasks more efficiently.
Precise editing: Ensures that code modifications are strictly limited to the context provided, with no changes made beyond the specifications.
Fast execution: Adheres closely to the task description and provided context, allowing for rapid code edits without requiring complex task planning. Compared to Agent mode, Edit mode completes tasks faster.
Tool use: Supports the use of tools such as file reading, in-project semantic search, and file editing, enabling developers to efficiently accomplish code modifications.
Multi-file edits
Edit mode lets you efficiently modify multiple files. When using Edit mode, it is recommended to follow these best practices:
Provide clear requirement descriptions: Begin by clarifying which code needs to be modified, then list your specific requirements, including a well-defined objective and structured, step-by-step descriptions of task expectations.
Specify necessary context: Select contextual resources such as relevant code files, images, codebases, and code changes to clearly define the scope, requirements, and references for the modifications. Providing comprehensive context allows Lingma to better understand your intent and generate optimal solutions and code suggestions.
Define generation criteria: Clearly communicate any requirements Lingma should follow when generating code modification suggestions, such as programming language, coding standards, format, or specific change objectives (for example, "Add comments to each method when generating changes"). Project-wide requirements can also be configured and saved in the Lingma rules file. For more details, refer to Rule settings.
Utilize the snapshot feature: If the AI-generated content does not meet your expectations, or your requirements change, use the snapshot feature to revert to previous conversation steps and code states. This allows you to iterate and refine your requests.
File-level unit test generation (UnitTest)
The unit test is a specialized capability that enables batch creation of unit test files for code changes, as well as for single or multiple code files. Provide the code to be tested along with your requirements, and Lingma will automatically create test plans, generate and run test cases, and perform automated fixes based on error messages.
Currently, this unit test generation and interaction method is only supported in IntelliJ IDEA.
Select the code to be tested and enter requirements
Open the AI Chat panel and switch to Edit mode.
Click ➕ in the input box or type
#to select the relevant context.Enter the instructions. We recommend including the content related to the generation of unit test requirements.
Submit your requirements. Lingma will automatically sense the intent and start the unit test generation process.
Select and confirm an environment
After receiving the test requirements, Lingma automatically detects local environment information, such as Java version, build tools, test frameworks, and mock frameworks. If multiple versions are detected, choose the required one. If Lingma cannot identify the version, an error message is displayed. Click How to Fix to learn more about how to configure the relevant components.

Confirm the method to be tested
After the environment check is passed, Lingma automatically analyzes the files to be tested, and generates a test plan. Select the methods that you want to test, and click Confirm to finalize the test scope. Lingma then generates unit test cases for each selected method.
Select at least 1 and no more than 20 methods for a single test case generation operation.
After you select a method, you are prompted with the estimated time required for the overall build process for reference.

View the generation progress
After you confirm the method to be tested, Lingma automatically generates unit test cases based on your selected method, then compiles, runs, and fixes the generated results. The final result is displayed in the interface. The following table describes the statuses given in the final result.
Status | Description |
| Indicates passed test cases |
| Indicates test cases that passed compilation but failed at runtime |
| Indicates test cases that failed to compile |

When all method test cases are generated, Lingma automatically merges the test cases that passed compilation and execution into the final test case file, and automatically names it based on the tested file. For test case code that failed to compile, you can choose whether to keep the code. After all the test case code is confirmed, click Confirm. Then, the test case file is automatically compared with the original test case file.

Review and accept the code of a test case file
After you confirm, the test case file appears in the Working Space. Click Diff in the Working Space or click a file from the file list to view the differences in the Diff View. You can then review, modify, accept, or reject the code. After you confirm all code changes, click Accept. The modified code in the test case file is integrated into the current code project.
