Skip to content

Remote support #72

@martinszeltins

Description

@martinszeltins

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions