Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#6016 do not register highlight service if no patterns provided #6146

Merged
merged 1 commit into from
Sep 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ public void apply(Void arg) throws OperationException {
"orion.core.contenttype",
JavaScriptObject.createObject(),
contentType.toServiceObject());
serviceRegistry.doRegisterService(
"orion.edit.highlighter", JavaScriptObject.createObject(), config);
if (config.getPatterns() != null || config.getPatterns().length() != 0) {
serviceRegistry.doRegisterService(
"orion.edit.highlighter", JavaScriptObject.createObject(), config);
}
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
package org.eclipse.che.ide.editor.orion.client.jso;

import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArray;
import com.google.gwt.core.client.JsArrayString;

/**
Expand Down Expand Up @@ -53,5 +54,9 @@ protected final native void setContentTypes(JsArrayString theContentTypes) /*-{
*/
public final native void setPatterns(String patternsAsJsonArray) /*-{
this.patterns = eval(patternsAsJsonArray);
}-*/;
}-*/;

public final native JsArray<JavaScriptObject> getPatterns() /*-{
return this.patterns;
}-*/;
}