@@ -21,9 +21,6 @@ export async function activate(ctx: vscode.ExtensionContext): Promise<void> {
21
21
//
22
22
// Cursor and VSCode are covered by ms remote, and the only other is windsurf for now
23
23
// Means that vscodium is not supported by this for now
24
- const isTestMode =
25
- process . env . NODE_ENV === "test" ||
26
- ctx . extensionMode === vscode . ExtensionMode . Test ;
27
24
28
25
const remoteSSHExtension =
29
26
vscode . extensions . getExtension ( "jeanp413.open-remote-ssh" ) ||
@@ -34,13 +31,11 @@ export async function activate(ctx: vscode.ExtensionContext): Promise<void> {
34
31
let vscodeProposed : typeof vscode = vscode ;
35
32
36
33
if ( ! remoteSSHExtension ) {
37
- if ( ! isTestMode ) {
38
- vscode . window . showErrorMessage (
39
- "Remote SSH extension not found, cannot activate Coder extension" ,
40
- ) ;
41
- throw new Error ( "Remote SSH extension not found" ) ;
42
- }
43
- // In test mode, use regular vscode API
34
+ vscode . window . showErrorMessage (
35
+ "Remote SSH extension not found, this may not work as expected.\n" +
36
+ // NB should we link to documentation or marketplace?
37
+ "Please install your choice of Remote SSH extension from the VS Code Marketplace." ,
38
+ ) ;
44
39
} else {
45
40
// eslint-disable-next-line @typescript-eslint/no-explicit-any
46
41
vscodeProposed = ( module as any ) . _load (
@@ -289,7 +284,13 @@ export async function activate(ctx: vscode.ExtensionContext): Promise<void> {
289
284
// Since the "onResolveRemoteAuthority:ssh-remote" activation event exists
290
285
// in package.json we're able to perform actions before the authority is
291
286
// resolved by the remote SSH extension.
292
- if ( ! isTestMode && vscodeProposed . env . remoteAuthority ) {
287
+ //
288
+ // In addition, if we don't have a remote SSH extension, we skip this
289
+ // activation event. This may allow the user to install the extension
290
+ // after the Coder extension is installed, instead of throwing a fatal error
291
+ // (this would require the user to uninstall the Coder extension and
292
+ // reinstall after installing the remote SSH extension, which is annoying)
293
+ if ( remoteSSHExtension && vscodeProposed . env . remoteAuthority ) {
293
294
const remote = new Remote (
294
295
vscodeProposed ,
295
296
storage ,
0 commit comments