Edit mode lets you change multiple code files (Multi-file Edits). Use it when you need more granular control over the changes that Lingma suggests based on your requirements and development environment. In this mode, you can provide context with each step, choose to accept or reject the suggested edits after each turn, and get more code suggestions. This helps you complete coding tasks efficiently and with more control.
Edit mode is the original AI Developer module. To use Edit mode, update Lingma to version 2.5.0 or later in VS Code and JetBrains IDEs.
Edit mode offers the following core capabilities:
Project-level changes: Collaborates with developers to modify code files in the project based on task description. It also iterates on your project and makes step-by-step changes through multi-turn chats or reverting snapshots.
Precise editing: Changes are only made within the given context, making sure they match what you expect.
Fast execution: Strictly follows your task description and the given context to modify code files, without needing extra, complex planning. It works faster than Agent mode.
Tool use: Use tools to read file, search in projects, and edit files. This helps you make code changes faster.
Multi-file Edits
Edit mode helps you edit multiple files easily for a coding task. When using this mode, keep these tips in mind:
Clear requirement description: State which codes and rules need changes. Include a clear goal and a detailed, step-by-step description of the coding task.
Specify the required context: Choose the needed contexts such as code files, images, codebase, codeChanges, to clearly define the scope and requirements. This allows Lingma to better understand your intent and generate the best solutions and code.
Clear generation requirements: Explain what you want Lingma to follow when generating code modification suggestions. This includes the programming language, style, and format. For example, you can tell it "When generating changes, add English comments for each method." You can save these rules in Lingma Rules.
Make good use of the snapshot feature: If AI-generated content does not meet expectations or if your requirements change, use the snapshot feature to revert to previous chat turns and code changes. Continue your chat from there.
File-level unit test generation (UnitTest)
Unit test agent is a specialized capability of Edit mode that automates the unit test generation for code changes (#codeChanges) across single or multiple files. After you input the tested content and generation requirements, Lingma automatically generates test plans and test cases, compiles and runs the cases, and performs automatic fixes based on error messages. This leads to wider test coverage, higher test quality, and reduced human effort for creating the test cases.
Currently, this unit test generation and interaction method is only supported in IntelliJ IDEA.
Select 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. Then, enter the instructions. We recommend including the content related to the generation of unit test requirements. Submit your requirements and Lingma will automatically sense the intent and start the unit test generation process.
Select and confirm 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.
