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
 Questionable "highlight write/read references"
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Uniwares
Tomato Guru

Portugal
2322 Posts

Posted - Nov 27 2019 :  04:01:56 AM  Show Profile  Reply with Quote
While I really like this feature, there are some side effects that seem at least strange.

I see for example read highlights for C# keywords like "using", "new", "readonly" and some more like constants or "return".
Also read highlighted are type references like in
using(MyType t = new MyType())

or in
void DoLogin(UserLevel minimumLevel = UserLevel.UL_OPERATOR)


I understand that this most probably is related to the speedy-guesswork-while-displaying problem.

BTW: There are errors in the help page to this feature. https://docs.wholetomato.com/default.asp?W186
It says there You can change the foreground colors in the options dialog for Visual Assist. while it should say "background"

Edited by - Uniwares on Nov 27 2019 04:14:12 AM

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Nov 28 2019 :  07:46:27 AM  Show Profile  Reply with Quote
I don't understand what you are talking about here. I have added the following code to a .cs file, which compiles, so I know I have a valid test block of code here:

void testUsingStringToForceDispose()
{
    using (TextWriter textOutput = File.CreateText("get a disposable class"))
    {
        textOutput.WriteLine("so what are we testing");
        textOutput.WriteLine("here with VA highlighting");
        textOutput.WriteLine("and colours for modified?");
    }
}

I am testing with:

VA Options -> Highlighting -> Highlight write and read references to symbol under cursor

turned On. When I place the caret into "using" it gets a grey background, which is Not coming from VA. This background highlighting is still there when I disable VA via:

VAssistX -> Enable/Disable Visual Assist X

When I place the caret into "textOutput" the highlighting seems reasonable to me. It is shown as modified where it is created in the using line, and then not modified by the lines being written.

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

Uniwares
Tomato Guru

Portugal
2322 Posts

Posted - Nov 28 2019 :  08:08:04 AM  Show Profile  Reply with Quote
Here some images to clarify what I see with/without VA

With VA caret on a "Form"


Without VA no "Form" is highlighted.

Now the using with VA (without, only the instance under is highlighted)



Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Nov 28 2019 :  09:23:22 AM  Show Profile  Reply with Quote
The different highlighting of "using" when the caret is in it seems to be due to the IDE setting:

IDE tools menu -> Options -> Text Editor -> C# -> Advanced -> Highlight related keywords under cursor

in the Highlighting block. If you disable this then all of the "using" symbols are shown the same in the editor, at least for me. Does this fix the problem you are seeing? Or am I still confused about the problem?

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

Uniwares
Tomato Guru

Portugal
2322 Posts

Posted - Nov 28 2019 :  09:31:04 AM  Show Profile  Reply with Quote
Just turned it off, no effect on the "using" case at all. (neither the Form)
Also, the background color is the one defined for VAs Highlight read references ("VA Find Reference" in the VS options).
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Nov 29 2019 :  06:29:52 AM  Show Profile  Reply with Quote
Since I am seeing different results here I have just imported the VA and IDE settings you sent me in the other thread, along with the C# form sample code. In this situation, in the IDE settings, you have both:

IDE tools menu -> Options -> Text Editor -> C# -> Advanced -> Highlight references to symbol under cursor
IDE tools menu -> Options -> Text Editor -> C# -> Advanced -> Highlight related keywords under cursor

turned On. Can you please try turning both of these Off, and then see what happens? It may be worth turning Off the setting:

VA Options -> Highlighting -> Highlight write and read references to symbol under cursor

as well, to make sure all of the highlighting for the current cursor position is disabled, before turning On just the VA highlighting. Then hopefully you will get a consistent and reliable result.

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

Uniwares
Tomato Guru

Portugal
2322 Posts

Posted - Nov 29 2019 :  1:00:15 PM  Show Profile  Reply with Quote
All VS settings turned off, VA all highlights off ==> nothing lights up
All VS settings turned off, VA all highlights on ==> all just as in the images above, all usings or all forms lighted up
All VS settings turned on, VA all highlight off ==> usings dont light up, all Form lights up (although in a darker, VS defined color)
All VS settings turned on, VA all highlight on ==> usings light up under the caret, all Form lights up (although in a darker, VS defined color)
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Nov 30 2019 :  10:39:27 AM  Show Profile  Reply with Quote
Can you explain what the actual problem is here?

The closest I have been able to get to a problem here is when I have 3 instances of the word "using" visible on the screen, and two of them are highlighted by VA, and one, the one the caret is placed in, is highlighted in a different colour. This is because both VA and the IDE are highlighting the word "using" at the same time, but with different colours and different rules.

But this isn't actually a bug, its what happens when both tools are doing a similar job at the same time with the same word.

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

Uniwares
Tomato Guru

Portugal
2322 Posts

Posted - Nov 30 2019 :  11:30:59 AM  Show Profile  Reply with Quote
The actual problem is that keywords and other language words are highlighted as "read" references when actualy they are just "related" highlights, so they should use a color different of read/write highlights. Also, the class reference "Form" shouldnt be hightlighted as read reference, at least in my opinion. Declaring a variable of type Form is not a read reference of Form.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Dec 02 2019 :  08:02:26 AM  Show Profile  Reply with Quote
I understand now. We are considering adding another colour to highlighting, which would work here:

case=94884

Currently though this is just an idea.

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:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000