Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Completion inconsistently deletes following symbol

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
lac Posted - May 19 2016 : 02:51:56 AM
I'd prefer if completion never deleted the following word. I can delete it myself. I often need to insert code around existing expression, such as adding a function call to some existing expression.

The problem I have is that when I place my cursor before myObject here and type "anoth":
someFunction(myObject.variable)

When I complete to "anotherFunction" (pressing Tab or Enter), I get this:
someFunction(anotherFunction().variable)

I did not need it to delete the myObject, because what I wanted to arrive at was:
someFunction(anotherFunction(myObject.variable))

This happens in some cases, but not in others. I can't really figure out what the logic is for when it deletes the word and when it leaves it behind, and that's really frustrating. I'd prefer to be able to just turn it off entirely.


5   L A T E S T    R E P L I E S    (Newest First)
feline Posted - May 26 2016 : 5:14:48 PM
I am seeing the same effect as your video. Experimenting a bit, and simplifying the test down, I have a pattern to what is happening.

Taking the sample code:

unsigned knownFunction();
unsigned knownVariable;
unsigned otherKnownVariable;
class knownClass {};
knownClass knownObject;

void testingReplacingWithTyping()
{
	knownFunction();	// typing at the start of this line
}

if I type any of the variable names before "knownFunction()" and accept them, the function name is kept. But when typing a keyword, the function name is being replaced. I am not sure why to be honest, but it's a pattern, which is something.

For now, keeping the registry key set to always keep the text is probably going to work out best for you.
lac Posted - May 26 2016 : 02:04:51 AM
quote:
Originally posted by feline
In the default behaviour, the rule at work here is that if the word left behind is a known symbol, then it is left, but if it is not a known symbol it is deleted.



I really struggle to reproduce this behaviour. Here I have a lot known symbols, but it's nearly always deleted:

https://youtu.be/UzSTedfdla4
feline Posted - May 20 2016 : 11:27:26 AM
The default behaviour is an attempt to do something sensible, but there are always times when that's not going to be what you want.

For VA parsing, just pause typing for a second or two. You need to pause for 3 or 4 seconds in very large files (many thousands of lines), and then VA will parse your edits and catch up. There is no need to save the file in order to get VA to parse your changes, but we do wait for a break in your typing before parsing.
lac Posted - May 20 2016 : 09:51:44 AM
Thanks for the tip - that works well for me.

I think the problem with the implemented logic, while reasonable, is that "known symbols" tends to be something quite volatile while editing code. Often, I need to save the file and wait for VAX to reparse before symbols are known.
feline Posted - May 19 2016 : 1:33:00 PM
You can control this behaviour via a registry key setting, which is explained here:

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

In the default behaviour, the rule at work here is that if the word left behind is a known symbol, then it is left, but if it is not a known symbol it is deleted.

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