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
 Feature Requests
 Tab completions overwriting next word
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

IanB
New Member

Australia
8 Posts

Posted - Dec 19 2021 :  09:30:52 AM  Show Profile  Reply with Quote
Something that I encounter regularly is that I need to fix a line of code by inserting text at the start of the line.

Here is an example line:


The red underline error is due to the wrong string type being used. So I want to do a string conversion. I start typing the function name...


And Visual Assist immediately suggests the right thing! Great! I hit Tab (or Enter) and it overwrites the next word:



Whereas I was hoping for:



Default Visual Studio behaviour is the same as Visual Assist - replace not insert. Googling says that Resharper can be configured to either replace or insert - I can't verify since I don't have Resharper.

Edited by - IanB on Dec 19 2021 09:31:13 AM

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Dec 20 2021 :  05:40:03 AM  Show Profile  Reply with Quote
Before starting the edit, if you place the caret into the symbol "token" does VA show anything in its context and definition fields? These are normally shown at the top of the editor window, and are where the Alt-M list comes from. VA should be showing you the correct details of this symbol.

I ask since the default behaviour for listboxes is to only remove unknown symbols from the right hand side of the caret. You can control this behaviour, telling VA never to remove the text to the right of the caret, with this setting:

https://support.wholetomato.com/default.asp?W640

but if VA knows the symbol then something is going wrong with the default behaviour, unless your system has been configured to always delete the text to the right of the caret, which is an option.

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

IanB
New Member

Australia
8 Posts

Posted - Dec 20 2021 :  09:06:02 AM  Show Profile  Reply with Quote
Yes, both context and definition fields look correct. Definition field is:
const Token& token = *value.tokens.cbegin()

I changed the registry value you linked (to 1 "never overwrite"). That works great!

Edited by - IanB on Dec 20 2021 09:21:05 AM
Go to Top of Page

IanB
New Member

Australia
8 Posts

Posted - Dec 20 2021 :  09:20:33 AM  Show Profile  Reply with Quote
I tried creating a new project to test if it is just my codebase that is breaking it, but I see the same behaviour on a simple test:

std::wstring MultiByteToWideChar(std::string s)
{
  return L"";
}

int main()
{
  std::string token("Hello world");
  return atoi(token.c_str());
}


Place the cursor before the 'token':

  return atoi(token.c_str());
              ^

Type 'M', tab, and it replaces 'token'.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Dec 20 2021 :  09:52:27 AM  Show Profile  Reply with Quote
Thank you for the very simple example, I am seeing exactly the same problem here. It turns out this is a known bug in the overwrite logic, known symbols are being replaced when you are accepting a function name:

case=140801

thankfully, as you are seeing, the never replace setting still works correctly in this case.

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