Re: [Pydev-code] Re: parentheses autocompletion
Brought to you by:
fabioz
From: Karol P. \(R. Student\) <ka...@ri...> - 2005-07-12 16:06:02
|
Fabio Zadrozny wrote: > Waiting forward to see it... :-) >=20 > p.s. I'm also forwarding it to the pydev mailing list I was thinking parentheses auto-completion in the context of tuples. = The Java Eclipse editor will remove empty parentheses if your cursor is = between them and you hit backspace. i.e., something() ^ cursor in between the parentheses, and you hit backspace ...you will get... something It's just one of those niceties that the Java editor gives you. = However, in Python, () is an empty tuple, and [] is an empty list. So what does everyone think would be the best way to approach this? I = see three ways so far (there's probably more). 1. Like the Java editor, always delete the two parentheses if you have = the cursor between them. 2. Never delete the two parentheses. Just delete the left parenthesis = (current, simple behavior). 3. Sometimes delete the two parentheses, based on the context. I'm not = sure what kind of algorithm we could employ here because I couldn't = think of an example where I _wouldn't_ want the editor to delete both = parentheses for me. (1) is easiest to implement and I think I prefer it, so if I get the go = ahead I'll code that up. |