Bug 500755 - [Generic Editor] Ability to register a completion proposal computer on any partition content
Summary: [Generic Editor] Ability to register a completion proposal computer on any pa...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.6   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 4.7 M4   Edit
Assignee: Mickael Istria CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 497871
  Show dependency tree
 
Reported: 2016-09-02 10:47 EDT by Mickael Istria CLA
Modified: 2016-11-08 10:26 EST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mickael Istria CLA 2016-09-02 10:47:15 EDT
While working on bug 497871 (generic and extensible editor), I noticed that if a document as a custom partitioning, then it's not possible to register some completion proposals for the whole document.
For example, on WTP SSE editors (such as CSS) it's impossible to trigger the generic completion in comments, because comments map to a non-default partition content-type. 
As the generic editor tries to "blackbox" the partitioning (or at least make it kind of optional to rely one), it would be very useful to have the ability to register a completion computer without passing a partition content-type, and to assume it's applying to the whole document.
Comment 1 Mickael Istria CLA 2016-09-02 10:50:06 EDT
The proposal is to change the ContentAssistant.(s/g)etContentAssistProcessor methods to allow a "null" or a magic value "any" content-type.
Comment 2 Mickael Istria CLA 2016-09-06 08:26:38 EDT
Another instance of this limitation is that for example if you want to use the generic editor for C#, with the Language Server extension (for most operations exception highlighting) and the Liclipse one (for highlighting):
Liclipse requires the document to use Liclipse partitioning and set it directly on the document, but then all tokens in the document have a non-default content type, so completion from language server gets never invoked (as it's bound to default).
Comment 3 Mickael Istria CLA 2016-09-06 09:04:07 EDT
The same issues happens for hover. By default, hover is only associated to a given token content-type. A default one would be welcome.
Comment 4 Mickael Istria CLA 2016-09-06 09:12:06 EDT
@Dani: As I'm working on this issue, I see 2 possible approaches here:
1. Add this capability of a "default" completion proposal computer to JFace's ContentAssist class -in a backward compatible way-, so it can be used by other editors
2. Just tweak the ContentAssist used by the generic editor to add this support for a default computer.
(and I guess it's similar for hover)

Which one do you think is better?
Comment 5 Mickael Istria CLA 2016-09-06 09:25:42 EDT
(In reply to Mickael Istria from comment #4)
> 1. Add this capability of a "default" completion proposal computer to
> JFace's ContentAssist class -in a backward compatible way-, so it can be
> used by other editors

That's https://git.eclipse.org/r/#/c/80472/
Comment 6 Mickael Istria CLA 2016-09-06 09:49:44 EDT
(In reply to Mickael Istria from comment #4)
> 2. Just tweak the ContentAssist used by the generic editor to add this
> support for a default computer.
> (and I guess it's similar for hover)

and that's https://git.eclipse.org/r/#/c/80479
Comment 7 Eclipse Genie CLA 2016-09-06 16:50:01 EDT
New Gerrit change created: https://git.eclipse.org/r/80472
Comment 8 Eclipse Genie CLA 2016-09-06 16:50:17 EDT
New Gerrit change created: https://git.eclipse.org/r/80479
Comment 9 Mickael Istria CLA 2016-10-21 12:23:39 EDT
Tentative to 4.7.M4.
@Sopot and others: I took this one to make sure I think about it, but feel free to take any bug about Generic Editor.
Comment 10 Eclipse Genie CLA 2016-11-08 07:19:16 EST
New Gerrit change created: https://git.eclipse.org/r/84654
Comment 11 Eclipse Genie CLA 2016-11-08 07:19:16 EST
New Gerrit change created: https://git.eclipse.org/r/84654
Comment 12 Mickael Istria CLA 2016-11-08 07:41:55 EST
Let's first restrain the scope of the request to the Generic Editor which is the only editor involved in the user story that droves to this report (mixing Language Server client and LicLipse syntax highlighting in the same editor).

(In reply to Mickael Istria from comment #3)
> The same issues happens for hover. By default, hover is only associated to a
> given token content-type. A default one would be welcome.

In the case of the Generic Editor (which is the target of this bug) the TextHover is actually document content-type agnostic, so this is not an issue here.

Only completion needs to be dynamically registered on all documeent content-types, and this is covered by https://git.eclipse.org/r/84654 .