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
 Completion inconsistently deletes following symbol
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

lac
Senior Member

30 Posts

Posted - May 19 2016 :  02:51:56 AM  Show Profile  Reply with Quote
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.


feline
Whole Tomato Software

United Kingdom
18755 Posts

Posted - May 19 2016 :  1:33:00 PM  Show Profile  Reply with Quote
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.

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

lac
Senior Member

30 Posts

Posted - May 20 2016 :  09:51:44 AM  Show Profile  Reply with Quote
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.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18755 Posts

Posted - May 20 2016 :  11:27:26 AM  Show Profile  Reply with Quote
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.

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

lac
Senior Member

30 Posts

Posted - May 26 2016 :  02:04:51 AM  Show Profile  Reply with Quote
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

Edited by - lac on May 26 2016 02:05:08 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18755 Posts

Posted - May 26 2016 :  5:14:48 PM  Show Profile  Reply with Quote
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.

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