Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Becker2020-01-30 14:07:21 +0000
committerMatthias Becker2020-01-30 14:07:21 +0000
commitb56d759a9d202613640c694f37e30257dde441de (patch)
treec6c3b5f856f5f5e3490451f7573ee0a167c93d84
parentb34d3e266290b9a685f957d6363fbeb6e3a9d31c (diff)
downloadeclipse.platform.text-b56d759a9d202613640c694f37e30257dde441de.tar.gz
eclipse.platform.text-b56d759a9d202613640c694f37e30257dde441de.tar.xz
eclipse.platform.text-b56d759a9d202613640c694f37e30257dde441de.zip
Bug 559712: CodeMiningProvider should not enforce enabledWhenI20200130-1800
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/codemining/CodeMiningProviderDescriptor.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/codemining/CodeMiningProviderDescriptor.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/codemining/CodeMiningProviderDescriptor.java
index 92d733020..ec9b31d9d 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/codemining/CodeMiningProviderDescriptor.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/internal/texteditor/codemining/CodeMiningProviderDescriptor.java
@@ -104,10 +104,8 @@ class CodeMiningProviderDescriptor {
final ElementHandler elementHandler = ElementHandler.getDefault();
final ExpressionConverter converter = ExpressionConverter.getDefault();
return elementHandler.create(converter, subChildren[0]);
-
}
- throw new CoreException(new Status(IStatus.ERROR, TextEditorPlugin.PLUGIN_ID,
- "<enabledWhen> element is required. Disabling " + id)); //$NON-NLS-1$
+ return null;
}
/**
@@ -179,6 +177,9 @@ class CodeMiningProviderDescriptor {
* and false otherwise.
*/
public boolean matches(ISourceViewer viewer, ITextEditor editor) {
+ if (fEnabledWhen == null) {
+ return true;
+ }
EvaluationContext context = new EvaluationContext(null, editor);
context.setAllowPluginActivation(true);
context.addVariable("viewer", viewer); //$NON-NLS-1$

Back to the top