Skip to content

[Feature Request] Execute git mv when class is moved via refactor #2848

Open
@Kas-tle

Description

@Kas-tle

Currently when refactoring a class in a git repo, the refactoring action provided by the Java language server simply creates a new class file and deletes the old one. The git mv command requires the file being moved to exist not only in the change history, but also within the repo itself. This means that if one would like to execute git mv to preserve the commit history of the file, they must initiate the refactor, manually move the file back to its original location, prompt the language server to skip refactoring for this second move, and finally execute git mv to have change history be preserved.

Environment
  • Operating System: Windows 11
  • JDK version: 17
  • Visual Studio Code version: 1.74.2
  • Java extension version: 1.13.0
Steps To Reproduce
  1. Initiate refactoring of a Java class
  2. Observe the class is moved, but the git history is not preserved
Current Result

Git history is not preserved

Expected Result

Git history is preserved

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions