Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 STL types not coloring properly in some projects

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
kmw Posted - Sep 16 2008 : 9:46:10 PM
This one may be more difficult -- we have a project with large amounts of template defines and heavy use of boost and STL. In this project, VA X is not properly coloring STL types like "std::vector" and "std::string". The "vector" and "sting" are being highlighted not as "stable include classes" (in blue italics) but instead they're being colored as methods (brown). VA X, while mis-coloring these, *does* know what they are, and ALT-G shows the two definitions: one in the MSVC include directory, and one in visual assist x\\misc\\stdafx.h. What could cause VA X to mis-interpret string and vector (and all STL types) as methods instead of as stable included classes?

If I open a small, simple project not related to the above project/solution, and type in "std;:vector<int> vv;" then the "vector" is properly highlighted as stable-include/class (italic blue).

In both cases if I click on "vector" and hit ALT-G, then I see the same list of references: the MSVC include\\vector and the VA X\\stdafx.h file.

What could be causing VA X to mis-behave in the first case? A small case that reproduces the problem may not be possible unfortunately.

System info:
VA_X.dll file version 10.4.1647.0 built 2008.07.30
DevEnv.exe version 8.0.50727.762
msenv.dll version 8.0.50727.762
Font: Courier New 13(Pixels)
Comctl32.dll version 6.0.2900.2982
Windows XP 5.1 Build 2600 Service Pack 2
Single processor

Platform: Custom
Stable Includes:
c:\\Program Files\\Microsoft Visual Studio 8\\VC\\include;
c:\\Program Files\\Microsoft Visual Studio 8\\VC\\atlmfc\\include;
c:\\Program Files\\Microsoft Visual Studio 8\\VC\\PlatformSDK\\include;
c:\\Program Files\\Microsoft Visual Studio 8\\SDK\\v2.0\\include;
C:\\p4.2\\hw\\tools\\boost\\boost-1.33.0;
C:\\p4.2\\hw\\tools\\wxWidgets-2.8.8\\include;

Other Includes:

Stable Source Directories:
c:\\Program Files\\Microsoft Visual Studio 8\\VC\\atlmfc\\src\\mfc;
c:\\Program Files\\Microsoft Visual Studio 8\\VC\\atlmfc\\src\\mfcm;
c:\\Program Files\\Microsoft Visual Studio 8\\VC\\atlmfc\\src\\atl;
c:\\Program Files\\Microsoft Visual Studio 8\\VC\\crt\\src;

7   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Sep 26 2008 : 10:34:00 AM
Can you do a find in files, in regular expression mode, for the string:

using:b+namespace:b+std;

and see if you get any matches? I suspect you will. I still don't know what might be triggering this, but I am wondering if a vector variable inside a std:: namespace might be a factor.
kmw Posted - Sep 25 2008 : 5:51:29 PM
The problem arises with the fully qualified "std::vector" form. New, blank, small projects work fine, a large project with many template libraries doesn't work fine, it's not my project so I have absolutely no idea what is causing the problem. I'd think if alt-shift-s is finding the right definition then it'd be colored correctly, but that's not happening.
feline Posted - Sep 25 2008 : 11:05:28 AM
When you see this problem are you actually using "std::vector" or just "vector" and a using namespace line somewhere else in your code?

I have just tried adding the following code to a cpp file:

void vector(bool bTest) { }

static void testGeneralCode()
{
	std::vector<int> vecNumbers;
	int vector;
}


and while there is a colouring problem with the int variable "vector" the "std::vector" is coloured correctly. So I am not sure what will trigger a colouring problem with "std::vector".
kmw Posted - Sep 22 2008 : 5:09:11 PM
Many things are listed under Alt-Shift-S "vector", but none of them are changes to std::vector that I can see.
feline Posted - Sep 22 2008 : 10:29:47 AM
VA stores its symbol information in a database, so it is not something that you can really read.

The fact that Alt-g works correctly indicates that this is "just" a colouring problem, similar to the problem you are having with functions and parameters with the same name.

If you open the Find Symbol in Solution dialog (Alt-Shift-S) and type in "vector" to filter this list is anything listed? The "problem" symbol may be listed here, depending on what it is.
kmw Posted - Sep 17 2008 : 7:15:59 PM
Yes, the incorrect coloring happens on a new blank file in the "bad" project. It's not my project so I'm not familiar with all the stuff in it, but it does use templates heavily. On a small simple project the std::classname coloring is correct. Is there some way to determine where VA X is getting its information? Can I view the cached library information to see why/where VA X is thinking that std::vector is a method instead of a class? Note again that ALT-G shows the correct definitions, no methods only classes, in both the correct case and the wrong case.
feline Posted - Sep 17 2008 : 6:38:21 PM
If you add a new blank file to your main project do you see the problem in this new file?

Our colouring code has to run very quickly to keep up with scrolling through code, so it is possible to confuse it. Using the same string to mean different things is a good way to confuse it. I am wondering if you have a local variable called "vector" in the files where this happens.

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