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
 Symbols underlined with GoogleTest
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

fredizzimo
Junior Member

Finland
11 Posts

Posted - Dec 22 2015 :  08:51:27 AM  Show Profile  Reply with Quote
I have tried to simplify the GoogleTest macros in order to make Visual Assist behave correctly, but I haven't got it fully working yet. I have also disabled the macro depth limit, which helped a bit, and the simplified macros helped a bit more.

First, let me show you some code, so that I can explain the problem a bit better.

#define TEST(suite, testname) void testname()
#define TEST_F(test_fixture, test_name) class test_name##_c : public test_fixture { public: void test_name(); }; void test_name##_c::test_name()


class TestFixture
{
protected:
    int b;
};

void normalFunction(int b)
{
    int a;
    a = 5;
    b = 5;
    {
        a = 6;
        b = 6;
    }

    for (int i = 0; i < 5; i++)
    {
        a = 7;
        b = 6;
    }

    auto l = [&]()
    {
        a = 8;
        b = 6;
    };
}

TEST(TestSuite, Test)
{
    int a;
    a = 5;
    normalFunction(a);

    {
        a = 6;
    }

    for (int i = 0; i < 5; i++)
    {
        a = 7;
    }

    auto l = [&]()
    {
        a = 8;
    };
}

TEST_F(TestFixture, Test2)
{
    int a;
    a = 5;
    b = 5;
    normalFunction(a);

    {
        a = 6;
        b = 6;
    }
    a = 7;

    for (int i = 0; i < 5; i++)
    {
        a = 7;
        b = 7;
    }

    auto l = [&]()
    {
        a = 8;
        b = 8;
    };
}


The problem are the symbols inside all local scopes, like the unamed scope, the for loop body, and the lambda function body. It also happens for any function arguments. Depending on what I have selected "a" and "b" are either underlined or not. If I select "a" inside any functions, then the underlining will go away, but if I select "TestFixture", or "TestSuite" it will return. When I select a symbol inside the functions, the underlining goes away. Another thing worth mentioning is that this happens for the whole file, and not just the functions that are selected.

This behavior does not happen with the normalFunction.

I tested the example code with:
VA_X.dll file version 10.9.2086.0 built 2015.12.16
DevEnv.exe version 12.0.40629.0 Professional

Edited by - fredizzimo on Dec 22 2015 09:25:03 AM

feline
Whole Tomato Software

United Kingdom
18755 Posts

Posted - Dec 22 2015 :  4:25:09 PM  Show Profile  Reply with Quote
Is this code in a cpp or header file?

Do you know if you have disabled the IDE's intellisense parser? By default, underlining of code comes from the IDE, not VA, in VS2010 and above.

I have added this code to a cpp file in VS2013, with VA 2086, and I am not seeing any underlining anywhere in the code.

When you say selected, you are only selecting code? I don't think I have ever seen simply selecting code change what is being underlined. I can see how selecting code might change the underlining in the selected code, but it should not have an effect outside of the selected code.

Does disabling VA, via:

VAssistX -> Enable/Disable Visual Assist X

have any effect on the underlining?

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

fredizzimo
Junior Member

Finland
11 Posts

Posted - Dec 23 2015 :  03:44:53 AM  Show Profile  Reply with Quote
The code was tested in project containing only main.cpp with that code and nothing else.

I did my tests with intellisense and browsing information disabled.

By selecting the code, I mean moving the cursor on top of it, either by mouse or keyboard. You don't need to actually select the whole word.

Unfortunately I just went on Christmas hollidays, so I'm unable to do more tests right now.

However, I'm using VsVim, so that might change the selection behavior. I also have the "highlight read and write references to word under cursor" option enabled, so that might also have something to do with it.

Unfortunately I can't answer the question about disabling Visual Assist right now. But since I have intellisense disabled, I'm pretty sure that the underlining comes from Visual Assist.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18755 Posts

Posted - Dec 23 2015 :  9:11:21 PM  Show Profile  Reply with Quote
I hope you have a good holiday, and I am happy to report that with some more testing I was able to reproduce this problem. Moving the caret causes the underlining to appear and disappear, I don't think I have ever seen this happen before. Live and learn.

case=94080

Out of interest, is there a reason you have disabled the IDE intellisense here? The VA underlining disappears when I turn IDE intellisense back on again, but obviously this assumes that IDE intellisense is generally making sense of your code.

Are you having other problems with VA, or is it just the underlining?

You can turn off the underlining, with the setting:

VA Options -> Underlining -> Underline unknown symbols using

but I appreciate this might cause more problems than it fixes.

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