Author |
Topic |
|
tjcbs
Tomato Guru
104 Posts |
Posted - May 19 2017 : 5:08:30 PM
|
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)|
|
|
feline
Whole Tomato Software
United Kingdom
19014 Posts |
Posted - May 20 2017 : 10:40:42 AM
|
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 |
|
|
tjcbs
Tomato Guru
104 Posts |
Posted - May 24 2017 : 2:08:08 PM
|
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. |
|
|
feline
Whole Tomato Software
United Kingdom
19014 Posts |
Posted - May 24 2017 : 2:44:42 PM
|
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 |
|
|
Mordachai
Tomato Guru
USA
224 Posts |
Posted - Jun 02 2017 : 10:57:24 AM
|
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! |
|
|
Mordachai
Tomato Guru
USA
224 Posts |
Posted - Jun 02 2017 : 12:17:38 PM
|
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... |
|
|
feline
Whole Tomato Software
United Kingdom
19014 Posts |
Posted - Jun 03 2017 : 09:48:58 AM
|
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 |
|
|
|
Topic |
|