Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already do it in
this.executeLocalCommand
, so we will run it twice.I don't understand why we will run it for main side commands?
An idea behind argument processors is to avoid sending data which is already in the plugin host for local commands not to transform something for the main side. You can do it by overriding services in the main side already, like
CommandRegisry.execute
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, you're right, overriding service might be better solution in this case. I've updated code in following PR on che-theia side: https://github.com/eclipse/che-theia/pull/562/files.
The main problem I'm trying to solve is that, in our infrastructure each plugin runs in separate container. For example, there is the kubernetes plugin, which provides command to see the diff for the selected resource (opened in the editor). Right part for the diff takes directly from the opened editor. But left part - there is a resource stored to temporary file (in /tmp directory) in container, where plugin hosts. So we're having following situation. Kubernetes plugin calls
vscode.diff
command with two arguments: 1) path to the file, opened in the editor, everything is fine; 2) path to the file which doesn't exists in theia container, but stored in different container in /tmp directory. So we need to modify the file scheme for second argument. And with custom file content provider open this file in the diff viewer. Smth like that.But I've tried to override the call of
executeCommand
method and that works for the che-theia use case. So this PR can be safely closed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vzhukovskii ok, glad that you find a way to resolve the issue!