@@ -25,7 +25,7 @@ import type * as vscode from 'vscode';
25
25
import { ExtensionIdentifier , ExtensionIdentifierMap , ExtensionIdentifierSet , IExtensionDescription , IRelaxedExtensionDescription } from 'vs/platform/extensions/common/extensions' ;
26
26
import { VSBuffer } from 'vs/base/common/buffer' ;
27
27
import { ExtensionGlobalMemento , ExtensionMemento } from 'vs/workbench/api/common/extHostMemento' ;
28
- import { RemoteAuthorityResolverError , ExtensionKind , ExtensionMode , ExtensionRuntime , ResolvedAuthority as ExtHostResolvedAuthority } from 'vs/workbench/api/common/extHostTypes' ;
28
+ import { RemoteAuthorityResolverError , ExtensionKind , ExtensionMode , ExtensionRuntime , ManagedResolvedAuthority as ExtHostManagedResolvedAuthority } from 'vs/workbench/api/common/extHostTypes' ;
29
29
import { ResolvedAuthority , ResolvedOptions , RemoteAuthorityResolverErrorCode , IRemoteConnectionData , getRemoteAuthorityPrefix , TunnelInformation , ManagedRemoteConnection , WebSocketRemoteConnection } from 'vs/platform/remote/common/remoteAuthorityResolver' ;
30
30
import { IInstantiationService , createDecorator } from 'vs/platform/instantiation/common/instantiation' ;
31
31
import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService' ;
@@ -838,16 +838,11 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme
838
838
authenticationSession : result . authenticationSessionForInitializingExtensions ? { id : result . authenticationSessionForInitializingExtensions . id , providerId : result . authenticationSessionForInitializingExtensions . providerId } : undefined
839
839
} ;
840
840
841
- logInfo ( `returned ${ result instanceof ExtHostResolvedAuthority ? `${ result . host } :${ result . port } ` : 'managed authority' } ` ) ;
841
+ // extension are not required to return an instance of ResolvedAuthority or ManagedResolvedAuthority, so don't use `instanceof`
842
+ logInfo ( `returned ${ ExtHostManagedResolvedAuthority . isManagedResolvedAuthority ( result ) ? 'managed authority' : `${ result . host } :${ result . port } ` } ` ) ;
842
843
843
844
let authority : ResolvedAuthority ;
844
- if ( result instanceof ExtHostResolvedAuthority ) {
845
- authority = {
846
- authority : remoteAuthority ,
847
- connectTo : new WebSocketRemoteConnection ( result . host , result . port ) ,
848
- connectionToken : result . connectionToken
849
- } ;
850
- } else {
845
+ if ( ExtHostManagedResolvedAuthority . isManagedResolvedAuthority ( result ) ) {
851
846
// The socket factory is identified by the `resolveAttempt`, since that is a number which
852
847
// always increments and is unique over all resolve() calls in a workbench session.
853
848
const socketFactoryId = resolveAttempt ;
@@ -860,6 +855,12 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme
860
855
connectTo : new ManagedRemoteConnection ( socketFactoryId ) ,
861
856
connectionToken : result . connectionToken
862
857
} ;
858
+ } else {
859
+ authority = {
860
+ authority : remoteAuthority ,
861
+ connectTo : new WebSocketRemoteConnection ( result . host , result . port ) ,
862
+ connectionToken : result . connectionToken
863
+ } ;
863
864
}
864
865
865
866
return {
0 commit comments