Bug 558967 - Continuous Assistant feature
Summary: Continuous Assistant feature
Status: CLOSED DUPLICATE of bug 101420
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.15   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 496087 553323
  Show dependency tree
 
Reported: 2020-01-09 06:05 EST by Dawid Pakula CLA
Modified: 2020-12-14 05:31 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dawid Pakula CLA 2020-01-09 06:05:16 EST
There was couple mentions in other bugs about this feature but I cannot find task for this.

In short, would be nice to have Continuous Assistant during code writing and I think that some things should work a little bit different for "auto" mode.

1. IContentAssistProcessor have to know if assist was auto-activated or user explicitly run ctr/cmd+space
2. IContentAssistProcessor.getCompletionProposalAutoActivationCharacters its too simple, for auto-assist more intelligence is required:
- When start auto-activation
- When stop auto-activation (for example after enter or ";" pop should be closed)
- When restart - in most case should be same as when start auto-activation, but would be good to have more control
3. IContentAssistProcessor should be able to listen on key sequences and decide based on this when start/stop/restart. For example in php assist should start after "->"
4. In auto activation mode only AutoInsert completion should be selected by default in popup to allow enter during writing. Especially "no completion" position shouldn't be selected
Comment 1 Dawid Pakula CLA 2020-01-30 17:17:32 EST
Anyone is interested? 

As I see in code, in principle is possible to implement 2 and 3 but with lots of ContentAssist and ContentAssist.AutoAssistListener but with lots of strange overrides ;)

Same for point 1, but in this case IContentAssistProcessor will also need access to IContentAssistProcessor, or IContentAssistant will have to store this information in ITextViewer.

Hardest part is point 4. Only way is build own IContentAssistant from scratch.
Comment 2 Mickael Istria CLA 2020-01-30 17:29:06 EST
For item 2 & 3, I don't think deciding whether to continuously auto-copmlete is the responsibility of the IContentAssistProcessor, but more the one of the ContentAssistant. ContentAssistant should be offered some `addAutoActivationStrategy(BooleanFunction<Event>)` or something like that to trigger completion on any interaction with the editor.

For item 4, we could first make the "no completion" a non-item (and more a label), it would be relatively affordable, just tweaking the popup to have a "default" label to show in place of the list when list is empty.
However, you mention Enter, but what about Arrow up/down/left/right that we tend to use often while debugging? How could those not interfere with the completion popup, and if they do interfere, how to get back to the completion pop-up without hitting as many keystrokes as it's currently consuming to make it visible?
Comment 3 Dawid Pakula CLA 2020-01-30 18:02:52 EST
(In reply to Mickael Istria from comment #2)
> For item 2 & 3, I don't think deciding whether to continuously auto-copmlete
> is the responsibility of the IContentAssistProcessor, but more the one of
> the ContentAssistant. ContentAssistant should be offered some
> `addAutoActivationStrategy(BooleanFunction<Event>)` or something like that
> to trigger completion on any interaction with the editor.
I thinking about IContentAssistProcessor because it already have AutoActivationChars and also is created for each partition content type. IContentAssistant with BoleanFunction<KeyEvent> should be also ok, but again would be nice if could stick to partition type by design.

> For item 4, we could first make the "no completion" a non-item (and more a
> label), it would be relatively affordable, just tweaking the popup to have a
> "default" label to show in place of the list when list is empty.
It's good start. Both "no completion" and async-progress info shouldn't be completion row.

> However, you mention Enter, but what about Arrow up/down/left/right that we
> tend to use often while debugging? How could those not interfere with the
> completion popup, and if they do interfere, how to get back to the
> completion pop-up without hitting as many keystrokes as it's currently
> consuming to make it visible?
Off course could be configurable, or could be delegated to viewer action (similar to invoke assist) or controlled by same BoleanFunction<KeyEvent>:
1. Arrow left/right - close auto-assist popup 
1. Arrow down - move focus to completion popup and select first completion, as mentioned before, if completion proposal is marked as AutoInsert and is first should be selected by default
2. Arrow up - for me should also close auto-assist popup

Maybe someone have better idea ;)
Comment 4 Dawid Pakula CLA 2020-04-21 12:05:27 EDT
I would like to push this forward during upcoming weeks and prepare PoC code.

Someone have additional thoughts before I start?
Comment 5 Mickael Istria CLA 2020-12-14 05:31:57 EST
Unless I messed something, this is actually a duplicate of 101420

*** This bug has been marked as a duplicate of bug 101420 ***