diff --git a/src/extension.ts b/src/extension.ts index 66754b50..dee950d5 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -19,15 +19,21 @@ export async function activate(ctx: vscode.ExtensionContext): Promise { // // This is janky, but that's alright since it provides such minimal // functionality to the extension. - const remoteSSHExtension = vscode.extensions.getExtension("ms-vscode-remote.remote-ssh") - if (!remoteSSHExtension) { + const openRemoteSSHExtension = vscode.extensions.getExtension("anysphere.open-remote-ssh") + // If the "anysphere.open-remote-ssh" extension is available, it is used with priority + // If it is not found, then the extension "ms-vscode-remote.remote-ssh" is sought as a fallback. + // This is specifically for non-official VS Code distributions, such as Cursor. + const useRemoteSSHExtension = openRemoteSSHExtension + ? openRemoteSSHExtension + : vscode.extensions.getExtension("ms-vscode-remote.remote-ssh") + if (!useRemoteSSHExtension) { throw new Error("Remote SSH extension not found") } // eslint-disable-next-line @typescript-eslint/no-explicit-any const vscodeProposed: typeof vscode = (module as any)._load( "vscode", { - filename: remoteSSHExtension?.extensionPath, + filename: useRemoteSSHExtension?.extensionPath, }, false, )