Author |
Topic |
PatLuja
Tomato Guru
Belgium
416 Posts |
Posted - Sep 24 2004 : 02:12:38 AM
|
Dear support,
The example on the page you link to has an error. The last code in "Completing in the Middle of a Symbol" should be:int ColSpin;
m_FixRowSpin|ColSpin; This is because this is an addition to the first piece of code, not the second.
With kind regards, Patrick Luja |
|
|
feline
Whole Tomato Software
United Kingdom
19020 Posts |
Posted - Sep 24 2004 : 10:52:27 AM
|
quote: Originally posted by support
As for the consume-to-the-right problem, we are not yet willing to change behavior to always consume-to-the-right.
quote: Originally posted by Stephen
My proposal is that the following word or word portion should be deleted if and only if it's the trailing portion of the accepted suggestion.
my emphasis Stephen's suggestion will fix most (maybe all) of the cases that people are complaining about.
here is a nice simple example, where this bites me. in my header files i normally forward declare the classes i am using, ie:
class QPushButton;
class QLineEdit; while i am writing this class, i find i need to add a QTextEdit. being a lazy typist, i do the following:
* move the caret onto the QLineEdit line * press ctrl_c followed by ctrl_v - which copies the entire line since nothing was selected * delete "Line" out of the middle of the copy * start typing, so i have:
class QTe|Edit; i now accept the QTextEdit suggestion that just popped up, i did not press ctrl_space. if no suggestion had appeared, i would have finished typing Text.
accepting the suggestion gives me:
class QTextEdit|Edit; *doh* like several others, i often edit existing function calls, since in Qt a lot of the function calls are similar (they have common "words"), so when copy - pasting code, or simply redesigning it, changing a few letters in the middle is the fastest solution.
i prefer to think more, find the fastest way of doing the edit, and type less. |
zen is the art of being at one with the two'ness |
|
|
LarryLeonard
Tomato Guru
USA
1041 Posts |
Posted - Sep 24 2004 : 11:38:16 AM
|
quote: Originally posted by feline
quote: Originally posted by support
As for the consume-to-the-right problem, we are not yet willing to change behavior to always consume-to-the-right.
quote: Originally posted by Stephen
My proposal is that the following word or word portion should be deleted if and only if it's the trailing portion of the accepted suggestion.
my emphasis Stephen's suggestion will fix most (maybe all) of the cases that people are complaining about.
Yes, this is what at least the three of us have been saying repeatedly. I have asked support to provide a *counter-example* to prove that our idea is wrongheaded, and have not heard one yet. I have also not heard anything from them that indicates that they are hearing what I will call the "if-and-only-if" suggestion...
|
|
|
Stephen
Tomato Guru
United Kingdom
781 Posts |
Posted - Sep 29 2004 : 06:27:48 AM
|
OK, I promised you an example next time it happened. Here it is.
I defined two enums, TIMEOFDAY and REVERSEDTIMEOFDAY. They were used in a switch statement, with very similar code. I first wrotecase TIMEOFDAY:
{
do stuff;
} Then I copied and pasted that clause to make the case for REVERSEDTIMEOFDAY. I put the cursor in front of TIMEOFDAY, hit R, was offered REVERSEDTIMEOFDAY, hit Tab to accept it, and it gave me REVERSEDTIMEOFDAYTIMEOFDAY instead.
|
Stephen Turner ClickTracks http://www.clicktracks.com/ Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
|
|
|
WannabeeDeveloper
Tomato Guru
Germany
775 Posts |
Posted - Sep 29 2004 : 06:33:01 AM
|
Nice one, Stephen.
Those ones always happen to me, too... just when you're asked to provide an example, you cannot think of one. Thanks!
|
|
|
|
Stephen
Tomato Guru
United Kingdom
781 Posts |
Posted - Sep 29 2004 : 08:07:13 AM
|
What puzzles me is why this doesn't bite WT developers the whole time too. Don't they use completion at the beginning and middle of words? |
Stephen Turner ClickTracks http://www.clicktracks.com/ Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
|
|
|
Stephen
Tomato Guru
United Kingdom
781 Posts |
Posted - Sep 29 2004 : 12:59:07 PM
|
And it just happened to me for the second time today. This time I had used the wrong variable name: m_timeFrom instead of m_dwSecsFrom (both variables exist in this class). So I highlighted the "time" part of m_timeFrom and started typing "dwSecs". After a couple of characters, a completion listbox offered me m_dwSecsFrom, which I accepted and ended up with m_dwSecsFromFrom.
At the moment, completion at the beginning and middle of words frequently slows me down rather than speeding me up. |
Stephen Turner ClickTracks http://www.clicktracks.com/ Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
|
|
|
LarryLeonard
Tomato Guru
USA
1041 Posts |
Posted - Sep 29 2004 : 1:17:43 PM
|
quote: Originally posted by Stephen
What puzzles me is why this doesn't bite WT developers the whole time too. Don't they use completion at the beginning and middle of words?
Maybe they subconsciously work around this bug: when it happens, they back up and rename one of their variables to keep it from recurring!
|
|
|
support
Whole Tomato Software
5566 Posts |
Posted - Sep 29 2004 : 5:49:57 PM
|
Our intention is change behavior so that if you move into the middle of a word, then select from a suggestion list or completion listbox, characters to the right get consumed in all cases. If you move to the front of a word and select, characters to the right get consumed only if they do not form a symbol valid in any context.
Since the changes will likely break a few things, we will implement them after VA X 10.1 is stable enough to reach a wider audience. Then we dump the beta code on you again.
Seriously, we appreciate your time and feedback. |
|
|
Cezariusz
Tomato Guru
Poland
244 Posts |
Posted - Sep 30 2004 : 02:12:10 AM
|
feline, you case could be probably solved with a simple VA X logic, like this: if characters to the right are equal to the tail of the inserted symbol, they should be eaten For example:class QTextEdit|Edit; logic: QTextEdit ends with Edit, so we should eat Edit |
Cezariusz Marek https://midicat.net/ |
|
|
Stephen
Tomato Guru
United Kingdom
781 Posts |
Posted - Sep 30 2004 : 08:39:45 AM
|
quote: Originally posted by support
Our intention is change behavior so that if you move into the middle of a word, then select from a suggestion list or completion listbox, characters to the right get consumed in all cases. If you move to the front of a word and select, characters to the right get consumed only if they do not form a symbol valid in any context.
Thank you for thinking about this. It seems that your proposal would fix my second example above, but not my first, right?
I have to admit that I don't fully understand the proposal though. As soon as you type the first letter on the front of a word, your caret is in the middle of the word. Or are you going to remember whether I started typing at the front of the word? So starting to type, then going right one character and left one character would suddenly give me different behaviour?
I also don't see why you would want to eat symbols that are not part of the accepted suggestion. This sounds like you're deliberately creating the bug reported in the 10.1 beta forum, threads 2928 and 2941.
Actually, I've yet to understand what's wrong with my rule of "eat the trailing portion if and only if it's the tail of the accepted suggestion". I'm sure you've thought about this, but my rule still seems right to me, and to other people who've commented in this thread. What are we missing? Is there a case where it does the wrong thing?
I'm sorry to bang on about this. I know I'm being a bore over this issue, but I'm worried that you're going to fix it and it's still going to be wrong.
Is this the first thread ever to reach three pages? |
Stephen Turner ClickTracks http://www.clicktracks.com/ Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
|
|
|
LarryLeonard
Tomato Guru
USA
1041 Posts |
Posted - Sep 30 2004 : 09:24:07 AM
|
quote: Originally posted by Stephen Actually, I've yet to understand what's wrong with my rule of "eat the trailing portion if and only if it's the tail of the accepted suggestion". I'm sure you've thought about this, but my rule still seems right to me, and to other people who've commented in this thread. What are we missing? Is there a case where it does the wrong thing?
Good question. I've asked it twice myself in this thread. The reason I keep asking it is that I believe that the process of trying to answer it will make it blindingly clear that the 'if and only if' solution is either right or wrong.
quote: Originally posted by Stephen I'm sorry to bang on about this. I know I'm being a bore over this issue, but I'm worried that you're going to fix it and it's still going to be wrong.
Don't be sorry, because IMHO it's just not working the way it is now, and it's not working in a really annoying way.
|
|
|
WannabeeDeveloper
Tomato Guru
Germany
775 Posts |
Posted - Sep 30 2004 : 09:41:32 AM
|
quote: Originally posted by Stephen
Is this the first thread ever to reach three pages?
Better ask: Is this the behaviour that made us create a 3-page-thread?
In my opinion, Stephen and Larry are absolutely right: Eat everything that is NOT within the Symbol I just accepted. Period.
I just don't want to see GetTeddyBearNameName anymore when accepting a valid suggestion. Period. I do have a reason to put the Caret into a valid symbol and start typing. Everytime I do what is explained several times on page 2 of this thread, I end up deleting cloned parts of the valid symbol-name, which is absolutely unnecessary for VAX to leave them there... When I accept "GetTeddyBearName", I expect "GetTeddyBearName" and NOT "GetTeddyBearNameName". Why would I accept it from a suggestion-list anyway? There really is no point in accepting an entry and then not getting it...
When I change "GetBearNameEntry" and accept "GetTeddyBearName" as a suggestion, I want "GetTeddyBearNameEntry". When I change "GetBearName" and accept "GetTeddyBearName" as a suggestion, I want "GetTeddyBearName".
Do NOT delete parts that are NOT within the accepted symbol. It should be simple... or isn't it? If it is not, please tell us, WHY...
I worked in earlier Versions of VA (note the missing X), and I *loved* that feature...
|
|
Edited by - WannabeeDeveloper on Sep 30 2004 09:43:50 AM |
|
|
support
Whole Tomato Software
5566 Posts |
Posted - Sep 30 2004 : 3:42:36 PM
|
We will remember whether or not you moved into the middle of the current symbol. Hence, moving into GetBearNameEntry, say after GetBear, and pressing Ctrl+Space (or accepting a suggestion after you start typing,) will always consume characters to the right. You will not be left with GetBearAgeNameEntry if you select "Age" from a completion listbox or suggestion list.
The sequence will be: GetBear|NameEntry GetBearA|NameEntry GetBearAge|
On the other hand, if you move to the front of a valid symbol and start to add new code, e.g. an "if" statement to guard existing code, we will not remove the first symbol of your existing code. (Note, this is not currently an issue for people who add a blank line or space prior to existing code before typing new code, but not all of us do that.)
For example, you have: age=5; And you want to add "if (height>10)" prior to the statement. You move the caret to the left of age, start typing and accept the suggested "height" after typing just an "h." if (h|age=5; We will not consume "age." if(height|age=5; |
|
|
Stephen
Tomato Guru
United Kingdom
781 Posts |
Posted - Oct 01 2004 : 07:30:56 AM
|
You know how it is when you hear politicians interviewed on TV or radio? The interviewer asks them a question, and they answer a slightly different question that they would prefer to have been asked. It's always frustrating listening to them. And somehow I'm beginning to have that feeling in this thread. (I think Larry was having it some time ago. Maybe he's just more astute than I am.)
Let's try again: 1) Do you agree that your proposal would fix my second example from Wednesday, but not my first? 2) Why would you want to eat symbols that are not part of the accepted suggestion, even from the middle of words? 3) Did you consider the "if and only if" suggestion that I and many others have been advocating? Why is your suggestion better?
I feel guilty going round this loop again, but at the same time I feel I haven't got many answers on the previous iterations. It may not seem like it to you, but I really am trying to be helpful. Unlike the interviewer, I'm not trying to catch you out. We all want VA to Do The Right Thing.
|
Stephen Turner ClickTracks http://www.clicktracks.com/ Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
|
|
|
feline
Whole Tomato Software
United Kingdom
19020 Posts |
Posted - Oct 01 2004 : 08:25:12 AM
|
for reference, the post Stephen is referring to is:
quote: Originally posted by Stephen
OK, I promised you an example next time it happened. Here it is.
I defined two enums, TIMEOFDAY and REVERSEDTIMEOFDAY. They were used in a switch statement, with very similar code. I first wrotecase TIMEOFDAY:
{
do stuff;
} Then I copied and pasted that clause to make the case for REVERSEDTIMEOFDAY. I put the cursor in front of TIMEOFDAY, hit R, was offered REVERSEDTIMEOFDAY, hit Tab to accept it, and it gave me REVERSEDTIMEOFDAYTIMEOFDAY instead.
looking at this, and considering supports post, i can see that it will not fix this case. to me the "if and only if" solution seems easier to describe, easier to implement, and more reliable. perhaps we are all missing something?
i will try and speak to support about this, and see if i can pin down where this confusion stems from. |
zen is the art of being at one with the two'ness |
|
|
Stephen
Tomato Guru
United Kingdom
781 Posts |
Posted - Oct 01 2004 : 09:00:47 AM
|
Thank you, Colin.
I'm quite happy to find out I've missed something and I was wrong all along. But I would also like to understand why. |
Stephen Turner ClickTracks http://www.clicktracks.com/ Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
|
|
|
support
Whole Tomato Software
5566 Posts |
Posted - Oct 01 2004 : 10:51:55 AM
|
We failed to describe the exception. We will consume to the right if it is a suffix of what one picks from a suggestion list, whether or not one moved to the front or middle of a symbol when typing. Hence, we believe we will accommodates the TIMEOFDAY example. |
|
|
feline
Whole Tomato Software
United Kingdom
19020 Posts |
Posted - Oct 01 2004 : 10:52:33 AM
|
edit: *mutter* support went and posted while i was typing all of this in. i suspect we need to wait and see how their method works in the real world.
thinking about this, i have worked out the case:
int TeddyCount = 0;
int Count = 0;
Count + 2; i now want to edit the 3rd line:
Teddy|Count + 2; and i accept the suggestion "TeddyCount" at this point.
i want to end up with:
TeddyCount = |Count + 2; in this rather contrived case the "if and only if" method will leave me with:
TeddyCount| + 2; while supports plan will give me what i want.
of course, if i accepted the suggestion one character earlier or later then the "if and only if" method would also have been fine.
as soon as you know the rules, you are in a good position to find a case that will break them. the real question is, which plan is better?
being selfish, the "if and only if" method sounds a lot easier to explain on the forum to new members. also, if you start class member variables with "m_" and use a form of hungarian notation then it will be very hard to find a case where "if and only if" fails.
the real question is, if you don't do these things, how often is the "if and only if" method worse than supports plan? i presume support think there method will work in the majority of cases.
i want to make sure i have all of this straight in my own mind before i catch up with support. it is hard to argue in favour of the "if and only if" method if i haven't thought it through carefully. |
zen is the art of being at one with the two'ness |
Edited by - feline on Oct 01 2004 11:02:03 AM |
|
|
support
Whole Tomato Software
5566 Posts |
Posted - Oct 01 2004 : 6:26:22 PM
|
{quote]...of course, if i accepted the suggestion one character earlier or later then the "if and only if" method would also have been fine.[/quote]
Count is a suffix of TeddyCount regardless of when you accepted the suggested completion, e.g. after Ted. We are likely to consume the exiting Count in our new scheme.
We do not believe the "consume if and only if the right is a suffix" is the best option. Though easiest to describe, the rule does not accommodate copying of code and renaming of symbols in the copy. One will expect suggestions to consume existing symbols.
We can find cases with any scheme. We will look for the best option, and are open to doing what's best. We just won't start until 10.1 is available to a wider audience since we are likely to break a few things when we implement something. |
|
|
Topic |
|