Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Incorrect auto correct with regex

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
GKarRacer Posted - Aug 07 2014 : 2:45:56 PM
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".





3   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Aug 08 2014 : 8:17:28 PM
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.
GKarRacer Posted - Aug 08 2014 : 1:09:16 PM
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.
feline Posted - Aug 08 2014 : 12:47:24 AM
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

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