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
 Auto complete function applied to 1 thing
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

tjcbs
Ketchup Master

98 Posts

Posted - May 19 2017 :  5:08:30 PM  Show Profile  Reply with Quote
Suppose I have a variable or symbol, SomeVarOrSymbol
Suppose I want to replace an occurance of SomeVarOrSymbol with a transformation of it, via a function: Transform(var).

So, I start typing (| == the cursor):
Tra|SomeVarOrSymbol

Auto Complete pops up, and I select Transform.

Default behavior, since "TraSomeVarOrSymbol" is not a symbol:
Transform|

If I change the registry setting HKCU\Software\Whole Tomato\Visual Assist X\<IDE spec>\CompletionOverwriteBehavior to 1:
Transform|SomeVarOrSymbol

What I want:
Transform(SomeVarOrSymbol)|

Wasting years of my life, making a stupid game: http://www.indiedb.com/games/plannet

feline
Whole Tomato Software

United Kingdom
14761 Posts

Posted - May 20 2017 :  10:40:42 AM  Show Profile  Reply with Quote
The problem here is that we don't know where the closing bracket should go, so we cannot just insert it automatically. When you are typing at the end of the line, inserting the closing bracket is reasonable, since then you can adjust it as required.

Here, if you use Shift + End to select "SomeVarOrSymbol" and then press ( the selected text will be surrounded in round brackets, giving you the result you are looking for.

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

tjcbs
Ketchup Master

98 Posts

Posted - May 24 2017 :  2:08:08 PM  Show Profile  Reply with Quote
Then, at the very least, you can insert the opening bracket, and move the cursor to the end of the next symbol. You're solution won't work because I may be working with something in the middle of a line.

Wasting years of my life, making a stupid game: http://www.indiedb.com/games/plannet
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
14761 Posts

Posted - May 24 2017 :  2:44:42 PM  Show Profile  Reply with Quote
If we move the cursor to the end of the line, how long before someone says they are typing:

Transform(!SomeVarOrSymbol)

making assumptions about what comes next is something we try to avoid doing to often, since it is easy to get tripped up by them.

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

Mordachai
Tomato Guru

USA
158 Posts

Posted - Jun 02 2017 :  10:57:24 AM  Show Profile  Visit Mordachai's Homepage  Reply with Quote
Since I've been following this convo over in the other related feature request - and this issue is dear to my heart...

My "vote" is against any assumptions!

That's what got this feature into trouble in the first place!

_Just_ insert the rest of the text for the symbol selected in the suggestion.

Do NOTHING what-so-ever to any other text around it.

And life will be sooooo much simpler.

You can't know what I'm doing - you can't know what relationship it has to what follows, you can't know what relationship to what comes before - you simply cannot. So don't. Please!
Go to Top of Page

Mordachai
Tomato Guru

USA
158 Posts

Posted - Jun 02 2017 :  12:17:38 PM  Show Profile  Visit Mordachai's Homepage  Reply with Quote
Moar thinking...

1. Why not have the suggestions follow up with suggestions on what to do with the rest of the text? i.e. insert, overwrite, wrap in parens, etc.? So you accept suggestion, then choose how to handle the rest (again, with prefs allowing you to say "ask, always X, always Y, always Z")

2. If the text following the insertion point matches the text being inserted - then delete the exact match.
This happens a lot to me:
I'll be creating a new variation of a type or a function or whatever - starting from FormatFractionData creating FormatAreaData - and as I delete Format|Data the suggestion includes "FormatAreaData" - if I accept that (with my settings of always insert) then I get FormatAreaDataData. Since the "Data" is an exact duplicate, that duplication could be elided I think every time always without question. I think ;)

Anyway - two more thoughts...
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
14761 Posts

Posted - Jun 03 2017 :  09:48:58 AM  Show Profile  Reply with Quote
For your vote against assumptions, if you use the setting:

CompletionOverwriteBehavior = 1

in the registry, as explained here:

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

this should be exactly what you get. If it isn't what you get, then I would like to know what is happening for you, so we can try to work out why this is not working as designed.

For point 1, thinking a bit about what I am doing when I am editing existing text, and typing into the middle of a line, that any "always do X" setting is going to get in the way, since I am doing quite different things on different occasions.

For point 2, since you are changing a function call from one function to another, then yes, always deleting the duplicate text makes sense. I have put in a feature request for this, as an optional behaviour, to see what they make of it:

case=108651

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:
© 2017 Whole Tomato Software, Inc Go To Top Of Page
Snitz Forums 2000