Skip to main content
Editor

Next Edit Suggestion

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.
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
  • Qoder CN 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.
    img
img
  1. Three suggestion modes are available: Inline, Side by Side, and Auto. When you choose Inline or Auto, the Code Shifting option becomes available; it is not shown for Side by Side. Code Shifting controls whether existing code shifts to make room for the suggestion. Select the mode that fits your needs based on the descriptions below:
  • Auto (default): Auto mode dynamically switches between Inline and Side by Side. When the combined pixel width of the changed code and the NES suggestion exceeds the visible editor area, it uses Inline; otherwise it uses Side by Side.
  • Inline: When NES is enabled and set to Inline, the display behavior depends on whether code shifting (moving code to make room between lines) is enabled. Specific behaviors:
    ActionOperationEffect
    Deletion onlySingle or multiple inline deletions (a word, characters within a word, or consecutive words all count as one).
    Single or multiple inline deletions
    Delete a single line or multiple lines.
    Single-line or multi-line deletion
    ModificationA single inline modification (word, characters within a word, or consecutive words all count as one), displayed as a word-level or phrase-level change.
    Single inline modification
    Modification within a single line, shown as an inline top-and-bottom diff view at character level.

    With code shifting (inserts a blank line)

    Single-line modification with code shifting

    Without code shifting (overlay effect)

    Single-line modification without code shifting
    Modifications across multiple consecutive lines, shown as an inline top-and-bottom diff view at character level.

    With code shifting (inserts a blank line)

    Multi-line modification with code shifting

    Without code shifting (overlay effect)

    Multi-line modification without code shifting
    Addition onlyAdd a single line.

    With code shifting (inserts a blank line)

    Single-line addition with code shifting

    Without code shifting (overlay effect)

    Single-line addition without code shifting
    Add multiple consecutive lines.

    With code shifting (inserts a blank line)

    Multi-line addition with code shifting

    Without code shifting (overlay effect)

    Multi-line addition without code shifting
  • Side by Side: When NES is enabled and set to Side by Side, the display behavior depends on whether code shifting is enabled. Specific behaviors:
    ActionOperationEffect
    Deletion onlySingle or multiple inline deletions (a word, characters within a word, or consecutive words all count as one).
    Side by Side single or multiple inline deletions
    Delete a single line or multiple lines.
    Side by Side single-line or multi-line deletion
    ModificationA single inline modification (word, characters within a word, or consecutive words all count as one), displayed as a word-level or phrase-level change.
    Side by Side single inline modification
    Single-line or multi-line changes.
    Side by Side single-line or multi-line modification
    Addition onlyAdd a single line or multiple lines (the suggestion appears at the line to be inserted, with the arrow aligned between the previous line number and the target line number).
    Side by Side single-line or multi-line addition

Use cases

  • Interact with the current suggestion: After an inline suggestion is generated, hover over the Accept button to open the Qoder CN NES menu. In the menu, click Accept/Reject or press Tab/Esc on the keyboard to accept or reject the suggestion and close the menu. You can also click Settings to change the related configuration.
  • Out-of-view within the same file: If the next predicted change is outside the current viewport, a button appears. Click the button or press Tab to jump to the target location.
img
  • Out-of-view across files: If the next predicted change is outside the viewport and in a different file, a button appears. Click the button or press Tab to jump to the target location.
img
Below are several scenarios for using Next Edit Suggestion in JetBrains IDEs:

Rename

When you modify a parameter name in the surrounding context, NES automatically generates a suggestion to update the related parameter names.

Refactor

NES supports existing functions by generating optimization and refactoring suggestions for existing code.

Add variables, fields, parameters, or comments

Add a variable

When you add a variable inside a code block, NES automatically generates a suggestion to replace how that variable is accessed in the subsequent code.
img

Add a field

After adding an annotation to a field, NES automatically generates a suggestion to add the same annotation to the subsequent fields.
img

Add a parameter

When you add a parameter to a function, NES generates suggestions to add the corresponding parameter at each subsequent call site of that function.
img
img

Add a comment

Type / where you want to add a comment to trigger a suggestion. Press Ctrl + ↓ to accept the current inline suggestion.
img