eclipse-che / che

Kubernetes based Cloud Development Environments for Enterprise Teams
http://eclipse.org/che
Eclipse Public License 2.0
6.99k stars 1.19k forks source link

Highlight issue with custom editor and multiple extension file #2488

Closed lgas closed 7 years ago

lgas commented 8 years ago

Hello,

I develop a custom editor for two file types. Everything work well, my action create good file extension with custom codeAssist. In FppJSEditorExtension.java I add code for register my new MIME type and linked it with my new contentType.

`@Inject protected void configureContentType(final OrionContentTypeRegistrant contentTypeRegistrant) { // register content type and configure orion final String contentTypeId = "application/fpp";

    OrionContentTypeOverlay contentType = OrionContentTypeOverlay.create();
    contentType.setId(contentTypeId);
    contentType.setName("FPP Language");
    contentType.setExtension(SCRIPT_EXT, MODULE_EXT);
    contentType.setExtends("text/plain");

    // highlighting
    OrionHighlightingConfigurationOverlay config = OrionHighlightingConfigurationOverlay.create();
    config.setId("orion.fpp");
    config.setContentTypes(contentTypeId);
    config.setPatterns(
            "[\n" +
                    "  {include: \"orion.java\"},\n" +
                    "  {\n" +
                    "    match: \"\\\\b(?:it|delegate|owner|as|in|def|threadsafe|assert|use|with)\\\\b\",\n" +
                    "    name: \"keyword.fpp\"\n" +
                    "  }\n" +
                    "]");

    contentTypeRegistrant.registerFileType(contentType, config);
}`

But nothing happen, highlighting doesn't work. Source code and assembly can be find here. Any help would be appreciate.

PS : @svenefftinge, as you develop the service for register new contentType and highlighting in orion, I thought you must be the guy who can help me.

svenefftinge commented 8 years ago

Did you register this code with the right hook? I.e. is it executed at all?