Bug 507772 - [Generic editor] to provide a way to opt-out irrelevant presentation reconcilers
Summary: [Generic editor] to provide a way to opt-out irrelevant presentation reconcilers
Status: CLOSED WONTFIX
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.8 M2   Edit
Assignee: Mickael Istria CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 507753
  Show dependency tree
 
Reported: 2016-11-18 10:53 EST by Mickael Istria CLA
Modified: 2017-08-12 03:50 EDT (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-11-18 10:53:17 EST
It is possible for some dynamic presentationReconcilier that they actually have nothing to contribute to the file. That's for example the case of the TextMate based one mentions in bug 507753 , which is meant to be associated on all types and to do something or not according to whether a textmate grammar is found.
The generic editor should handle the case of multiple presentation reconciliers associated to a file-type (using the most specialized with higher priority), and in case the current top-priority reconcilier does nothing, defer to the next one.
Comment 1 Mickael Istria CLA 2017-04-09 05:27:54 EDT
I believe bug 514979 would allow to cover the user-story in a more elegant and consistent manner.
Comment 2 Eclipse Genie CLA 2017-08-07 11:15:09 EDT
New Gerrit change created: https://git.eclipse.org/r/102624
Comment 3 Mickael Istria CLA 2017-08-07 11:23:43 EDT
(In reply to Eclipse Genie from comment #2)
> New Gerrit change created: https://git.eclipse.org/r/102624

The strategy implemented here is that a PresentationReconciler can "opt-out" from binding to Generic Editor by throwing an IllegalArgumentError during `install`. For example, a reconciler that needs to check things dynamically against current editor instance or document to evaluate whether they're useful or not can send the IllegalArgumentError so the Generic Editor will ignore it and try another registered one.
Comment 4 Mickael Istria CLA 2017-08-08 08:28:55 EDT
As part of this change, we should sort presentationReconcilers by "specialization" ie we sort the provided reconciler extensions by most specialized content-type first.
Comment 5 Mickael Istria CLA 2017-08-08 11:49:45 EDT
The proposed patch seems to introduce an issue.
It seems like bug 520685 can cover the same user-story better. So let's focus on bug 520685 and then re-evaluate whether we need it.
Comment 6 Mickael Istria CLA 2017-08-12 03:50:19 EDT
Let's abandon this one bug 520685 and related patch covers the initial user story with a cleaner solution.