You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rubberduck version information
The info below can be copy-paste-completed from the first lines of Rubberduck's log or the About box:
Rubberduck version [2.5.2.5906]
Operating System: [Microsoft Windows NT 10.0.19044.0, x64]
Host Product: [Dassault Systemes Product x64] (Catia v5)
Host Version: [5.28.0.17255]
Host Executable: [CNEXT.EXE]
Description
Rubberduck -> Navigate -> Find all referencess... does not seem to work for Subs or Functions located inside a Class, when the Class resides in one Project but is being accessed/invoked in another Project linked through References.
To Reproduce
Steps to reproduce the behavior:
Create simple structure:
Project 'test1' contains Main_Module with main subroutine. It is referencing Project 'test2' via Tools -> References:
'Main_Module:
Sub CATMain()
Debug.Print cls.testFunction("xxx")
Call cls.TestSub
End Sub
Project 'test2' contains a private Class 'cCls' and a public instance of this class called 'cls' inside its Module 'Module_with_public_cls':
'cCls:
Public Function testFunction(iStr As String) As String
testFunction = "testing function: '" & iStr & "'"
End Function
Public Sub TestSub()
Debug.Print Me.testFunction("Testing SUB")
End Sub
'Module_with_public_cls:
Public cls As New cCls
Click on 'Rubberduck -> Refresh'
Go to class 'cCls' in project 'test2'
Set cursor on 'testFunction'
Click on 'Rubberduck -> Navigate -> Find all references...'
Only two references will be found (contained inside project 'test2'. References to function calls in project 'test1' are missing.
Go to module 'Main_Module'
Set cursor on 'testFunction'
0 references found
Click on 'Rubberduck -> Refactor -> Rename'. BUG: it wants to rename 'CATMain' instead on 'testFunction'
Repeat steps 3,4.
Click on 'Rubberduck -> Refactor -> Rename'; enter new name; click on OK
Code execution fails as the 'testFunction' name is changed only in project 'test2', while 'CATMain' in project 'test1' still tries to call the function by its old name.
Revert recent refactoring
Repeat step 7.
Set cursor on 'cls'
Only two references found (from project 'test1')
Click on 'Rubberduck -> Refactor -> Rename'; enter new name; click on OK
This time refactoring went OK - 'cls' has been changed in both 'test1' and 'test2'; code executes properly
Expected behavior
I would expect Rubberduck finding the references to function calls within various projects, provided that these projects are linked by referencing each other. Especially when the Code Explorer is aware of this connection. Even the native VBA functionality 'Definition' accessible through right click context menu sends the mouse cursor to proper definition in other project.
Screenshots
None
Logfile
Log has not been created
Additional context
Nothing
The text was updated successfully, but these errors were encountered:
Thanks for the report! Probably a little oversight somewhere in the resolver causing too much filtering and excluding declarations in other projects that should be accessible.
honestly to a certain extent I want to believe that that's by design. After all the number of declarations that needs to be searched is quite large enough already for find references even when not checking all open projects.
Hm to me that's definitely a scenario (cross-project refs) that should be handled correctly. There's no reason we can get refs for MsgBox but not for exposed classes & their public members in a user-code referenced project.
@Vogel612 I have been wondering it that was intended behavior to maybe reduce the amount of computations needed to analyze all open projects that are referencing each other. But then, why the inconsistency during refactoring? Why can I refactor the name of the public object, and it is renamed in both projects, but can not refactor properly the names of its functions? This is what gave me an impression, that it might be a bug or kind of oversight.
Rubberduck version information
The info below can be copy-paste-completed from the first lines of Rubberduck's log or the About box:
Description
Rubberduck -> Navigate -> Find all referencess... does not seem to work for Subs or Functions located inside a Class, when the Class resides in one Project but is being accessed/invoked in another Project linked through References.
To Reproduce
Steps to reproduce the behavior:
Click on 'Rubberduck -> Refresh'
Go to class 'cCls' in project 'test2'
Set cursor on 'testFunction'
Click on 'Rubberduck -> Navigate -> Find all references...'
Only two references will be found (contained inside project 'test2'. References to function calls in project 'test1' are missing.
Go to module 'Main_Module'
Set cursor on 'testFunction'
0 references found
Click on 'Rubberduck -> Refactor -> Rename'. BUG: it wants to rename 'CATMain' instead on 'testFunction'
Repeat steps 3,4.
Click on 'Rubberduck -> Refactor -> Rename'; enter new name; click on OK
Code execution fails as the 'testFunction' name is changed only in project 'test2', while 'CATMain' in project 'test1' still tries to call the function by its old name.
Revert recent refactoring
Repeat step 7.
Set cursor on 'cls'
Only two references found (from project 'test1')
Click on 'Rubberduck -> Refactor -> Rename'; enter new name; click on OK
This time refactoring went OK - 'cls' has been changed in both 'test1' and 'test2'; code executes properly
Expected behavior
I would expect Rubberduck finding the references to function calls within various projects, provided that these projects are linked by referencing each other. Especially when the Code Explorer is aware of this connection. Even the native VBA functionality 'Definition' accessible through right click context menu sends the mouse cursor to proper definition in other project.
Screenshots
None
Logfile
Log has not been created
Additional context
Nothing
The text was updated successfully, but these errors were encountered: