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
 Bogus code when typing .* to invoke ptr-to-member
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

legalize
Tomato Guru

USA
119 Posts

Posted - Jun 23 2014 :  9:08:51 PM  Show Profile  Reply with Quote
Given this code

#include <cassert>

class ChangeSignature
{
public:
    int Method3(int a, int b);
};

int ChangeSignature::Method3(int a, int b)
{
    return a + b;
}

static void TestMethods
{
    ChangeSignature c;
    int (ChangeSignature::*result)(int, int) = &ChangeSignature::Method3;
    int const sum = 
}

Type (c.* right after the = on the last line and VAX inserts bogus code:

    int const sum = (c.Method3*

I verified this came from VAX by disabling VAX and typing the code and then I get exactly what I typed. VAX should never insert incorrect code when I am typing correct code. The correct code is:

    int const sum = (c.*result)(3, 4);

http://legalizeadulthood.wordpress.com

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jun 24 2014 :  10:33:21 PM  Show Profile  Reply with Quote
This is strange and should not happen. However, I wasn't able to reproduce the problem here.

Can you please export and send in your Visual Assist and Visual Studio settings?

1. VA Options -> Performance -> Export Settings

2. IDE tools menu -> Import and Export Settings -> Export selected environment settings

So I can import them here to see if I can reproduce the problem.

You can send the files in using the following form:
http://www.wholetomato.com/support/contact.asp

Please include the URL of this topic in the "your request" field.
Go to Top of Page

legalize
Tomato Guru

USA
119 Posts

Posted - Jun 30 2014 :  01:24:28 AM  Show Profile  Reply with Quote
Sent.

http://legalizeadulthood.wordpress.com
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jun 30 2014 :  6:15:13 PM  Show Profile  Reply with Quote
Thank you for taking the time to send your settings in. I have imported them I found the culprit.

Can you please go to the following editbox?

Tools -> Options... -> Text Editor -> C/C++ -> Advanced -> Member List Commit Characters

Here, '.' is in the editbox, hence the completion. The easiest way to solve this is deleting the content of this listbox and pressing OK. (to accept the change and close the Options dialog)

This happens because Visual Assist respects Intellisense settings so when users install Visual Assist, we can keep a similar listbox behavior. You have disabled Intellisense, but VA still uses the characters specified here.

quote:
disabling VAX and typing the code and then I get exactly what I typed.

This is true, this came from VA. Disabling solved the problem because Intellisense is disabled on this machine.

We try to avoid duplicating settings, especially since we want to keep a similar behaviour with or without VA. Since there are new settings added in new Visual Studios, we use more setting in newer Visual Studios. This was added in VS2013 if I recall correctly.
Go to Top of Page

legalize
Tomato Guru

USA
119 Posts

Posted - Jul 01 2014 :  09:35:35 AM  Show Profile  Reply with Quote
It's still a bug.

Typing . did not complete anything, typing * introduced the invalid syntax.

No completion popup boxes were shown, the invalid "Method3" was simply inserted as soon as I typed the *.

Even if this was a proper attempt at completing some shown suggestion (again, no suggestions were shown because I turn off all that stuff unless I request it by keystroke), the resulting code is still invalid syntax.

No matter which way you slice it, there's a bug.

http://legalizeadulthood.wordpress.com
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jul 01 2014 :  5:12:17 PM  Show Profile  Reply with Quote
This is strange. I'm seeing a listbox after typing '.', so we may be experiencing a different problem?



When I press *, it is indeed completes as "c.Method3*", but when I remove the characters from the mentioned editbox I get "(c.*".

Does deleting the characters from the below editbox solves the problem?

Tools -> Options... -> Text Editor -> C/C++ -> Advanced -> Member List Commit Characters

I'm wondering whether are we seeing a different problem?
Go to Top of Page

legalize
Tomato Guru

USA
119 Posts

Posted - Jul 01 2014 :  5:54:02 PM  Show Profile  Reply with Quote
Like I said, I have it configured not to show any listboxes unless I request one with a keystroke. So if you're seeing listboxes, you're not reproducing my environment.

http://legalizeadulthood.wordpress.com
Go to Top of Page

legalize
Tomato Guru

USA
119 Posts

Posted - Jul 03 2014 :  12:06:49 AM  Show Profile  Reply with Quote
Yes, if I remove * from the Member List Commit Characters, then it doesn't insert incorrect code.

I don't see the popup box because I'm not waiting for the box to appear before I type *.

The bug is: I'm typing correct code and VAX changes it into incorrect code as I'm typing.

No "autocomplete" feature should ever turn correctly typed code into incorrect code.

It is exactly this sort of annoying behavior that causes me to turn off all these "helpful" autocomplete things unless I request them by keystroke. No IDE should ever, ever, ever, turn correctly typed code into incorrect code. Ever.

http://legalizeadulthood.wordpress.com
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jul 07 2014 :  5:35:24 PM  Show Profile  Reply with Quote
I feel you, I also make sure I turn off most features that correct what I type or accept listboxes with keys other than tab or enter.
Visual Studio with default settings also accept listboxes (if you don't disable Intellisense).

I have put in a feature request to respect disabling "Auto list members":

case=83533

I only disable 3 features, though:

VA Options -> Corrections -> Repair case
VA Options -> Corrections -> Convert dot to -> if operator -> is overloaded
Tools -> Options... -> Text Editor -> C/C++ -> Advanced -> Member List Commit Characters

These are more of less guesses. I like popping up listboxes, though, most notably smart suggestions:
http://docs.wholetomato.com/default.asp?W172

Edited by - accord on Jul 08 2014 7:22:30 PM
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