Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 VA 2385: whoa, rename references messed me up
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Uniwares
Tomato Guru

Portugal
1986 Posts

Posted - Aug 20 2020 :  11:40:06 AM  Show Profile  Reply with Quote
Ok, now that was unexpected: I had a little class called Test in my C# .Net Core project. Played around a bit and then changed its name to something else, selected "rename references" and then ALL occurances of "Test" in all projected where renamed. Namespaces, Texts, etc. not only references (of which I had only 4)
Since I have 2 unit test projects in the solution, all of the 300+ files have a namespace like "project.x.x.Test" you can now imagine how happy I was.
Whats happening with VA + .Net Core projects?

Uniwares
Tomato Guru

Portugal
1986 Posts

Posted - Aug 20 2020 :  11:44:14 AM  Show Profile  Reply with Quote
Just saw: Find References also shows all namespaces ending in ".Test" and all strings "Test" as references to the class Test
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
16896 Posts

Posted - Aug 21 2020 :  09:15:33 AM  Show Profile  Reply with Quote
The rename, was this done via the Rename dialog, so you had a preview of what was happening, or after an edit in the code without the preview dialog. You have reported a problem with an edit in the code, no preview dialog, showing a problem here:

https://forums.wholetomato.com/forum/topic.asp?TOPIC_ID=19019

which I am still struggling to reproduce here, even using VA 2385.0

For the Find References, is this reproducible? Again, so far, I cannot reproduce most of these problems. I have set up a simple .NET Core console test solution here.

If Find References is set to search for and display comment and string references then yes, it is expected to return "Test" as a reference, since this is a string, and there is no obvious way to tell that this isn't a reference you want.

However the namespace references are not being picked up for me.

I am testing with VA 2385.0, is this the same version as you? If you are using a non public version the last part of the version number also tends to matter.

zen is the art of being at one with the two'ness
Go to Top of Page

Uniwares
Tomato Guru

Portugal
1986 Posts

Posted - Aug 21 2020 :  09:33:19 AM  Show Profile  Reply with Quote
The in-editor menu doesnt come up always (my guess is that there is a fight for who gets to show a context menu, just as there is for the icon position when hovering over a symbol), but when it comes up and its used, there is no preview, only execution (literally). The rename dialog gives me the preview as expected.

I am running here 2385.6 (testing for the lockup with elevated privileges)

The Find References is reproducible.


(seems the "highlight all" isnt working anymore either)

Go to Top of Page

feline
Whole Tomato Software

United Kingdom
16896 Posts

Posted - Aug 27 2020 :  10:37:29 AM  Show Profile  Reply with Quote
I have managed to reproduce this in both VA 2385.6 and 2382.0, but only sometimes. There is more to this than just a duplicate symbol name, but I am not yet sure what the trigger is.

As for highlight all, highlight all is only supposed to highlight references in code, either in the editor window or the results window. It isn't supposed to highlight references to the symbol in the file name or path. Am I missing something, or are all of the non highlighted references in your screen shot path references?

zen is the art of being at one with the two'ness
Go to Top of Page

Uniwares
Tomato Guru

Portugal
1986 Posts

Posted - Aug 27 2020 :  10:44:01 AM  Show Profile  Reply with Quote
Actually all references in the image above highlighted are namespaces or classes and they are always highlighted, independent of the setting.
But I am happy you can see the problem too. So I do not need to manage my drinking habits

Edited by - Uniwares on Aug 27 2020 10:44:19 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
16896 Posts

Posted - Aug 27 2020 :  11:26:37 AM  Show Profile  Reply with Quote
The "Highlight all" checkbox in the Find References Results should toggle highlighting On and Off in the editor windows, not in the Find References Results window its self.

The highlighting in the Find References Results window is for the results that VA has picked up, so it makes sense that these unexpected results are being highlighted, since VA has decided that they are suitable results. Why that is is a separate question

Does this make sense and explain the highlighting you are seeing? Or is there another issue at work here as well? It wouldn't surprise me.

zen is the art of being at one with the two'ness
Go to Top of Page

Uniwares
Tomato Guru

Portugal
1986 Posts

Posted - Aug 27 2020 :  11:34:58 AM  Show Profile  Reply with Quote
All right, makes some sense now. Lets work on the "separate question" then.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
16896 Posts

Posted - Aug 28 2020 :  1:58:31 PM  Show Profile  Reply with Quote
Finally got to the bottom of this problem:

case=142822

Basically if you place them in different projects C# lets the namespace contain both a class and a namespace with the same name, but if you put them in the same file then it is invalid, since it is a duplicate name. So obviously something must be happening to scope this, to avoid the conflict.

For now, to stop VA getting confused like this, you can tell Find References not to search across projects. Not ideal, but it does avoid this problem.

zen is the art of being at one with the two'ness
Go to Top of Page

Uniwares
Tomato Guru

Portugal
1986 Posts

Posted - Aug 28 2020 :  2:09:12 PM  Show Profile  Reply with Quote
You'd make a good private investigator.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
16896 Posts

Posted - Aug 29 2020 :  08:56:09 AM  Show Profile  Reply with Quote
My first simple examples didn't have quite the right pattern, and when I tried setting up the "obvious" test I was doing it in the same project, so I started with the right answer, but the wrong details, so concluded there had to be something else going on I didn't know. Seems obvious now *sigh*

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2019 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000