This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 99576 - Add end tokens when missing after else, rescue, etc.
Summary: Add end tokens when missing after else, rescue, etc.
Status: RESOLVED WONTFIX
Alias: None
Product: ruby
Classification: Unclassified
Component: Editing (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Erno Mononen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-30 17:31 UTC by Torbjorn Norbye
Modified: 2009-12-21 05:46 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Torbjorn Norbye 2007-03-30 17:32:01 UTC
Currently "end" is automatically inserted when missing from block-opening tokens like if, do, case, 
class, etc.  However, there are usecases when it should be inserted after top-level (but not opening) 
tokens like, else, elseif, rescue, etc.  See discussion from dev@scripting.netbeans.org:

	From: 	  charles.nutter@sun.com
	Subject: 	Re: if...else...end and begin...rescue..end completion
	Date: 	March 30, 2007 9:05:46 AM PDT
	To: 	  dev@scripting.netbeans.org
	Reply-To: 	  dev@scripting.netbeans.org

Tor Norbye wrote:
> I'm sorry, I didn't really follow this. Can you explain again what it is you expect would happen?
> The way it works now is that if you type "if" and hit enter, you end up with
>     if foo
>          |
>     end
> you can then type else - and it will automatically reindent the line to align with "if" as soon as you 
type the final "e" in else.
> (If you keep typing, let's say elseq = 50" it will immediately (on the next keystroke) move indentation 
back the way it was.)
>What was it you were expecting or would like to see?

What I expected was that if I backspaced out end and typed else, it would undent it and add a new end 
for me.

Oddly, that's what seemed to me, since if I have an existing if...end and want to add an else, I tend to 
kill the end and start a new else block. Maybe a personal quirk?

Anyway, I did try it your way and I must say I think I may like it better. But I'm only one person...it 
wasn't immediately intuitive to me that I would add an "else" in the middle of my "if" block, though I like 
that it works so well.

- Charlie
Comment 1 Jiri Kovalsky 2007-07-03 13:58:35 UTC
Reassigning this issue to newly created 'ruby' component.
Comment 2 Martin Krauskopf 2008-03-13 17:10:00 UTC
This is really edge-case, might be not worth to fix? Rather RFE. Nobody ever complains about it - except Charles, who is
now surely used to the editor workflow ;)
Comment 3 Quality Engineering 2009-12-21 05:46:53 UTC
This bug was reported against NetBeans IDE 6.0 or an older release, or against a non-maintained module. NetBeans team does not have enough resources to get to this issue, therefore we are closing the issue as a WONTFIX. If you are interested in providing a patch for this bug, please see our NetFIX guidelines for how to proceed. 

We apologize for any inconvenience.


Thank you.
The NetBeans Team