Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Questionable "highlight write/read references"

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
Uniwares Posted - Nov 27 2019 : 04:01:56 AM
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"
9   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Dec 02 2019 : 08:02:26 AM
I understand now. We are considering adding another colour to highlighting, which would work here:

case=94884

Currently though this is just an idea.
Uniwares Posted - Nov 30 2019 : 11:30:59 AM
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.
feline Posted - Nov 30 2019 : 10:39:27 AM
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.
Uniwares Posted - Nov 29 2019 : 1:00:15 PM
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)
feline Posted - Nov 29 2019 : 06:29:52 AM
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.
Uniwares Posted - Nov 28 2019 : 09:31:04 AM
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).
feline Posted - Nov 28 2019 : 09:23:22 AM
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?
Uniwares Posted - Nov 28 2019 : 08:08:04 AM
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)



feline Posted - Nov 28 2019 : 07:46:27 AM
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.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000