Skip to content

Commit

Permalink
"Workspace does not exist" when failing to connect to ssh remote (fix #…
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero committed Oct 20, 2021
1 parent 792df9d commit 96ff0e0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/vs/workbench/contrib/remote/common/remote.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ class RemoteInvalidWorkspaceDetector extends Disposable implements IWorkbenchCon
@IDialogService private readonly dialogService: IDialogService,
@IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService,
@IWorkspaceContextService private readonly contextService: IWorkspaceContextService,
@IFileDialogService private readonly fileDialogService: IFileDialogService
@IFileDialogService private readonly fileDialogService: IFileDialogService,
@IRemoteAgentService remoteAgentService: IRemoteAgentService
) {
super();

Expand All @@ -108,7 +109,14 @@ class RemoteInvalidWorkspaceDetector extends Disposable implements IWorkbenchCon
// the user to a valid workspace.
// (see https://github.com/microsoft/vscode/issues/133872)
if (this.environmentService.remoteAuthority) {
this.validateRemoteWorkspace();
remoteAgentService.getEnvironment().then(remoteEnv => {
if (remoteEnv) {
// we use the presence of `remoteEnv` to figure out
// if we got a healthy remote connection
// (see https://github.com/microsoft/vscode/issues/135331)
this.validateRemoteWorkspace();
}
});
}
}

Expand Down

0 comments on commit 96ff0e0

Please sign in to comment.