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
 Technical Support
 Completion of words ending with "Name"
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

Stephen
Tomato Guru

United Kingdom
781 Posts

Posted - Aug 16 2004 :  05:16:20 AM  Show Profile
This is a weird bug, but I seem to be able to reproduce it reliably.

Consider the following code:
class CTeddyBear
{
	int GetTeddyBearName();
	int GetTeddyBearColour();
	int HelloBear()
	{
		int x = GetName();
	}
};
Now try and correct GetName() to GetTeddyBearName() by typing a T after Get, and accepting the suggestion from the suggestion box. When I do this, the result is GetTeddyBearNameName() -- in other words, the suggestion is inserted rather than overwriting the end of GetName() as it should.

The weird thing is that this only seems to happen if the trailing portion is "Name" or "name". Correcting GetColour() to GetTeddyBearColour() works as expected. So does correcting GetrName() to GetTeddyBearName(), or Getame() to GetTeddyBearName().

VAX 1246, .NET 2003.

Stephen Turner
ClickTracks http://www.clicktracks.com/
Winner: ClickZ's Best Web Analytics Tool 2003 & 2004

Edited by - Stephen on Aug 16 2004 05:17:18 AM

Stephen
Tomato Guru

United Kingdom
781 Posts

Posted - Aug 16 2004 :  07:48:32 AM  Show Profile
It also fails if the last word is Count. But, as I mentioned above, sometimes it works fine.

Stephen Turner
ClickTracks http://www.clicktracks.com/
Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19004 Posts

Posted - Aug 16 2004 :  07:57:23 AM  Show Profile
confirmed, .NET 2003 and VAX 1246
i will add a case tonight when i get home.

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

feline
Whole Tomato Software

United Kingdom
19004 Posts

Posted - Aug 16 2004 :  08:11:12 AM  Show Profile
i have found a possible pattern.
i have "stable symbols in italic" turned on. both GetName() and GetCount() are italic.

if the function is italic, then you type one character which prompts a suggestion listbox which you accept with tab then it goes wrong.

*experiments*
this does not happen with Get|EditSel()
it does happen with Get|Locale()
i had to shrink the TeddyBear class to get this to show up in the suggestion listbox.

GetEdit|Sel() is correctly converted into GetEditTeddyBearSel()

*doh*
Init|Storage() is correctly converted into InitTeddyBearStorage()

there seems to be a pattern here, but i am not certain of the trigger condition.

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

feline
Whole Tomato Software

United Kingdom
19004 Posts

Posted - Aug 16 2004 :  08:38:50 AM  Show Profile
this has just happened to me. in a .h editing the line:
class QEdit;

it became:
class QL|Edit;

at which point i accepted the suggestion listbox "QLineEdit"
and i ended up with:
class QLineEdit|Edit;

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

feline
Whole Tomato Software

United Kingdom
19004 Posts

Posted - Aug 16 2004 :  4:13:13 PM  Show Profile
case=212

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

Stephen
Tomato Guru

United Kingdom
781 Posts

Posted - Aug 17 2004 :  04:46:44 AM  Show Profile
Colour was OK, but Color is also broken. Wild guess, but I'm thinking it might be something to do with whether the trailing portion is a symbol that is already known about somewhere else? (Not that my test file includes any header files, but I think VAX always knows about standard headers even if they're not included).

Stephen Turner
ClickTracks http://www.clicktracks.com/
Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19004 Posts

Posted - Aug 17 2004 :  06:03:13 AM  Show Profile
yes, this fits all of the cases i found. all of the problem end parts are shown as italic, either coloured as functions or macro's when typed in on their own.

like you, i have very few includes, but the static symbols seem to be coming from a single global lookup list, regardless of the current includes.

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

support
Whole Tomato Software

5566 Posts

Posted - Aug 18 2004 :  6:17:07 PM  Show Profile
Your assessment is correct. VA X does not replace trailing characters if they form a symbol valid in any context. VA X assumes you are typing in front of existing code. (VA X checks any context because this is quick -- checking current context slows the insert too much.)

See "Suggestions Within Symbols" near the bottom of:
http://www.wholetomato.com/products/features/suggestion.html?more=yes

and "Completing Text to Left of Caret" in:
http://www.wholetomato.com/products/features/members.html?more=yes

We opted for this behavior because VA X used to eat code. We believe we aggravated Larry the most. Can't remember.

Can you suggest a case in which VA X should eat code, ie an exception to the policy of not eating if the trailing characters make a symbol?

Edited by - support on Aug 18 2004 6:27:17 PM
Go to Top of Page

WannabeeDeveloper
Tomato Guru

Germany
775 Posts

Posted - Aug 18 2004 :  6:30:51 PM  Show Profile
Hmm... I'd say eat everything that is already part of the Symbol I try to get, until a non-symbol-character (like "{[()]}").
For example, if I have a variable called MyName and MyLastName,
I put the Caret into MyName and type MyL|Name, it should suggest MyLastName, and on accepting completely replace MyName with MyLastName.


Edited by - WannabeeDeveloper on Aug 18 2004 6:31:37 PM
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Aug 18 2004 :  7:10:10 PM  Show Profile
Wannabee's example is what VA X did long ago. The scenario seems fine until you have existing code, place the caret in front of it and start typing. Your existing code starts disappearing. Oops.

If you have this statement:
name();

and want to add an "if (MyLastName==0)" to guard the call to name(), you move your caret in front of name() and start typing:
if (MyL|name();

If you accept a suggestion for MyLastName, you want name() to remain intact:
if (MyLastName|name();

We found it more annoying to have disappearing code, and so did our users, than it was to have extra remnants.

Edited by - support on Aug 18 2004 8:06:51 PM
Go to Top of Page

WannabeeDeveloper
Tomato Guru

Germany
775 Posts

Posted - Aug 18 2004 :  7:17:43 PM  Show Profile
Yup, looks like the old behaviour.
But, whenever I (just me, might be different for others) enter any new code above any existing code, first I add some NewLines/Blank Lines to the code, in order to find it quickly or be able to delete it without having to be too cautious (frightened to delete working, existing code when I rollback my stupid experiments).

That way the "disappearing code" never occured to me.

It's bad that it did for other users...

Go to Top of Page

Stephen
Tomato Guru

United Kingdom
781 Posts

Posted - Aug 19 2004 :  04:40:49 AM  Show Profile
I see the conflict, but I would definitely prefer it to eat. Like Wannabee, I don't think I would type new code onto the beginning of a word like in your example.

The problem at the moment is that almost any real word falls foul of this rule, because it occurs in a header file somewhere. Which reminds me -- you didn't explain why my example fails at all, given that nothing is #include'd in that file. Does VAX really implicitly include all standard header files in every file? Doesn't it have some better idea than that of what's in scope?

Stephen Turner
ClickTracks http://www.clicktracks.com/
Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19004 Posts

Posted - Aug 19 2004 :  06:02:06 AM  Show Profile
Stephen, the answer is the comment:

quote:
Originally posted by support

VA X does not replace trailing characters if they form a symbol valid in any context.


taking static symbols as an example, there seems to be a single global list of these, which is built and then remembered when these are parsed.

i have seen static symbols shown in italics even though the relevant .h has not yet been included.

from memory of other threads, this is down to VAX's policy of helping you type, which can involve pulling in suggestions from any open code file.

as for adding in front of existing code, i often have to go from:
testFuncion();

via:
nE|testFuncion();

on the way to:
nErr = |testFuncion();

when i suddenly care about the return value, normally when i am debugging something, or someone else has just changed one of the ground rules on me.

while developing new code, changing the forward declarations of class names in .h's is also very common, hence my example:

class QEdit;

becoming:
class QL|Edit;

on the way to:
class QLineEdit|Edit;


to be honest, i want VAX to read my mind, so it will do the correct thing always

*considers* now i know what is happening, and why, i can live with this. deleting code when i am adding if statements or assignment statements to existing code would be a *deeply* bad thing

WannabeeDeveloper, if i am making small changes to code i know well i simply edit the lines directly, and use the undo buffer if i need to. sometimes i will undo 20 minutes of work if it all fails horribly.

however, if i am doing a bulk replace of a chunk of code, i will comment the original code, comment it out, and then edit the live copy.

this is all about saving typing. it is less typing to just edit the code in place. also, less chance of forgetting to delete the reference code.

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

Stephen
Tomato Guru

United Kingdom
781 Posts

Posted - Aug 19 2004 :  06:46:58 AM  Show Profile
It seems to pull in suggestions from files that have never been included or seen. I opened my TeddyBear file as soon as I started up the IDE, without opening any project, and it still had this problem.

I think this may be the cause of a lot of the bugs where symbols are coloured in the wrong category, just because they happen to exist in another category in some other unrelated file.

Stephen Turner
ClickTracks http://www.clicktracks.com/
Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Aug 19 2004 :  5:56:37 PM  Show Profile
Suggestions are taken from many places, including recently typed strings and nearby strings. VA X keeps a history so suggestions remain "smart" after you restart your IDE. Only suggestions valid in a context are offered.

If we understand the TeddyBear example, Name() is left untouched because it exists somewhere, albeit not valid in the current context. VA X does not want to remove code if not absolutely sure it should go.
Go to Top of Page

LarryLeonard
Tomato Guru

USA
1041 Posts

Posted - Sep 14 2004 :  11:19:49 AM  Show Profile
quote:
Originally posted by WannabeeDeveloper

Hmm... I'd say eat everything that is already part of the Symbol I try to get, until a non-symbol-character (like "{[()]}").

For example, if I have a variable called MyName and MyLastName, I put the Caret into MyName and type MyL|Name, it should suggest MyLastName, and on accepting completely replace MyName with MyLastName.
This seems like what I want VAX to do, also. Support, can you provide a counter-example that demonstrates how this behavior could eat code in an incorrect manner?

Sorry, I meant 'behaviour'...
Go to Top of Page

Stephen
Tomato Guru

United Kingdom
781 Posts

Posted - Sep 14 2004 :  11:53:04 AM  Show Profile
I guess it wasn't Larry that you aggravated the most with the eating behaviour, then.

Stephen Turner
ClickTracks http://www.clicktracks.com/
Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
Go to Top of Page

Stephen
Tomato Guru

United Kingdom
781 Posts

Posted - Sep 21 2004 :  06:27:26 AM  Show Profile
Support, is there any chance of reconsidering this? It bites me at least once a day, and it's really annoying. Most real words seem to be valid suggestions from somewhere, even if I've never heard of them.

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.

These other experienced users have said they agree with me (other threads in private forum): WannabeeDeveloper (above), LarryLeonard (above, 2864, 2896), patluja (2928). Would any other users like to proffer an opinion, for or against?

Stephen Turner
ClickTracks http://www.clicktracks.com/
Winner: ClickZ's Best Web Analytics Tool 2003 & 2004

Edited by - Stephen on Sep 21 2004 06:51:33 AM
Go to Top of Page

WannabeeDeveloper
Tomato Guru

Germany
775 Posts

Posted - Sep 21 2004 :  2:48:52 PM  Show Profile
Although I'm already mentioned, I'd second my vote here:

PRO! Totally PRO!

Bites me several times a day!
Make it an Option to let the user decide which behaviour he wants/needs!

I really hate getting "MySettings.bUseTrilinearTrilinear" everytime!
You read me? I HATE IT!!!one!!eleven!1


Go to Top of Page

Stephen
Tomato Guru

United Kingdom
781 Posts

Posted - Sep 21 2004 :  3:38:51 PM  Show Profile
Thanks for the support, Wannabee. I don't think it should be an option, myself. This is the sort of case where the developers have to decide which is the right thing.

Stephen Turner
ClickTracks http://www.clicktracks.com/
Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19004 Posts

Posted - Sep 21 2004 :  5:06:37 PM  Show Profile
i accepted support's explanation of how this feature works, since i agree that having it delete the wrong code really is a *bad* idea. the problem is that none of us can predict what VAX is going to do when we are typing

personally i consider the current behaviour to be the lesser of two evils *shrug* Stephen, your suggestion is definitely a major step forward also, it is so obvious once someone points it out!

i will put this to support, and hopefully something can be done about this.

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

LarryLeonard
Tomato Guru

USA
1041 Posts

Posted - Sep 22 2004 :  3:25:08 PM  Show Profile
Not to be be ugly, but in the spirit of an honest user being a developer's best friend: if this isn't fixed, I have to go back to 1246 or whatever. I can't live like this. I just spent thirty seconds trying to insert the "..\\Mumble\\" part of:

#include "..\\Mumble\\Snafu.h"

The second period erased the "snafu.h" part (I've reported this), and when I typed in Sna and hit tab, I got "SnaSnafu.h". Seriously annoying: anagrams or shortcuts or whatever they're called are not worth these two bugs...
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19004 Posts

Posted - Sep 22 2004 :  4:16:34 PM  Show Profile
i have raised this thread with the developers. hopefully they will do something about this.

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

support
Whole Tomato Software

5566 Posts

Posted - Sep 23 2004 :  12:23:35 PM  Show Profile
We believe Larry's problem with #include is separate from the consume-to-the-right issue.

case=267
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Sep 23 2004 :  12:26:14 PM  Show Profile
As for the consume-to-the-right problem, we are not yet willing to change behavior to always consume-to-the-right. Instead, we would like to understand more about the circumstances which cause you grief. We believe if we understood more, we might find a solution to make more people happy.

Are you navigating to the middle of an existing symbol and pressing Ctrl+Space?

Are you navigating to the middle of a symbol, typing a letter or two and picking from a suggestion list?

Something else?
Go to Top of Page

LarryLeonard
Tomato Guru

USA
1041 Posts

Posted - Sep 23 2004 :  12:55:02 PM  Show Profile
quote:
Originally posted by support

We believe Larry's problem with #include is separate from the consume-to-the-right issue.

case=267
Like I said, I've already reported this, and I think it already has a case; just grep this board for 'Cokie Roberts' and you'll find it. Hmmm... maybe you're saying 267 *is* the existing case? Either way...
Go to Top of Page

Stephen
Tomato Guru

United Kingdom
781 Posts

Posted - Sep 23 2004 :  1:05:45 PM  Show Profile
Thanks for giving this your attention.

I almost never press Ctrl-Space. So I'm navigating to the middle of a symbol, or else overtyping the middle of a symbol, and picking from a suggestion list.

The key question is, why am I doing this? And I'm not exactly sure. I know I do do it, but I need to catch myself doing it to be sure of the reason. But I think I might be changing the name of a function to make it more explicit (GetName() -> GetTeddyBearName(); go to the middle of the word, press T, accept the suggestion, whoops you've got GetTeddyBearNameName). Or perhaps I typed the wrong function to begin with, or I'm just cutting, pasting and editing some previous code, but the function I have and the function I want have similar names, so rather than type the whole thing again, I go to the middle and type. I'll look out next time it happens.

Stephen Turner
ClickTracks http://www.clicktracks.com/
Winner: ClickZ's Best Web Analytics Tool 2003 & 2004
Go to Top of Page

WannabeeDeveloper
Tomato Guru

Germany
775 Posts

Posted - Sep 23 2004 :  1:46:51 PM  Show Profile
That's it: Pure Lazyness!

When I have GetMySpecialSuperDuperName, but want GetMySpecialSuperDuperLastName, I put the Caret there:
GetMySpecialSuperDuper|Name and type "L". VAX suggests GetMySpecialSuperDuperLastName (cause I have already defined it somewhere else) which I gladly accept, but only to get GetMySpecialSuperDuperLastNameName.

Imagine what happens with GetSpecialSuperDuperLastName when I want GetMySpecialSuperDuperLastName...

GetMySpecialSuperDuperLastNameSpecialSuperDuperLastName

I only (read my lips: ONLY) type within existing symbols with a reason. I do not type stuff I might regret in a few hours!
So let VAX replace the whole word I'm currently typing in with the suggestion I accept...


Edited by - WannabeeDeveloper on Sep 23 2004 2:15:07 PM
Go to Top of Page

WannabeeDeveloper
Tomato Guru

Germany
775 Posts

Posted - Sep 23 2004 :  2:21:04 PM  Show Profile
quote:
Originally posted by WannabeeDeveloper


Imagine what happens with GetSpecialSuperDuperLastName when I want GetMySpecialSuperDuperLastName...

GetMySpecialSuperDuperLastNameSpecialSuperDuperLastName



I have to correct me:
It does NOT give that stupid long name, it just does what we want: replace the symbol I'm typing in.

Why does it replace the whole word when the change is:
GetSpecialSuperDuperLastName
GetMySpecialSuperDuperLastName

and not on:
GetMySpecialSuperDuperName
GetMySpecialSuperDuperLastName
???

Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Sep 24 2004 :  12:29:55 AM  Show Profile
Text to the right of an insert is not replaced if it forms a symbol valid in any context. VA X assumes you are typing new code in front of existing code.

http://www.wholetomato.com/products/features10.1/members.html?more=yes&goto=middle
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000