Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 92d733020e4..ec9b31d9d77 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