SchoofsKelvin / vscode-sshfs

Extension for Visual Studio Code: File system provider using SSH
GNU General Public License v3.0
543 stars 36 forks source link

Common workspace files specification instead of folders? #320

Closed kzndotsh closed 2 years ago

kzndotsh commented 2 years ago

Hello there, great tool you've got there.

I see we have the ability to specify common directories that we are working in via the workspace settings json config but I was curious if there was a way we could specify individual files themselves? Use case would be creating a quick list of various configuration files spread across my server e.g. /opt/app/config.json, /srv/foo/bar.json, and so on. Having this ability would be great to increase the users speed in editing files on the fly but also reduce loading times as you won't need to fetch an entire directory.

SchoofsKelvin commented 2 years ago

I think VS Code's Recent Files menu might already display recently opened files on remote filesystems.

While I could add a Favorite view to the extension (or create a separate extension), I'd say take a look if there's a favorites extension that supports any URI. I tested some (1,2,3) but none supported URIs it seems. If you find an extension that supports any URI and not just file paths (or file:-only URIs), you can favorite ssh:// URIs pointing to files. My extension doesn't care how a file is opened. When VS Code tells the extension "I want to open ssh://some-config/some/file", my extension will try to get an existing connection (or try to create a new one) for some-config and load the given file. Regardless of whether you have a ssh:// URI as remote folder (i.e. as a directory in Explorer).

Theoretically, if VS Code had a way to directly open URIs (neither the UI nor the code command line supports it), you could directly open ssh://some-config/some/file and it shouldn't load a single other file/directory. Maybe the TypeScript extension might look for tsconfig.json if you open a TypeScript file, for example.

If you really can't find one, say something and I might make one, seems quite handy for myself too. Obviously would take a while though.