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

Remote support #72

Open
martinszeltins opened this issue May 6, 2024 · 1 comment
Open

Remote support #72

martinszeltins opened this issue May 6, 2024 · 1 comment

Comments

@martinszeltins
Copy link

martinszeltins commented May 6, 2024

When working from home, I connect to my office computer using vscode Remote Development feature. Currently the launch-editor uses -r -g arguments to open vscode but when working with remote development we need a different set of arguments. Otherwise it tries to find and open the file on the local machine (which does not exist)

https://github.com/yyx990803/launch-editor/blob/master/packages/launch-editor/get-args.js#L43

    case 'code':
    case 'Code':
    case 'code-insiders':
    case 'Code - Insiders':
    case 'codium':
    case 'vscodium':
    case 'VSCodium':
      return ['-r', '-g', `${fileName}:${lineNumber}:${columnNumber}`]

When working with remote development the arguments need to be these:

$ code -r --remote ssh-remote+192.168.0.17 -g /home/martin/nuxt/components/HelloWorld.vue:3

The 192.168.0.17 is the name of the host found in ~/.ssh/config. I guess this part would need to be configurable or passed as query arg like /__open-in-editor?file=src/main.js&remote=NAME_OF_REMOTE

The --remote option wasn't well documented, it does not show up when you type code --help but I found it on this issue and it does indeed work - microsoft/vscode-remote-release#5083

@HobaiRiku
Copy link

I am a fan of using this feature, and I also work in vscode remote, after learning from @martinszeltins 's comment and some related issue among the projects, I wrote a simple solution call-me-back to make this work, it is kind of workaround and dirty, but I use this for my daily development now.

The main is to set up a tunnel to remote and change the editor to a script in which the remote can execute command in the right local machine

My opinion:

  1. launch-editor will not work in either vscode remote integrated terminal or directly run in remote host, because the code should be not found in the subprocess or the code is not the local one which launch-editor assumes.
  2. other thinking (including wsl) is in my solution repo's readme.

I hope this can help someone who is interested in this feature.

Related:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants