Next Edit Suggestion

更新时间:
复制 MD 格式

Next Edit Suggestion (NES) dynamically predicts your next code change based on full code context, recent edits, and cursor position. Press Tab to apply the suggested change.

Important

NES is available only in JetBrains IDEs and Qoder CN IDE. Upgrade Qoder CN to v2.5.4 or later in JetBrains, or follow the installation guide.

Enable Next Edit Suggestion

JetBrains IDE

  1. Go to Settings > Qoder CN. Under NES Settings, select Enable NES (Next Edit Suggestion). This feature is disabled by default. When enabled, suggestion mode defaults to auto and code shifting defaults to No.image - 2025-05-27T133022

  2. Three suggestion modes are available: inline, side by side, and auto. Code shifting applies only in inline and auto modes, and controls whether existing code shifts to accommodate suggestions.

Qoder CN IDE

In the upper-right corner of Qoder CN IDE, click the user iconimage or use the keyboard shortcut (  , on macOS or Ctrl shift , on Windows), select Settings, and enable Next Edit Suggestion (NES).

Important

Qoder CN IDE supports only auto mode, which automatically switches between inline and side-by-side display based on context.

  • auto (default): Dynamically switches between inline and side by side. Uses inline when the combined pixel width of the change and suggestion exceeds the visible editor area; otherwise uses side by side.

  • inline: Displays suggestions directly within your code. Whether existing code shifts or the suggestion appears as an overlay depends on the code shifting setting.

    Action

    Description

    Effect

    Deletion

    Single or multiple inline deletions. A word, characters within a word, or consecutive words are treated as a single deletion.

    image - 2025-05-29T094624

    Delete single or multiple lines.

    image - 2025-05-29T095012

    Modification

    A single inline modification (word, characters, or consecutive words) is displayed as a word-level or phrase-level change.

    image - 2025-05-29T095340

    Modification within a single line is displayed as an inline, character-level diff.

    • With code shifting (creates space)image - 2025-05-29T100214

    • Without code shifting (displays as an overlay)image - 2025-05-29T100513

    Modifications across multiple consecutive lines are displayed as an inline, character-level diff.

    • With code shifting (creates space)image - 2025-05-29T100640

    • Without code shifting (displays as an overlay)image - 2025-05-29T100935

    Addition

    Add a single line.

    • With code shifting (creates space)image - 2025-05-29T101051

    • Without code shifting (displays as an overlay)image - 2025-05-29T101152

    Add multiple consecutive lines.

    • With code shifting (creates space)image - 2025-05-29T101246

    • Without code shifting (displays as an overlay)image - 2025-05-29T101351

  • side by side: Displays suggestions in a diff view alongside your code.

    Action

    Description

    Effect

    Deletion

    Single or multiple inline deletions. A word, characters within a word, or consecutive words are treated as a single deletion.

    image - 2025-05-29T094624

    Delete single or multiple lines.

    image - 2025-05-29T095012

    Modification

    A single inline modification (word, characters, or consecutive words) is displayed as a word-level or phrase-level change.

    image - 2025-05-29T095340

    Single or multi-line modifications.

    image - 2025-05-29T101622

    Addition

    Add single or multiple lines. The suggestion appears at the target line number, with an arrow positioned between the previous and target lines.

    image - 2025-05-29T101709

Use cases

  • Interact with suggestions: Hover over the accept button to open the Qoder CN NES menu, then click accept or reject. You can also press Tab to accept or Esc to reject. Click Settings to adjust preferences.

  • Navigate to out-of-view suggestions in the same file: If the next suggestion is outside the current viewport, aimage button appears. Click it or press Tab to jump to the suggestion.

  • Navigate to suggestions in other files: If the next suggestion is in a different file, aimage button appears. Click it or press Tab to open that file and jump to the suggestion.

Common NES use cases in JetBrains IDEs:

Rename

When you rename a parameter, NES suggests updating all related occurrences in the current context.

image - 2025-05-27T143541

Refactor

NES suggests optimizations and refactoring for existing code within a function.image - 2025-05-27T163614

Add variables, fields, parameters, or comments

Add a variable

When you add a variable inside a code block, NES suggests updates to subsequent code that accesses that variable.

image - 2025-05-27T154509

Add a field

After adding an annotation to a field, NES suggests adding the same annotation to other relevant fields.

image - 2025-05-27T154213

Add a parameter

When you add a parameter to a function, NES suggests adding it to all call sites for that function.

image - 2025-05-27T161224

Add a comment

Type / at the target location to trigger a comment suggestion. Press Ctrl + to accept the current inline suggestion.

image - 2025-05-27T160132