diff --git a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/devfile/convert/component/editor/EditorComponentToWorkspaceApplier.java b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/devfile/convert/component/editor/EditorComponentToWorkspaceApplier.java index 0b7c7ef4bca..7b2c8356619 100644 --- a/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/devfile/convert/component/editor/EditorComponentToWorkspaceApplier.java +++ b/wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/devfile/convert/component/editor/EditorComponentToWorkspaceApplier.java @@ -71,12 +71,18 @@ public void apply( final String registryUrl = editorComponent.getRegistryUrl(); final String memoryLimit = editorComponent.getMemoryLimit(); + final ExtendedPluginFQN fqn = componentFQNParser.evaluateFQN(editorComponent, contentProvider); if (editorComponentAlias != null) { workspaceConfig .getAttributes() - .put(EDITOR_COMPONENT_ALIAS_WORKSPACE_ATTRIBUTE, editorComponentAlias); + .put( + EDITOR_COMPONENT_ALIAS_WORKSPACE_ATTRIBUTE, + componentFQNParser.getCompositeId( + fqn.getRegistry() != null ? fqn.getRegistry().toString() : null, fqn.getId()) + + "=" + + editorComponentAlias); } - final ExtendedPluginFQN fqn = componentFQNParser.evaluateFQN(editorComponent, contentProvider); + if (!isNullOrEmpty(fqn.getReference())) { workspaceConfig.getAttributes().put(WORKSPACE_TOOLING_EDITOR_ATTRIBUTE, fqn.getReference()); } else { diff --git a/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/devfile/convert/component/editor/EditorComponentToWorkspaceApplierTest.java b/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/devfile/convert/component/editor/EditorComponentToWorkspaceApplierTest.java index 5d2b49116ba..fb7095a79f1 100644 --- a/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/devfile/convert/component/editor/EditorComponentToWorkspaceApplierTest.java +++ b/wsmaster/che-core-api-workspace/src/test/java/org/eclipse/che/api/workspace/server/devfile/convert/component/editor/EditorComponentToWorkspaceApplierTest.java @@ -67,7 +67,8 @@ public void shouldProvisionWorkspaceEditorAttributeDuringCheEditorComponentApply // then assertEquals(workspaceConfig.getAttributes().get(WORKSPACE_TOOLING_EDITOR_ATTRIBUTE), editorId); assertEquals( - workspaceConfig.getAttributes().get(EDITOR_COMPONENT_ALIAS_WORKSPACE_ATTRIBUTE), "editor"); + workspaceConfig.getAttributes().get(EDITOR_COMPONENT_ALIAS_WORKSPACE_ATTRIBUTE), + editorId + "=" + editorComponent.getAlias()); assertEquals( workspaceConfig .getAttributes() @@ -98,7 +99,12 @@ public void shouldProvisionWorkspaceEditorAttributeDuringCheEditorComponentApply workspaceConfig.getAttributes().get(WORKSPACE_TOOLING_EDITOR_ATTRIBUTE), registryUrl + "#" + editorId); assertEquals( - workspaceConfig.getAttributes().get(EDITOR_COMPONENT_ALIAS_WORKSPACE_ATTRIBUTE), "editor1"); + workspaceConfig.getAttributes().get(EDITOR_COMPONENT_ALIAS_WORKSPACE_ATTRIBUTE), + registryUrl.substring(0, registryUrl.length() - 1) + + "#" + + editorId + + "=" + + editorComponent.getAlias()); assertEquals( workspaceConfig .getAttributes() @@ -132,7 +138,8 @@ public void shouldProvisionWorkspaceEditorAttributeWithReferenceDuringCheEditorC assertEquals( workspaceConfig.getAttributes().get(WORKSPACE_TOOLING_EDITOR_ATTRIBUTE), reference); assertEquals( - workspaceConfig.getAttributes().get(EDITOR_COMPONENT_ALIAS_WORKSPACE_ATTRIBUTE), "editor1"); + workspaceConfig.getAttributes().get(EDITOR_COMPONENT_ALIAS_WORKSPACE_ATTRIBUTE), + "eclipse/super-editor/0.0.1" + "=" + editorComponent.getAlias()); assertEquals( workspaceConfig .getAttributes()