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 154579 - Alt-Enter & context-sensitve actions
Summary: Alt-Enter & context-sensitve actions
Status: RESOLVED WONTFIX
Alias: None
Product: editor
Classification: Unclassified
Component: Hints & Annotations (show other bugs)
Version: 6.x
Hardware: All Windows Vista
: P3 blocker with 3 votes (vote)
Assignee: Milutin Kristofic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-04 10:39 UTC by puce
Modified: 2016-07-07 07:26 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description puce 2008-12-04 10:39:46 UTC
When selecting something in the editor, pressing Alt-Enter invokes the pop-up menu with the context-sensitve actions of
the little yellow light bulb in the left side vertical gutter. There are some issues with this:

- When pressing the short-cut, the pop-up menu should appear right under the curser, not at the left side of the editor.
- The short-cut should also work when the cursor is just inside or at the border of a token and not only if the token is
selected (see Eclipse)
- The short-cut should be changed from Alt-Enter to Ctrl-1 (D-1) because:
  - Alt-Enter is hard to use with one hand (at least on a keyboard with a de_CH layout)
  - Ctrl-1 is the short-cut used in Eclipse and would help make developers coming from Eclipse to feel at home more quickly.
Comment 1 Petr Dvorak 2008-12-04 10:57:38 UTC
Hi,

thank you for these suggestions. I will change the issue status to enhancement, as what you describe is not a defective
behavior - it currently works as designed.

> The short-cut should also work when the cursor is just inside or at the
> border of a token and not only if the token is selected (see Eclipse)

Well, it already does so - type "Thread.sleep(1000);" in some method that doesn't handle thrown exception. Then place
caret above "Thread" (do not select the word, just place caret in the middle) and press Alt+Enter... You will get some
suggestion about how to handle the problem with thrown exception...

Selection is needed only when there is no problem and hints are suggestive - and IMO the selection is required
principally. You need to have some text selected in order to surround it with "for", "while", etc...
Comment 2 puce 2008-12-04 12:06:50 UTC
Well, it's true for the cases like Thread.sleep, but in Eclipse you can eg. create a constructor, define some parameters
and at the end of the parameter name you press Ctrl-1 -> you get the option "Assign parameter to new field".
No selection is required. 

>Selection is needed only when there is no problem and hints are suggestive - and IMO the selection is required
>principally. You need to have some text selected in order to surround it with "for", "while", etc...

In Eclipse, some times there are different actions when selecting a token/ expression than when the cursor is just
inside or at the border of an unselected token. 

But at least the selection of a single token seems to be unnecessary to me, since you can handle the token at the
current cursor position as though it were selected. (Which seems not to be the case in Eclipse as you get the "Change
modifier to final" option only if the parameter is selected, but maybe we can do better. :-) )
Comment 3 puce 2008-12-05 15:53:00 UTC
Interestingly, sometimes it is not needed to select the token, eg. for "Assign Return Value To New Variable".
Comment 4 Svata Dedic 2012-06-07 13:09:58 UTC
Assignment to CTRL-1 is already fixed in Eclipse keymap. The rest is a RFE for Editor Hints module.
Comment 5 Martin Balin 2016-07-07 07:26:08 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss