Add CheEditor object to the Workspace Next model#10457
Add CheEditor object to the Workspace Next model#10457garagatyi merged 2 commits intoeclipse-che:masterfrom
Conversation
|
|
||
| `-t garagatyi/che-marketplace:1` is needed to set identifier of the image. Do not forget to change `feature-api/yaml` file accordingly if you change this identifier to something else. | ||
| `-t garagatyi/che-marketplace:os` is needed to set identifier of the image. | ||
| Do not forget to change `feature-api/yaml` file accordingly if you change this identifier to something else. |
There was a problem hiding this comment.
Should feature-api/yaml be feature-api.yaml?
There was a problem hiding this comment.
feature-api/yaml - what is it?
There was a problem hiding this comment.
feature-api/yaml is this a file? Are we going to use it?
| return name; | ||
| } | ||
|
|
||
| public void name(String name) { |
There was a problem hiding this comment.
As far as I understand methods which are named as a field are like with methods, like e89a9fb#diff-67aebb3b9dc0621b7a6f25e408c74a1dR30. Should not it return EditorCompatibility?
| + ", endpoints=" | ||
| + endpoints | ||
| + '}'; | ||
| return "ChePlugin{" + "editors=" + editors + "} " + super.toString(); |
There was a problem hiding this comment.
Are you sure that it's a good idea to have such output
ChePlugin{editors=[....]} PluginBase{name=qwe...}
There was a problem hiding this comment.
I'm not sure. Do you think that it is bad?
There was a problem hiding this comment.
It may be confused in such cases:
LOG.debug("Debug info {} {}", chePlugin, otherPluginBase);
as output:
"Debug info ChePlugin{editors=[....]} PluginBase{name=qwe...} PluginBase{name=qwe...}"
Looks like three objects are printed =)
I think that it would be better to group fields of one objects, typically for Che code base with {}
| return false; | ||
| } | ||
| CheEditor cheEditor = (CheEditor) o; | ||
| return Objects.equals(getName(), cheEditor.getName()) |
There was a problem hiding this comment.
I think it would be better to write equals and hashcode methods in the same manner e89a9fb#diff-b3ca1f169efa0ad30c481db6568521a7R41
There was a problem hiding this comment.
Can you elaborate why it would be better?
There was a problem hiding this comment.
Let me clarify that I wanted to say that it is better to write these methods in the same way, but both ways are OK for me (with reusing super methods, or with a duplicated piece of code).
I see two points here:
- Nobody will ask why two very similar classes have a different style of
equalsandhashcodemethod. - One style is a less error-prone way because you get used to writing in this way, and you'll find an error easier.
like here https://github.com/eclipse/che/pull/10457/files#diff-a8707ef642f5ec96204cccfd4e370ce3R40 is not an error but overhead when ChePluginBase fields are used twice in hash code, the first time in super.hashCode, and the second time in CheEditor.
There was a problem hiding this comment.
I see. But you may also consider using super as a less error-prone approach since it reflects all the changes in a superclass automatically and that adding a field to a superclass and forgetting modifying a subclass doesn't introduce a bug.
I fixed the hashcode method, thanks for noticing it.
| * | ||
| * <p>It may be classic GWT IDE, Eclipse Theia or something else. | ||
| */ | ||
| public class CheEditor extends PluginBase { |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
| public class ChePlugin { | ||
| /** Represents Che plugin in sidecar-powered workspace. */ | ||
| public class ChePlugin extends PluginBase { | ||
| private List<EditorCompatibility> editors = new ArrayList<>(); |
There was a problem hiding this comment.
I'm not sure that I fully understand all last changes in WsNext Skeleton, and it's just a note to consider: in editors field I would expect to see a list of CheEditors objects, or list of CheEditors identifiers.
There was a problem hiding this comment.
editor field contains a list of editors supported by a plugin with identifiers in a field name and other plugins that needed for correct integration of the editor and the plugin in a field plugins. All of that is incorporated in EditorCompatibility object in this PR.
Does this clarify the idea to you?
There was a problem hiding this comment.
Yeah, thanks for the explanation.
Does it mean that different CheEditors can be used at the same time? It's OK just to clarify.
As far as I understand ChePlugin depends on EditorCompatibilitys, EditorCompatibility depends on ChePlugins. Are circular dependencies are handled correctly?
There was a problem hiding this comment.
ChePlugin shows that different plugins might be used with it, but Che should ensure that just one is in use.
Circular dependencies are not handled because compatibility is not implemented and I'm not sure we need this verification on this step where parts are still moving rapidly and things that are here now might be gone tomorrow.
|
|
||
| `-t garagatyi/che-marketplace:1` is needed to set identifier of the image. Do not forget to change `feature-api/yaml` file accordingly if you change this identifier to something else. | ||
| `-t garagatyi/che-marketplace:os` is needed to set identifier of the image. | ||
| Do not forget to change `feature-api.yaml` file accordingly if you change this identifier to something else. |
There was a problem hiding this comment.
Now we have editor and plugins. Maybe we should rename feature-api.yaml to something different. Because we don't have features anymore.
There was a problem hiding this comment.
I don't want to change it because there is fresh blog post from Mario that uses instructions where this name is used.
There was a problem hiding this comment.
oook. however, it looks weird. For how long are you going to keep it in this way?
There was a problem hiding this comment.
I don't know. Is it important to you?
544ab71 to
3db106b
Compare
sleshchenko
left a comment
There was a problem hiding this comment.
Please take a look one more time that equals and hashCode methods are written properly and they use the same fields for computing a result
|
ci-build |
Signed-off-by: Oleksandr Garagatyi <ogaragat@redhat.com>
Signed-off-by: Oleksandr Garagatyi <ogaragat@redhat.com>
|
@riuvshin do you happen to know why CI didn't respond to my comment that supposed to start a build on CI? |
7236ab1 to
3ebcbe0
Compare
What does this PR do?
Introduces changes in Workspace.Next model objects.
Field 'commands' in CheContainer renamed to
editor-commands.Add CheEditor object that has all the fields ChePlugin previously had.
ChePlugin gets field
editorsthat contains a list of objects called in PR EditorCompatibility.EditorCompatibility contains fields
nameandWhat issues does this PR fix or reference?
Fixes #10203
Release Notes
Docs PR