Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Symbols underlined with GoogleTest

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
fredizzimo Posted - Dec 22 2015 : 08:51:27 AM
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
3   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Dec 23 2015 : 9:11:21 PM
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.
fredizzimo Posted - Dec 23 2015 : 03:44:53 AM
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.
feline Posted - Dec 22 2015 : 4:25:09 PM
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?

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