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

Pass objects with commands.executeCommand when remote #111238

Closed
chrmarti opened this issue Nov 24, 2020 · 16 comments
Closed

Pass objects with commands.executeCommand when remote #111238

chrmarti opened this issue Nov 24, 2020 · 16 comments
Assignees
Labels
feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code tree-views Extension tree view issues

Comments

@chrmarti
Copy link
Contributor

I have the Docker extension installed remotely in Remote-SSH and am invoking a command in the local Remote-Containers extension with the context menu in a view of the Docker extension with a single object as the selection. Currently the selected object is not passed along. Is there anything we can do here? Maybe allow sufficiently simple objects?

@jrieken
Copy link
Member

jrieken commented Nov 24, 2020

Currently the selected object is not passed along.

I assume that a custom tree, right? That should always pass the corresponding element around

@chrmarti
Copy link
Contributor Author

Placing a breakpoint in CommandService.executeCommand shows a handle:
image

@jrieken
Copy link
Member

jrieken commented Nov 25, 2020

So, just to make sure I am seeing the whole picture: The tree data provider is in one extension host and the command (implementation) in another. Is that right?

@chrmarti
Copy link
Contributor Author

Correct, the Docker extension runs on the remote extension host and provides the tree data. The command is from the Remote-Containers extension running on the local extension host.

@jrieken
Copy link
Member

jrieken commented Nov 25, 2020

Very trick, maybe not possible, because the objects never leave the extension host. Only identifiers/placeholders are send to the renderer and then looked up for command dispatch.

@chrmarti
Copy link
Contributor Author

Maybe if the objects have a toJSON() (or some other name to disambiguate) method?

@jrieken
Copy link
Member

jrieken commented Nov 25, 2020

What would we do if these objects are huge? The motivation from them staying in the extension host is

  • performance, like don't send data that isn't needed in the UI
  • data must be serializable
  • data isn't needed

I see how the last two aren't always valid (can be worked around) but I am not a big fan of us holding arbitrary amount of data in the UX.

@chrmarti
Copy link
Contributor Author

We could set an upper-bound to the stringified size. If we require the extension to support it with toJSON() or similar the extension can tune it to be minimal. And we would only do this for commands that are on a different extension host.

@alexr00
Copy link
Member

alexr00 commented Nov 25, 2020

Let's see how often anyone actually wants this. Right now we have exactly one real use case and there are several downsides.

@mrmachine
Copy link

I am trying to use remote-containers and remote-ssh together, to do work inside a container running on a remote host. When I first open VS Code on the remote host via SSH, then view the container list in the Docker extension, then right click and Attach Visual Studio Code (to a specific container), VS Code brings up a list of ALL containers on the remote host which I must then further type to narrow and scroll to select from, even though I have already selected the container to which I want to attach (by right click).

@chrmarti
Copy link
Contributor Author

This currently limits functionality when connected with Remote-WSL/-SSH. Affected commands:

  • Attach to container from Docker viewlet.
  • Inspect volume from Docker viewlet.
  • Attach to container from Kubernetes viewlet.

Reopening for consideration.

@chrmarti chrmarti reopened this Dec 23, 2021
@microsoft microsoft unlocked this conversation Dec 23, 2021
@chrmarti chrmarti removed this from the Backlog Candidates milestone Dec 24, 2021
@chrmarti chrmarti reopened this Dec 24, 2021
@stardiviner
Copy link

upvote this issue.

@CoopTang
Copy link

Any idea on a fix for this? This disrupts my workflow and requires me to use my Mac when I need to debug a pod, and it would be nice to not have to constantly switch back and forth when developing.

@chrmarti
Copy link
Contributor Author

There was some concern about serializing large objects. Maybe the receiving extension could declare (statically or dynamically) which properties on the selected objects it needs?

@jmarandet

This comment was marked as spam.

@VSCodeTriageBot
Copy link
Collaborator

We closed this issue because we don't plan to address it in the foreseeable future. If you disagree and feel that this issue is crucial: we are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding, and happy coding!

@VSCodeTriageBot VSCodeTriageBot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code tree-views Extension tree view issues
Projects
None yet
Development

No branches or pull requests

10 participants