@@ -13,27 +13,26 @@ import { Storage } from "./storage"
13
13
import { WorkspaceQuery , WorkspaceProvider } from "./workspacesProvider"
14
14
15
15
export 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!
19
18
//
20
19
// This is janky, but that's alright since it provides such minimal
21
20
// functionality to the extension.
22
- const openRemoteSSHExtension = vscode . extensions . getExtension ( "anysphere.open-remote-ssh" )
23
- //If the" anysphere.open-remote-ssh" extensionis available, itis 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 extensionif itexists. 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 ) {
30
29
throw new Error ( "Remote SSH extension not found" )
31
30
}
32
31
// eslint-disable-next-line @typescript-eslint/no-explicit-any
33
32
const vscodeProposed :typeof vscode = ( module as any ) . _load (
34
33
"vscode" ,
35
34
{
36
- filename :useRemoteSSHExtension ?. extensionPath ,
35
+ filename :remoteSSHExtension ?. extensionPath ,
37
36
} ,
38
37
false ,
39
38
)