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

Add support for Terminal Links pointing to directories #345

Open SchoofsKelvin opened 2 years ago

SchoofsKelvin commented 2 years ago

Discovered while double-checking Terminal Links for #342

Currently, we add terminal links for absolute paths (and incorrect relative paths, see #344), but this errors when opening a path to a directory, as right now it attempts to open the file in an editor: https://github.com/SchoofsKelvin/vscode-sshfs/blob/20cf037ffadb854036eff2e0f22799cc4cb76883/src/manager.ts#L209-L212

We should first check if the given paths refers to an existing directory, and if so, ask the user how to handle it, i.e. "Ignore", "Add as Workspace Folder" or "Open in new window" (if the latter is supported by the VS Code Extension API). Otherwise we can fallback to the current behavior.