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
 Incorrect auto correct with regex
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

GKarRacer
Ketchup Master

USA
58 Posts

Posted - Aug 07 2014 :  2:45:56 PM  Show Profile  Reply with Quote
I'm using VAX Build 2042 with VS 2010. When using std::regex I get two annoying auto corrects that are incorrect. First it incorrectly changes '.' to '->' and it changes 'str' to '_String_const_iterator' via a useless suggestion.

Using this sample code:


std::regex		Pattern("([0-9]+)");
std::smatch		results;
std::string		str = "578";

if( std::regex_match(str, results, Pattern) )
{
		std::string	val = results[1].str();
}


When I try to type "results[1].str();" I first have to undo the replacement to '->'. Then when hit 's' it first puts a suggestion list which correctly contains "first, second, str, swap". If I select str from here, it's OK. But since this is such a short string, it's easier just to type the rest. As soon as I hit 'r', the suggestion list changes to "_Mystr, _String_const_iterator". If I don't hit escape and type something else like the appropriate '(' then "str" will be converted to the useless "_String_const_iterator".





feline
Whole Tomato Software

United Kingdom
19004 Posts

Posted - Aug 08 2014 :  12:47:24 AM  Show Profile  Reply with Quote
I am seeing the same effect here. Thank you for the clear description.

case=84277

I think I have a work around for you. Please try creating a new file called "va_stdafx.h", in the same directory as your SLN or VCXPROJ files, with the content:

namespace string {
    class const_iterator {
        _Alloc::const_reference operator[](size_type n) const;
    };
};


making sure the file ends with a blank file. There is no need to add the file to your project. VA looks for this helper file when you rebuild your symbol database:

VA Options -> Performance -> Rebuild symbol databases

after you have reloaded the solution and the rebuild has finished, VA should handle this more accurately. This file is explained here:

http://docs.wholetomato.com/default.asp?W302

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

GKarRacer
Ketchup Master

USA
58 Posts

Posted - Aug 08 2014 :  1:09:16 PM  Show Profile  Reply with Quote
Thanks. That worked. Is there a global version of this file? I have lots of separate solutions and projects and I'd prefer not to have several extra copies of this floating around. But, if necessary, I can deal with it.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19004 Posts

Posted - Aug 08 2014 :  8:17:28 PM  Show Profile  Reply with Quote
Thank you for the update, I am glad that this helped. It took me a few goes to figure out which version of the operator[] function that seems to be tripping us up. If you read a bit further down the FAQ:

http://docs.wholetomato.com/default.asp?W302

it describes an older, global method for doing the same thing. The solution specific method normally works better, since often these work arounds are specific to the code in the solution, and the solution specific file can then be checked into source control, since all that matters is its placement in the directory tree.

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