Skip to content

Rename Symbol (F2) doesn't work in unstaged git changes side-by-side diff view #14423

@alphahex99

Description

@alphahex99

Environment

  • OS and Version: Windows_NT x64 10.0.26100
  • VS Code Version: 1.116.0 and 1.118.1 (latest) too
  • C/C++ Extension Version: 1.32.2 (latest)
  • If using SSH remote, specify OS of remote machine: /

Bug Summary and Steps to Reproduce

Steps to reproduce:

  1. Modify any file in a git repository. Do not stage the changes.
  2. Open the Source Control tab (Ctrl+Shift+G).
Image
  1. Click Open Changes (unstaged!) on the file to see the side-by-side git diff in VSCode (which is editable, since the changes are unstaged).

  2. In the right half, select any still-existing or newly added symbol like a static/local/member variable, function name, class name... doesn't matter.

  3. Right click and Rename Symbol (or just F2).Image

  4. [BUG] Pressing Enter doesn't do anything. Pressing Ctrl+Enter doesn't do anything. Clicking away cancels the Rename. Impossible to use the Rename Symbol function.

Configuration and Logs

No response

Other Extensions

No response

Additional context

Not sure how common it is to write code directly in the side-by-side diff, but I like doing it when rewriting/refactoring and need to see the before+after.

The Rename Symbol function (F2) works fine everywhere except here, even though it's offered as an option upon right-click. Would be nice if it worked there too so I don't have to click over to the file in the normal browser, do it there and then go back to the side-by-side diff.

If you open Staged Changes instead, the option to Rename Symbol is correctly not displayed:

Image

Since it's offered in unstaged changes and doesn't work (as described in the Bug Summary and Steps to Reproduce above), it seems to be a BUG. I checked existing issues and this seems to be new.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions