@@ -13,27 +13,26 @@ import { Storage } from "./storage"
1313import { WorkspaceQuery , WorkspaceProvider } from "./workspacesProvider"
1414
1515export async function activate ( ctx : vscode . ExtensionContext ) : Promise < void > {
16- // The Remote SSH extension's proposed APIs are used to override
17- // the SSH host name in VS Code itself. It's visually unappealing
18- // having a lengthy name!
16+ // The Remote SSH extension's proposed APIs are used to override the SSH host
17+ // name in VS Code itself. It's visually unappealing having a lengthy name!
1918 //
2019 // This is janky, but that's alright since it provides such minimal
2120 // functionality to the extension.
22- const openRemoteSSHExtension = vscode . extensions . getExtension ( "anysphere.open-remote-ssh" )
23- // If the " anysphere.open-remote-ssh" extension is available, it is used with priority
24- // If it is not found, then the extension "ms-vscode-remote.remote-ssh" is sought as a fallback.
25- // This is specifically for non-official VS Code distributions, such as Cursor .
26- const useRemoteSSHExtension = openRemoteSSHExtension
27- ? openRemoteSSHExtension
28- : vscode . extensions . getExtension ( "ms-vscode-remote.remote-ssh" )
29- if ( ! useRemoteSSHExtension ) {
21+ //
22+ // Prefer the anysphere.open-remote-ssh extension if it exists. This makes
23+ // our extension compatible with Cursor. Otherwise fall back to the official
24+ // SSH extension .
25+ const remoteSSHExtension =
26+ vscode . extensions . getExtension ( "anysphere.open-remote-ssh" ) ||
27+ vscode . extensions . getExtension ( "ms-vscode-remote.remote-ssh" )
28+ if ( ! remoteSSHExtension ) {
3029 throw new Error ( "Remote SSH extension not found" )
3130 }
3231 // eslint-disable-next-line @typescript-eslint/no-explicit-any
3332 const vscodeProposed : typeof vscode = ( module as any ) . _load (
3433 "vscode" ,
3534 {
36- filename : useRemoteSSHExtension ?. extensionPath ,
35+ filename : remoteSSHExtension ?. extensionPath ,
3736 } ,
3837 false ,
3938 )
0 commit comments