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
 Advance caret after inserting last parameter
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Uniwares
Tomato Guru

Portugal
2322 Posts

Posted - Sep 10 2004 :  3:53:53 PM  Show Profile
One thing that permanently annoys me:
after inserting the last parameter of a function by selecting it from the suggestion list, the caret remains inside the function brackets. So one always needs to advance the caret to continue typing. I think this case could be detected by VAX.

sample:
a class X with a member function SomeFunc(int param),
you type varname. select SomeFunc from the suggestion list, hit enter, now you have varname.SomeFunc(|), continue typing the name of an existing variable so the suggestion list pops up, select the suggestion, hit enter.
Now we have varname.SomeFunc(somevar|). The caret blinks just before the closing bracket and the function shows a tooltip. (when you have an overloaded function its even more annoying, because you must cancel the tooltip or use only cursor left/right.)
Since I made a valid selection, the function is complete and VAX could move the caret after the bracket. I have found that the cases where I want to type something else after selecting the suggestion are rather rare. Personally I would prefer to move the caret back in this cases.

rblondeau
Tomato Guru

Canada
102 Posts

Posted - Sep 10 2004 :  11:36:26 PM  Show Profile
The kind of functionality that you are asking for has been mentioned many times before.

I for one do not like how when you select a function from a suggestion list box(?) the caret stays between the parentheses of a function that has no arguments. It should put the caret after the closing parentesis.

When I made a post about this, I was told that the problem does not occur in class methods, and that I was able to get around the problem by simply typing a closing brace, and that VAX would overwrite it's inserted parenthesis with the one I typed, thereby only having one single parenthesis at the end of the function call.

See http://66.150.196.105/forum/topic.asp?TOPIC_ID=2427
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19015 Posts

Posted - Sep 13 2004 :  4:45:29 PM  Show Profile
i am convinced, since this irritates me on a regular basis as well. i am not sure VAX should do anything in the case where the function has another overload taking more parameters though.


case=287


consider a function that takes between 1 and 4 parameters. there are loads of these in the Qt API we use at work. in most cases i need to pass in 2 parameters. if VAX consistently moves my caret to after the closing bracket when i enter one parameter, it is going to drive me mad in a very short space of time.

VAX has no way of knowing how many parameters i am going to enter. if it is a function i know well i dont move through the overloaded function parameter tooltips, so you cannot use the current tooltip as the guide for how many parameters i am going to enter either. we really need the VAX mind reading option turned on at this point

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

rblondeau
Tomato Guru

Canada
102 Posts

Posted - Sep 13 2004 :  5:50:21 PM  Show Profile
What you say is true, but how many times have you had a function that has no parameters and no overloads? As soon as you choose the function from the dropdown, VAX should complete it, parentheses and all. That has always been my main complaint.
Go to Top of Page

Cezariusz
Tomato Guru

Poland
244 Posts

Posted - Sep 14 2004 :  02:30:50 AM  Show Profile
I agree that VA X should take into consideration what I've selected from the list of overloads. If I enter opening parenthesis by hand, it should just insert the closing one, leave the caret beetwen them, and eat the closing when necessary.
But when I select a function from the list, and it has no arguments, it should plece the caret after the closing parenthesis, but still eat it when typed.

That reminds me two interesting features from netBeans:

1. When a function with parameters is selected from the list, it inserts not only the function name followed by the opening parenthesis, but also the name of parameter, which is selected. So when you start typing it gets overwritten, but you can leave it by pressing End. Same happens with other parameters, as soon as you type the parameter separating comma.

2. When you are inside function's parameter list and type semicolon, the caret automatically jumps to the end of line and puts the semicolon there. Of course if doesn't happen inside for statement.

Cezariusz Marek
https://midicat.net/
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19015 Posts

Posted - Sep 14 2004 :  07:33:58 AM  Show Profile
quote:
Originally posted by rblondeau

What you say is true, but how many times have you had a function that has no parameters and no overloads?


i would have said VAX does place the caret after the closing bracket in this case. to double check, i have just added the class member function:

void ee_win::Refresh()  { ; }


to my class .h file. not the most exciting function, but a good test.

in the cpp file, in one of the member functions, i typed:
this->Refr|

pressing enter to accept the suggestion "Refresh" i ended up with:
this->Refresh()|

VAX inserted both brackets and the caret was placed after the closing bracket. this is what normally happens for me.


remembering the comment about class member functions from earlier up the thread, i have just added the local, no class member function:

static void localRefresh()
{
    // do some refresh code here
}


back in my class member function, i now added:
this->Refresh();
loc|


again, using enter to accept the suggestion "localRefresh" i ended up with:

this->Refresh();
localRefresh()|


again, the brackets have been inserted and the cursor has been placed after the closing bracket.

this is all with VS .NET 2003, VAX 1260 using C++

rblondeau, if you can help me reproduce this problem on demand, i will definitely add a case for it. i fully agree, this really is not what you want.

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

feline
Whole Tomato Software

United Kingdom
19015 Posts

Posted - Sep 14 2004 :  07:37:48 AM  Show Profile
Cezariusz, does 1 really help? it sounds strange to me.

number 2 sounds extremely useful

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

feline
Whole Tomato Software

United Kingdom
19015 Posts

Posted - Sep 14 2004 :  08:46:36 AM  Show Profile
thinking about number 2, netbeans seems to be a Java IDE. i have been wondering if there are any strange C++ situations (other than "for") where you would want to put a semi colon between round brackets. so far i haven't thought of one, but if we could find one, this might be a problem.

i am wondering if it could be an issue with macros, but so far i don't see how.

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

Cezariusz
Tomato Guru

Poland
244 Posts

Posted - Sep 14 2004 :  08:53:07 AM  Show Profile
quote:
Originally posted by feline

Cezariusz, does 1 really help? it sounds strange to me.



Well, I wouldn't recommend it if it didn't, would I ?

Yes, it helps because:
1. it helps you remember what parameter you are inserting
2. it doesn't hurt, it get's overwritten on the first character you type
3. if you are consistent in parameter names, you often don't have to change it, for example:
int GetSize(LPCTSTR szText);
int GetLength(LPCTSTR szText)
{
	return GetS

assuming you will get code completion now, with function GetSize, accepting it will end up with:
int GetLength(LPCTSTR szText)
{
	return GetSize(szText|)

where szText is selected and | is caret position. Now only End and semicolon.

Cezariusz Marek
https://midicat.net/
Go to Top of Page

rblondeau
Tomato Guru

Canada
102 Posts

Posted - Sep 14 2004 :  12:30:48 PM  Show Profile
quote:
Originally posted by feline

VAX inserted both brackets and the caret was placed after the closing bracket. this is what normally happens for me.




Ok, now I know that it used to do what I said it did . Maybe they fixed it on us and didn't say anything .

Anyhow, yes feline, it does work the way you say it does. I did do some digging and I remembered where it did not work the way I wanted it to. It's in the STL <groan...again with the STL> in the string class.

When selecting the string.end() or string.begin() or other similar methods, you are presented with a popup that indicates that there are two versions of the method: one that returns a const iterator and another that returns a non-const iterator. Both of these methods have no arguments. You select either of them and the opening and closing parentheses are provided, with the caret left between them.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19015 Posts

Posted - Sep 15 2004 :  3:29:07 PM  Show Profile
discussion of bug with caret position when entering functions moved to thread:
http://forum.wholetomato.com/forum/topic.asp?TOPIC_ID=2911

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

feline
Whole Tomato Software

United Kingdom
19015 Posts

Posted - Sep 16 2004 :  6:01:02 PM  Show Profile
place a semi-colon at the end of the line:

case=296


thinking about inserting the function parameter names as you type, VAX will need to use the selected parameter tooltip in some cases, ie where the function is overloaded to take different types for the same parameter, in order to work out the correct name to insert.

case=297

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000