Skip to content

NES gutter icon persists across file close/open cycles and applies stale suggestion to wrong file #17108

Closed

Description

@ronblum

System details

RStudio Edition : Desktop
RStudio Version : 2026.04.0-daily+305
OS Version      : Windows 11
R Version       : 4.5.2

Steps to reproduce the problem

Using GitHub Copilot as the code assistant (not Posit Assistant):

  1. Create a file called file_a.R with the following content:
    calculate_total <- function(price, tax_rate) {
      total <- price + (price * tax_rate)
      return(total)
    }
    
    result <- calculate_total(100, 0.08)
    print(result)
    
  2. Open file_a.R in the source editor.
  3. Select result on line 6.
  4. Type final_result to replace the selection.
    • An NES (Next Edit Suggestion) appears on line 7, suggesting to rename result to final_result in print(result).
  5. Accept the NES suggestion by clicking Apply.
  6. Close file_a.R without saving.
  7. Create a file called file_b.R with the following content:
    calculate_total <- function(price, tax_rate) {
      total <- price + (price * tax_rate)
      return(total)
    }
    
    total_price <- calculate_total(100, 0.08)
    print(total_price)
    
  8. Open file_b.R in the source editor.
    • An NES gutter icon is visible on line 6 — the same line number where the edit was made in file_a.R.
    • No edits have been made in file_b.R.
  9. Click the NES gutter icon.
    • The previous file's suggestion is applied: total_price becomes final_result and print(total_price) becomes print(final_result).
    • The user is not shown a preview before the change is applied.

Describe the problem in detail

After accepting an NES suggestion and closing the file, the NES gutter icon persists in the editor. When a new file is opened, the stale gutter icon appears on the same line number where the previous edit occurred — before any edits are made in the new file. Clicking the stale gutter icon silently applies the old file's suggestion to the new file, corrupting its contents.

This only occurs with sequential NES edits with GitHub Copilot. Posit Assistant works correctly.

Describe the behavior you expected

No NES gutter icon should appear on a freshly opened file before any edits. NES state from a previous file should not carry over after the file is closed.

  • I have read the guide for submitting good bug reports.
  • I have installed the latest version of RStudio, and confirmed that the issue still persists.
  • If I am reporting an RStudio crash, I have included a diagnostics report.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

Activity

  1. added
    new
    and removed
    new
    on Feb 25, 2026
  2. added theissue type on Feb 25, 2026
  3. added this to the Globemaster Allium milestone on Feb 25, 2026
  4. self-assigned this
    on Mar 3, 2026
  5. ronblum commented on Mar 4, 2026

    @ronblum
    ContributorAuthor

    Verified in RStudio Desktop 2026.04.0-daily+346 on Windows 11. Used automated Playwright test code_suggestions.test.ts -g "NES adjacent rename"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions