Bug 6064 - Open on selection shouldn't require selection
Summary: Open on selection shouldn't require selection
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P1 normal (vote)
Target Milestone: 2.0 M3   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords: accessibility
Depends on:
Blocks:
 
Reported: 2001-11-19 10:02 EST by Nick Edgar CLA
Modified: 2002-02-11 07:16 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Edgar CLA 2001-11-19 10:02:52 EST
Build 20011116

- move the text insertion point into the middle of a type name in a Java editor
- press F3
- it has no effect

It would be better if it opened on the current word.

(I notice that it currently works for a partial selection, if the selection 
includes the start of the type name, as if it's doing code-assist or something.)

This is an issue for keyboard accessibility.  It currently requires you to move 
the cursor to the start of the word, hit CTRL+SHIFT+RIGHT to select the word, 
then F3.  It would be better if you could just move to the word and hit F3.
Comment 1 Dirk Baeumer CLA 2002-01-09 09:44:29 EST
Since accessibility is an important feature for 2.0 I think we should look into 
this.
Comment 2 Nick Edgar CLA 2002-01-09 11:00:09 EST
There was also a recent EC post about finding the decl for a method.
Somebody pointed him at F3, but he complained about having to select the whole 
word.
Comment 3 Erich Gamma CLA 2002-01-18 06:37:17 EST
if we do it we should do it consistently (e.g. search should do the same).
Comment 4 Claude Knaus CLA 2002-01-25 11:36:48 EST
I fixed it for OpenOnSelectionAction and OpenOnHierarchySelectionAction.

Dani, please add the corresponding change to OpenSearchDialogAction. What you
have to do is, if the selection is a ITextSelection, call something like
OpenOnSelectionAction.expandToWord(ITextSelection).
Comment 5 Dani Megert CLA 2002-01-28 06:34:09 EST
Agree to add the feature to Java search but not text search.

I don't like that also existing selections are expanded (e.g. if I select Object
in the work ObjectStreamField and press F3 I would expect class Object to be opened.
Idee is to move Claude's code to the StructuredSelectionProvider.

Comment 6 Dani Megert CLA 2002-01-28 06:47:29 EST
- Filed a new PR against JSearch to use StructuredSelectionProvider
- Backward parsing needs help from JCore.
Comment 7 Claude Knaus CLA 2002-01-28 08:01:54 EST
backed out change in OpenOnSelectionAction and OpenHierarchyOnSelectionAction
Comment 8 Erich Gamma CLA 2002-01-28 09:26:53 EST
To ensure that this is:
1) done consistently all over in the UI (e.g. refactoring is yet another 
example)
2) done correctly (determining the proper token boundaries)
This could be done as part of ICodeAssist.codeSelect(int offset, int length). 
When length == 0 then the.

Moving to Jdt Core for comment
Comment 9 Philipe Mulet CLA 2002-01-29 18:52:28 EST
What is it that you would precisely want ? If length==0, then it would find 
take the entire token starting at offset ?

This is quite easy to do on our side.
Comment 10 David Audel CLA 2002-02-11 07:16:02 EST
Now in ICodeAssist.codeSelect(int offset, int length), when length == 0 then 
the SelectionEngine select the entire token.

Fixed