Bug 532774 - [GenericEditor] Support <enabledWhen> for all generic editor extension points
Summary: [GenericEditor] Support <enabledWhen> for all generic editor extension points
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.8   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 4.8 M7   Edit
Assignee: Angelo ZERR CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
: 514979 (view as bug list)
Depends on:
Blocks: 532804
  Show dependency tree
 
Reported: 2018-03-22 11:10 EDT by Angelo ZERR CLA
Modified: 2018-04-04 12:09 EDT (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 Angelo ZERR CLA 2018-03-22 11:10:34 EDT
IMHO I think all extension points of generic editor (contentAssistProcessors, highlightReconcilers, etc) should support an <enabledWhen> in their extension point (like codemining does for instance).

A usecase is with highlightReconcilers. The default word highlightReconcilers works well but if you install lsp4e, it doesn't work since lsp4e defines a highlightReconcilers for any content type. lsp4e should check if the content type has language server (or better if the language server supports highlight). 

In other words, lsp4e should do that:


---------------------------------------------------------
   <extension
         point="org.eclipse.ui.genericeditor.highlightReconcilers">
      <highlightReconciler
            class="org.eclipse.lsp4e.operations.highlight.HighlightReconciler"
            contentType="org.eclipse.core.runtime.text">
         <enabledWhen>
            <with
                  variable="editorInput">
               <test
                     property="org.eclipse.lsp4e.hasLanguageServer">
               </test>
            </with>
         </enabledWhen>            
      </highlightReconciler>
   </extension>
---------------------------------------------------------

After that, even after installing lsp4e, default word highlight will work with *.txt file for instance (today it doesn't work).
Comment 1 Eclipse Genie CLA 2018-03-22 11:18:31 EDT
New Gerrit change created: https://git.eclipse.org/r/119994
Comment 2 Angelo ZERR CLA 2018-03-23 03:33:24 EDT
*** Bug 514979 has been marked as a duplicate of this bug. ***
Comment 3 Mickael Istria CLA 2018-03-27 01:43:44 EDT
Keeping open as this deserve a note in the N&N
Comment 4 Eclipse Genie CLA 2018-03-27 07:39:06 EDT
New Gerrit change created: https://git.eclipse.org/r/120252
Comment 5 Angelo ZERR CLA 2018-03-27 07:39:46 EDT
> Keeping open as this deserve a note in the N&N

Please review https://git.eclipse.org/r/120252
Comment 7 Eclipse Genie CLA 2018-03-27 08:53:50 EDT
New Gerrit change created: https://git.eclipse.org/r/120262
Comment 8 Eclipse Genie CLA 2018-03-27 14:21:33 EDT
New Gerrit change created: https://git.eclipse.org/r/120293
Comment 11 Eclipse Genie CLA 2018-04-04 11:01:38 EDT
New Gerrit change created: https://git.eclipse.org/r/120716