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
 '.' improvement
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

znakeeye
Tomato Guru

379 Posts

Posted - Jan 17 2008 :  10:19:19 AM  Show Profile  Reply with Quote
I have this text (cursor at end):
AfxGetApp|

If I type '.' the most reasonable is to insert "()->". That is, the parentheses should be inserted automatically. The same goes for ';' when there are no (or only default) parameters:
myString.Trim|

';' should generate "();"

Motivation
I use backspace quite frequently. That often means I unintentially (or sometimes intentionally) delete the parentheses. Similarly, I often copy function names and then have to add the parentheses manually.

znakeeye
Tomato Guru

379 Posts

Posted - Jan 17 2008 :  10:23:28 AM  Show Profile  Reply with Quote
Hmm, I believe comma (',') should also complete the parentheses:

Fool(a.Fool, b.Fool;
generates:
Fool(a.Fool(), b.Fool());
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19022 Posts

Posted - Jan 17 2008 :  3:06:33 PM  Show Profile  Reply with Quote
If you accept a listbox for AfxGetApp or these member functions "Fool" then brackets should have been inserted for you.

If I understand correctly you have deleted the brackets. How is VA to know this was by accident, and not deliberate? You might be about to add a new local variable with this name, so the code without brackets is correct.

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

znakeeye
Tomato Guru

379 Posts

Posted - Jan 19 2008 :  04:59:18 AM  Show Profile  Reply with Quote
Yes, the brackets are inserted. But if I copy the function name I have to type them manually. I really don't see why the '.' shouldn't complete the parentheses too. It doesn't matter if a local variable called AfxGetApp is about to be declared -- there will never be a subsequent dot.

In Clipboard: AfxGetApp
Ctrl+V '.' should generate:
AfxGetApp()->

The same should happen for GetClientRect(), even though it requires parameters. Motivation: The parentheses should always be there.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19022 Posts

Posted - Jan 19 2008 :  2:34:22 PM  Show Profile  Reply with Quote
quote:
Originally posted by znakeeye

It doesn't matter if a local variable called AfxGetApp is about to be declared -- there will never be a subsequent dot.


I don't follow this. Why not? Create a variable of a complex type, and you use dot to access its members.

I see the appeal of having VA insert brackets, but I am concerned that it might cause problems. How accurate is this going to be?

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