Author |
Topic |
|
evolution
Tomato Guru
USA
105 Posts |
Posted - Dec 16 2020 : 8:39:44 PM
|
I've noticed that sometimes symbols are shown in bold even if they are member properties. Think I've identified two repro cases (verified in a new win32 console app project):
Repro 1: - When you have a local symbol in a .cpp file, any other symbols with the same name in that .cpp will be colored bold, even if they refer to member properties:
With the local commented out:
Repro 2: If you declare a class in the .cpp file, then all of its members will be colored bold, even in the class declaration.
And these two issues can combine: if you have a class declaration in .cpp file, its members are colored bold. If you then have any other symbol references in that same .cpp file that have the same name as any of the members of that class, then those references will be colored bold as well, regardless of whether they're members or local.
|
what could possibly go wrong? :D |
|
feline
Whole Tomato Software
United Kingdom
19024 Posts |
Posted - Dec 17 2020 : 08:59:11 AM
|
Unfortunately both of these are known limitations of how VA does local symbols in bold. This is applied very quickly, to keep up with the speed of scrolling, but because it is a fast method, it is also not very accurate. From the bottom of the documentation on this feature:
https://support.wholetomato.com/default.asp?W180
>> Bold is applied without knowledge of context. If foo is defined somewhere in the current file, all occurrences of foo are bold even if they refer to symbols defined elsewhere. |
zen is the art of being at one with the two'ness |
|
|
evolution
Tomato Guru
USA
105 Posts |
Posted - Dec 17 2020 : 12:18:04 PM
|
Hmm, I understand. But if it "randomly" (from user's perspective) applies the wrong coloring, that diminishes its utility as we can't really trust it. Does that mean a similar limitation applies to the "Highlight references" feature? |
what could possibly go wrong? :D |
|
|
feline
Whole Tomato Software
United Kingdom
19024 Posts |
Posted - Dec 18 2020 : 05:26:52 AM
|
Local variables in bold should be fairly consistent, which helps a bit. It's generally fairly helpful in C++, when you have your definitions and implementations in separate files, but obviously this isn't always the case.
For highlight references, it depends on which version you mean
In VA's Highlighting options, the first setting controls the colours used for highlighting Find References Results, which is a syntax aware find. So this will respect scope and type, and should be highly accurate.
Next you have "Highlight write and read references to symbol under cursor" which again uses VA's Find References understanding of your code, so will be accurate.
Both "Highlight matching words when caret is in comments and strings" and "Highlight results of Quick Find and Find in Files" are different, these are simply doing a "highlight all matching strings" highlight. So there is no context or awareness here. This has to work this way though, since the find is triggered without any context to tell you the scope that should be checked.
Not the simplest answer, but I hope this makes sense and you can see why this is working this way. |
zen is the art of being at one with the two'ness |
|
|
|
Topic |
|
|
|