Next Edit Suggestion (NES) predicts the next edits using the current code context, combined with the code changes and cursor position. This function helps developers make changes quickly by just pressing the Tab key.
Next Edit Suggestion (NES) is currently available in JetBrains IDEs and Lingma IDE. To get started, upgrade Lingma to V2.5.4 or later in JetBrains IDEs, or download Lingma IDE.
What is Lingma NES?
Lingma NES can:
Suggest the next edits near your cursor.
Display the suggestions either inline or side by side.
Lingma automatically displays suggestions based on the pixel widths of the changed code and the NES prompt. If they exceed the width of your editor, NESs are displayed inline. Otherwise, suggestions are displayed side by side. You can also set NES to be always displayed either inline or side by side.
To accept or reject these suggestions, hover the cursor over the Accept/Reject button or press the Tab/Esc keys.
If the next edit is outside your current view, click the
button or press the Tab key to go to the edit spot in the same file. For changes to other files, click the
button or press the Tab key to navigate to the edit spot of the target file.
Enable NES
In the IDE, select , and enable Enable NES (Next Edit Suggestion) under NES Settings.
By default, this feature is disabled. Once enabled, Suggested mode is set to Auto, and Code shifting is set to No. 
Suggestion mode: Inline, Side by Side, and Auto.
Auto: This default mode dynamically switches between Inline and Side by Side: When the pixel width of the changed code plus that of the NES prompt exceeds the width of the editor's visible area, it displays Inline. Otherwise, it displays Side by Side.
Inline: In this mode, inline suggestions are presented at the exact location of your cursor or where the code is being edited. In Inline or Auto mode, Code shifting will be displayed. If Code shifting is set to yes, your code will automatically shift up or down to create space for inline code suggestions. The following table lists some common actions and their visual effects:
Action
Description
Effect
Delete
Delete code inline.
Words, letters, and phrases are each considered individual deletions, and displayed as a diff.

Delete entire lines.

Modify
Single inline modification.
Words, letters, and phrases are each considered individual modifications.
Diffs are displayed at the word or phrase level.

Modification in a line.
Words, letters, and phrases are each considered individual modifications.
Inline diffs are displayed at the character level.
Block-level change with space-occupying effect. Changes cause the layout to shift by inserting blank lines or space.

Overlay change with non-space-occupying effect. Changes are displayed as hints or overlays without affecting the surrounding layout.

Modification across lines.
Inline diffs are displayed at the character level.
Block-level change with space-occupying effect.

Overlay change with non-space-occupying effect.

Add
Add a single line.
Block-level change with space-occupying effect.

Overlay change with non-space-occupying effect.

Add multiple consecutive lines.
Block-level change with space-occupying effect.

Overlay change with non-space-occupying effect.

Side by Side: This mode displays code suggestions side by side. The following table lists some common actions and their visual effects:
Action
Detail
Effect
Delete
Delete code inline.
Words, letters, and phrases are each considered individual deletions, and displayed as a diff.

Delete entire lines.

Modify
Single inline modification.
Words, letters, and phrases are considered one modification.
Diffs are displayed at the word or phrase level.

Single line or multiple line modifications.

Add
Add single or multiple lines.
Suggestion appears at the line number where insertion is needed, with an arrow aligned between the previous line number and the target line number.

Accept suggestions
Interaction: Hover your cursor over the code suggestion to display the Lingma NES menu bar. In the menu bar, click the Accept/Reject button or press the
Tab/Esckeys on the keyboard to accept or reject the changes.Change settings: You can also click Settings to change how the code suggestions are displayed.
Same file navigation: If the position of next edit suggestion is outside the current view, click the
button or press the Tabkey to go to the edit spot in the same file.Cross file navigation: If the position of next edit suggestion is outside the current view, and not in the current file, click the
button or press the Tabkey to go to the edit spot in the target file.
Scenarios
Here are some common scenarios that demonstrate how Lingma NES can improve your coding efficiency.
Renaming variables
Lingma NES can automatically suggest variable names based on the current code context.

Refactoring
Lingma NES can generate code optimization and refactoring suggestions in functions.
Adding variables, fields, parameters, and comments
Adding variables
When you define a new variable in a code block, Lingma NES will predict how that variable is used in the rest of the code.

Adding fields
When you add an annotation to a field, Lingma NES will predict and apply the same or related annotations to subsequent fields.

Adding parameters
When you add new parameters to a function, Lingma NES will add these parameters in all places where the function is called.

Adding comments
Type / to trigger comment suggestion. Press Ctrl + ↓ to accept the inline suggestion.
