Rubberduck: Renaming Project does not rename objects explicitly used/declared in procedures

Created on 26 Mar 2021  路  1Comment  路  Source: rubberduck-vba/Rubberduck

Rubberduck version information
Version 2.5.1.5736
OS: Microsoft Windows NT 10.0.18363.0, x64
Host Product: Microsoft Office x86
Host Version: 16.0.13801.20294
Host Executable: EXCEL.EXE

Description
Rename for other parent objects finds all references to the object and renames them. At the Project Rename it does not

To Reproduce
Steps to reproduce the behavior:

  1. Project Name is Foo and compiles
  2. Have an object Bar declared whose parent is Foo
  3. Have in procedure arguments Foo.Bar (or objects declared within procedure As Foo.Bar)
  4. Rename project Foo to Fooooo
  5. RD does its thing
  6. Project does not compile the Explicit Foo.Bar has not been renamed Fooooo.Bar

Expected behavior
Foo.Bar would be rewritten as Fooooo.Bar and the project would compile.

Screenshots
If applicable, add screenshots to help explain your problem.

Logfile
RubberduckLog.txt

bug feature-refactorings refactoring-rename

>All comments

That would be it:

        //TODO: Implement renaming references to the project in code.
        private void RenameProject(RenameModel model, IRewriteSession rewriteSession)
        {
            var project = _projectsProvider.Project(model.Target.ProjectId);

            if (project != null)
            {
                project.Name = model.NewName;
            }
        }
Was this page helpful?
0 / 5 - 0 ratings