Skip to content

feat(rename): rename project file and parent directory#25

Closed
CalvinAllen wants to merge 1 commit into
mainfrom
feat/rename/parent-directory
Closed

feat(rename): rename project file and parent directory#25
CalvinAllen wants to merge 1 commit into
mainfrom
feat/rename/parent-directory

Conversation

@CalvinAllen

Copy link
Copy Markdown
Contributor

Summary

Add functionality to rename the project file and parent directory on disk.

Changes Made

  • Modified: Services/ProjectFileService.cs
    • Added RenameProjectFile() - Renames the .csproj file
    • Added RenameParentDirectoryIfMatches() - Renames parent folder if it matches project name
    • Uses full paths via Path and DirectoryInfo classes
    • Directory rename only occurs if folder name matches old name (case-insensitive)
    • Both methods return new path for subsequent operations
  • Modified: Commands/RenamifyProjectCommand.cs
    • Calls directory rename first (moves entire folder)
    • Then calls file rename (renames just the .csproj)
    • Updated TODO comments

Example

Before: C:\Projects\MyProject\MyProject.csproj
After:  C:\Projects\NewName\NewName.csproj

Test Plan

  • Build and debug the extension
  • Test with project where folder matches project name - both should rename
  • Test with project where folder differs from project name - only file should rename
  • Verify paths are calculated correctly

Note

Solution will still be broken after this runs until #22, #23 are implemented.

Closes #20
Closes #21

- Add RenameProjectFile method to rename .csproj on disk
- Add RenameParentDirectoryIfMatches method to rename folder if it matches project name
- Uses full paths via Path and DirectoryInfo classes
- Directory rename only occurs if folder name matches old project name (case-insensitive)
- Both methods return new path for subsequent operations

Closes #20
Closes #21
@CalvinAllen

Copy link
Copy Markdown
Contributor Author

Closing - overlaps with merged PR #24. Will create a clean PR for directory rename only.

@CalvinAllen CalvinAllen deleted the feat/rename/parent-directory branch December 20, 2025 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

feat(rename): rename parent directory if it matches project name feat(rename): rename project file on disk

1 participant