giovdk21 / vscode-sublime-merge

Sublime Merge integration for Visual Studio Code
MIT License
15 stars 1 forks source link

Extension doesn't work with "development containers" #9

Open bblanchon opened 4 years ago

bblanchon commented 4 years ago

Hi,

Thanks for this excellent extension. I use it daily for local development, but unfortunately, it doesn't work with development containers.

VSCode allows users to install an extension inside the container. When I do that with this extension, it adds the button on the status bar, but clicking on it has no effect. I guess that the extension tries to open Sublime Merge in the container instead of the host.

Rather than installing the extension in the container, I think the right approach is to tell VSCode that this extension must run exclusively on the host. According to the documentation, you need to add the following to package.json:

{
  "extensionKind": ["ui"]
}

I tried, and it did enable the extension in the container, but the button in the status bar is still missing, and when I try to run open Sublime Merge via the Command Palette, it get the following error:

Command 'Open repository in Sublime Merge' resulted in an error (command 'vscsm.openInSublimeMerge' not found)

That's all I've been able to do with my limited knowledge of VSCode; I hope you'll be able to take it from here.

Best regards, Benoit

giovdk21 commented 4 years ago

Hi Benoit, Thanks for reporting this!

As part of https://github.com/giovdk21/vscode-sublime-merge/pull/11 I should have fixed the issue you mentioned when you try to run the extension commands using the command palette.

I also forced the extension to only run locally as you suggested, but I didn't manage to try it with development containers yet.

Please let me know if the new version (once released) improve things (or not 😅 )

bblanchon commented 4 years ago

Hi Giovanni,

With version 1.1.0, I get the following message when opening in the container:

Cannot activate the 'Sublime Merge for VSCode' extension because it depends on the 'Git' extension, which is not loaded. Would you like to reload the window to load the extension?

I'm not sure which Git extension it refers to, but I can confirm that the Source Control tab is working correctly.

Best regards, Benoit

giovdk21 commented 4 years ago

hello, I believe it refers to this extension: https://github.com/microsoft/vscode/blob/master/extensions/git/package.json which is built-in; could you double check if it's enabled?

You can find it by opening the "Sublime Merge for VSCode" from the extensions tab within VS Code, and then it's under dependencies. Clicking on its name should let you see whether it's enabled or not:

image

bblanchon commented 4 years ago

Hi,

Yes, it seems that it's enabled.

image

Best regards, Benoit

giovdk21 commented 4 years ago

Hi Benoit, thanks. I tried running it with dev. containers but could not find a solution.

The cause of the error you mentioned is the fact that the Git extension is running within the container (remote extension host) while Sublime Merge for VSCode is running out side the container (local extension host)

My understanding is that remote (docker) containers share the same design of the other two "remote" extensions for SSH and WSL, therefore assuming the source code is in a different/remote location. Because of this it's not possible for an extension that runs inside a container to run a local child process (in this case Sublime Merge) and at the same time Sublime Merge itself won't have access to the files in the remote location:

https://code.visualstudio.com/api/advanced-topics/remote-extensions#opening-something-in-a-local-browser-or-application

The remote development extension is still in "preview" mode so I'll keep this open for now and see if I'll manage to look further into this

rgokul commented 3 years ago

Almost once a month I check the status of this issue, vs code remote development new features to see if it is fixable. As an alternative, could you enable a feature where we can configure this extension with a local mirror that can be used with smerge? I use this extension so much that I've had to manually ssh -X on the remote machine for gui dev and it is slow.

If I click the icon for the extension, it should take the relative path from workspace root on remote and apply it to local mirror location.

I will manually rsync changes back and forth.

Thanks in advance.

z-aki commented 10 months ago

Would be highly appreciated if remote container's context menu buttons with local smerge.