Bug 382839 - [Compatibility] 'Line Up' and 'Line Down' no longer work in content assist pop-up
Summary: [Compatibility] 'Line Up' and 'Line Down' no longer work in content assist po...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: PC Windows 7
: P3 major with 2 votes (vote)
Target Milestone: 4.3 M7   Edit
Assignee: Paul Webster CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 387466 387650 404112 (view as bug list)
Depends on:
Blocks: 406011
  Show dependency tree
 
Reported: 2012-06-18 06:42 EDT by Dani Megert CLA
Modified: 2013-08-25 10:15 EDT (History)
9 users (show)

See Also:


Attachments
failure list against master (62.87 KB, text/plain)
2013-02-07 15:44 EST, Paul Webster CLA
no flags Details
failure with the current patch (3.98 MB, text/plain)
2013-02-07 16:08 EST, Paul Webster CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2012-06-18 06:42:43 EDT
4.2 RC4.

'Line Up' and 'Line Down' no longer work in content assist pop-up. This works fine in 3.8 RC4.

Steps:
1. start new workspace
2. assign a new key binding to 'Line Down'
3. paste this: "class A {}" into Package Explorer
4. invoke Content Assist (don't give focus to pop-up)
5. use the key binding from step 2.

==> in 3.8 this moves the selection in the pop-up as expected, but in 4.2 it moves down inside the editor.

The code which installs the handlers can be found in:
org.eclipse.jface.text.contentassist.ContentAssistant.install()
Comment 1 Dani Megert CLA 2012-06-18 06:44:00 EDT
Paul, it would be great if this could be fixed for 4.2.1.
Comment 2 Dani Megert CLA 2012-08-21 02:41:51 EDT
*** Bug 387650 has been marked as a duplicate of this bug. ***
Comment 3 Dani Megert CLA 2012-08-21 02:42:18 EDT
*** Bug 387466 has been marked as a duplicate of this bug. ***
Comment 4 Marius Kotsbak CLA 2012-10-02 05:50:21 EDT
For me, in emacs mode, it does not work with "ctrl-p" and "ctrl-n", but it does work with the arrow keys. Workaround is to hit tab first to get focus in the autocompletion list.
Comment 5 Curtis Windatt CLA 2012-11-27 17:25:26 EST
ContentAssistant adds a listener so when the completion popup opens, the handlers in the various text navigation commands get replaced.  This is done in org.eclipse.ui.texteditor.KeyBindingSupportForAssistant.assistSessionStarted(ContentAssistEvent)

I'll have to do some more debugging to be sure, but the ReplacedCommand tries to change the handler on the command.  However, in 4.2 the handler is an instance of org.eclipse.ui.internal.MakeHandlersGo which delegates to the IHandlerService.

The handler replacing in KeyBindingSupportForAssistant looks like a hack that UI shouldn't support.  Instead there should be a better way to switch the handler.  I'm not sure if this can be done in a non-4.x exclusive way.
Comment 6 Dani Megert CLA 2012-11-28 04:04:57 EST
(In reply to comment #5)
> The handler replacing in KeyBindingSupportForAssistant looks like a hack
> that UI shouldn't support. 

That's a bold statement. Please explicitly say which APIs were not used by Platform Text as specified by their Javadoc.
Comment 7 Paul Webster CLA 2012-11-28 09:37:02 EST
(In reply to comment #6)
> 
> That's a bold statement. Please explicitly say which APIs were not used by
> Platform Text as specified by their Javadoc.

The Command is API, but it's API that's used to implement the handler system in the Workbench (same way ApplicationWindow is API but it was never acceptable to extract the main MenuManager from it).  Even the 3.x system can call Command.setHandler(*) at any time depending on what it's doing, and that would interfere with your code.

In 4.x the framework sets, ignores, or resets the Command object handler even more aggressively.

But I think I can get it working again, by examining the 4.x use of setHandler(*) and optimizing it.

PW
Comment 8 Paul Webster CLA 2013-01-11 09:37:57 EST
I've done my initial work on this and pushed a work in progress up to pwebster/bug382839

Good:  All the Eclipse4 command test pass.  The ui execution listener tests pass.  It fixes the problem described in this bug.

Not so good:  The ui CommandsTestSuite goes from 2e/13f to 4e/23f.

Give that this is such a low-level changes to the commands infrastructure I think that it should be deferred to 4.3

PW
Comment 9 Paul Webster CLA 2013-02-07 15:44:30 EST
Created attachment 226731 [details]
failure list against master

Failure rate against master
org.eclipse.ui.tests.commands.CommandsTestSuite
2e/12f

To allow comparisons as this moves forward.

PW
Comment 10 Paul Webster CLA 2013-02-07 16:08:41 EST
Created attachment 226734 [details]
failure with the current patch

Some stack overflow errors.

PW
Comment 11 Dani Megert CLA 2013-03-22 04:47:17 EDT
*** Bug 404112 has been marked as a duplicate of this bug. ***
Comment 12 Tino Sino CLA 2013-03-22 05:41:54 EDT
I have actually just downloaded and tried v4.3.0, Build id: I20130204-1400 on OSX 10.8.3... still can't "line down" through Content Assist. Will a fix make it to the 4.3.0 release?
Comment 13 Paul Webster CLA 2013-04-05 13:28:13 EDT
Moved the work in progress to Gerrit https://git.eclipse.org/r/#/c/11686/

PW
Comment 14 Paul Webster CLA 2013-04-16 12:29:12 EDT
Getting much closer with patch set 4 https://git.eclipse.org/r/#/c/11686/4/

Down to 3e/15f in the command test suite.

PW
Comment 16 Paul Webster CLA 2013-04-18 13:03:12 EDT
.
Comment 17 Dani Megert CLA 2013-04-19 07:20:39 EDT
Verified in N20130418-0900.