T O P I C R E V I E W |
fsgs |
Posted - Feb 27 2012 : 11:19:32 AM Hello,
I'm using latest build of VAX in VS2010. I noticed several problems with highlighting in my project. I.e. std::vector is highlighted as a method (brown instead of blue) and std::transform is highlighted vice versa (see image).
When I click "Go to Implementation" (Alt+G) on "vector" or "transform" I get in core.hpp file of OpenCV library. And I have no such problems in project which is not using OpenCV. So seems like OpenCV headers are ruining VAX parser.

|
8 L A T E S T R E P L I E S (Newest First) |
feline |
Posted - Mar 05 2012 : 6:19:19 PM Unfortunately you cannot check the case directly. You can ask, and someone will check on the case status for you. This thread should be updated when the case is fixed, and fixed cases are also listed in the release notes when a new build is posted. |
fsgs |
Posted - Mar 03 2012 : 03:46:24 AM quote: Originally posted by accord
So, unfortunately this is a known problem, but the fix is not trivial: case=660
Where can I find details on this problem? I tried here: http://www.wholetomato.com/support/problems.asp, but wasn't able to find issues list.
And what if I include <vector> before <core.hpp>? In this case, Visual Assist will (or not?) see vector class first. Update: tried it, no result. |
accord |
Posted - Mar 02 2012 : 8:22:35 PM Thank you for the elaborated answer. Unfortunately the problem seems to be caused by operator vector<_Tp>() const; Visual Assist find the above line, so globally, it handles vector as a function, but when you open the <vector> file VA overwrites the coloring, since as I said before, VA handles coloring per file. When you switch to an other file (where vector is not directly defined in the file itself), VA uses the global version of the definition.
In other words, this is because of the limited context checking that VA uses so colorization can be done in real-time, without any lag or delayed coloring whatsoever.
So, unfortunately this is a known problem, but the fix is not trivial:
case=660
I kind of saw that your problem is related to the above case number, but wanted to understand what is happening in your specific case to see if it really is the same problem or there might be quick fix for the problem. |
fsgs |
Posted - Feb 29 2012 : 03:16:56 AM I've compiled my file with /P directive to handle all includes and preprocessing and done Ctrl+F of "vector" in resulting .i file. Matches of interest might be as following (not counting lots of matches in STL <vector> file).
opencv/core/core.hpp:
namespace cv {
...
using std::vector;
...
...
class CV_EXPORTS Mat
{
public:
...
template<typename _Tp> operator vector<_Tp>() const;
...
};
...
...
template<typename _Tp> class Mat_ : public Mat
{
public:
...
operator vector<_Tp>() const;
...
};
...
}
CGAL\\v3.9\\include\\cgal\\direction_2.h:
namespace CGAL {
...
template <class R_>
class Direction_2 : public R_::Kernel_base::Direction_2
{
public:
...
Vector_2 vector() const { ... } // This function is then used many times
...
};
...
}
CGAL\\v3.9\\include\\cgal\\internal\\intersections_3\\triangle_3_line_3_intersection.h
namespace CGAL {
namespace internal {
template <class K>
typename K::Point_3
t3l3_intersection_coplanar_aux(const typename K::Line_3& l,
const typename K::Point_3& a,
const typename K::Point_3& b,
const K& k)
{
...
typename K::Construct_vector_3 vector =
k.construct_vector_3_object();
...
};
...
}}
So you may have a look at given CGAL include files as well. |
accord |
Posted - Feb 28 2012 : 5:38:54 PM Visual Assist's code colorizer is not 100% accurate because it does not do strict context checking to be able to color the code fast, so it can keep up even with rapid scrolling. The coloring of symbols is done as a per file basis, so if you have a different type in the same file with the name "vector", it will be used for coloring. If you do a search in your file for "vector", with match case and match whole word enabled, are you able to find any other local or global symbol definition with the name "vector"? When it happens, the symbol color changes as you switch between the files, like you had mentioned. |
fsgs |
Posted - Feb 28 2012 : 04:23:01 AM I've just tried to rebuild VAX database. Now wrong colors are displayed only for vector, and some other containers as well (see image).

However, "Go to Implementation" on all containers is now resolving to correct definitions inside STL. Update: after writing this post I checked "Go to Implementation" on vector again and now it points to core.hpp in OpenCV like before. Seems like VAX has done some additional parsing.
In core.hpp it points on "using std::vector;" line, and when click Alt+G on this vector again, I finally get in <vector> file in STL. Inside this file, "vector" is highlighted with blue. The moment I open <vector> file in Visual Studio "vector" is brown, and the moment after it immediately turns blue. When switch back from <vector> file effect is the opposite: the moment I open my file, it is blue, the moment after it turns brown. The effect is stable. |
fsgs |
Posted - Feb 28 2012 : 03:58:49 AM There are lots of includes, of course. Not counting my internal files, I have these includes in stdafx.h:
// SDK includes
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/squared_distance_2.h>
// STL includes
#include <vector>
#include <cmath>
#include <algorithm>
#include <functional>
#include <iterator>
#include <tuple> |
accord |
Posted - Feb 27 2012 : 5:38:50 PM I've downloaded OpenCV, set the include path, included
#include <vector> and
#include "opencv2\\core\\core.hpp" and used
using namespace std; but wasn't able to reproduce the problem. What opencv2 and std includes do you have in the file where you are seeing this problem? |
|
|