satiromarra / vscode-sftp

Super fast sftp/ftp extension for VS Code
Other
23 stars 3 forks source link

Open Remote File with VSCode by URL #74

Closed cfunke2 closed 11 months ago

cfunke2 commented 12 months ago

First of all thank you for this wonderful plugin.

In my company we would like to set html links in our intranet to let the developer open his VSCODE and directly work on that file. I got so far:

VSCode then opens and asks if Satimorarra Extension is allowed to open a file, but then nothing happens. Is there a way or can this be built that when xxx is valid file on one of or one specific configures SFTP connections that it is directly opened? Thanks in advance.

satiromarra commented 12 months ago

Thanks @cfunke2!

I think I didn't quite understand what you wanted to explain.

cfunke2 commented 12 months ago

Thanks @cfunke2!

I think I didn't quite understand what you wanted to explain.

Sorry <a href="vscode://satiromarra.code-sftp/1//mnt/ashop/applicationdev/ts.php:2:2">Open File with VSCode</a> I would liike to set a link and when the developer clicks the file is opened with VSCode

cfunke2 commented 12 months ago

Here is how it works at other plugins: https://github.com/microsoft/vscode-remote-release/issues/4779#issuecomment-1220475865

Is this also possible with this plugin or maybe a good suggestion for further development? vscode://vscode-remote/ssh-remote+[USER@]HOST[:PORT]/path/to/file:ROW:COL

satiromarra commented 12 months ago

@cfunke2 I have done some test and I can't get to the point where the extension can open the url that is passed in format: vscode://satiromarra.code-sftp/1//mnt/ashop/applicationdev/ts.php:2:2.

I haven't found any documentation about it either, should it be something new?

cfunke2 commented 12 months ago

Try this: <a href="vscode://satiromarra.code-sftp/ssh-remote+cfunke@test.de:22">Datei auf SFTP öffnen</a>

Then VSCode opens and asks (see screenshot attached) if the extension is allowed to open the file.

If I misspell the extension name for testing it does not ask (!) so I think the extension is correctly recognised.

2023-07-11 07_18_28-leerkauf php - 222 - Visual Studio Code

satiromarra commented 12 months ago

@cfunke2 I understand what you want to tell me, but I can't find vscode documentation on how to get the route you want to open.

It is rare that vscode allows you to do vscode://extension-name/path-to-file:col:row but that there is nothing about it.

cfunke2 commented 11 months ago

Yes I didn't find anything else too. Looks like that this is not official supported or MS want this only for their own extensions. If I find out more I will contact you again, I have an own extension maybe I make some tests how to read in this parameters.

C1977 commented 11 months ago

Here is how: https://www.eliostruyf.com/callback-extension-vscode/