55
66import { Disposable , DisposableMap } from 'vs/base/common/lifecycle' ;
77import { URI } from 'vs/base/common/uri' ;
8+ import { ILogService } from 'vs/platform/log/common/log' ;
9+ import { IProductService } from 'vs/platform/product/common/productService' ;
810import { ExtHostContext , ExtHostInteractiveSessionShape , IInteractiveRequestDto , MainContext , MainThreadInteractiveSessionShape } from 'vs/workbench/api/common/extHost.protocol' ;
911import { IInteractiveSessionContributionService } from 'vs/workbench/contrib/interactiveSession/common/interactiveSessionContributionService' ;
1012import { IInteractiveProgress , IInteractiveRequest , IInteractiveResponse , IInteractiveSession , IInteractiveSessionDynamicRequest , IInteractiveSessionService } from 'vs/workbench/contrib/interactiveSession/common/interactiveSessionService' ;
@@ -22,6 +24,8 @@ export class MainThreadInteractiveSession extends Disposable implements MainThre
2224 extHostContext : IExtHostContext ,
2325 @IInteractiveSessionService private readonly _interactiveSessionService : IInteractiveSessionService ,
2426 @IInteractiveSessionContributionService private readonly interactiveSessionContribService : IInteractiveSessionContributionService ,
27+ @IProductService private readonly productService : IProductService ,
28+ @ILogService private readonly logService : ILogService ,
2529 ) {
2630 super ( ) ;
2731 this . _proxy = extHostContext . getProxy ( ExtHostContext . ExtHostInteractiveSession ) ;
@@ -32,6 +36,11 @@ export class MainThreadInteractiveSession extends Disposable implements MainThre
3236 }
3337
3438 async $registerInteractiveSessionProvider ( handle : number , id : string , implementsProgress : boolean ) : Promise < void > {
39+ if ( this . productService . quality === 'stable' ) {
40+ this . logService . trace ( `The interactive session API is not supported in stable VS Code.` ) ;
41+ return ;
42+ }
43+
3544 const registration = this . interactiveSessionContribService . registeredProviders . find ( staticProvider => staticProvider . id === id ) ;
3645 if ( ! registration ) {
3746 throw new Error ( `Provider ${ id } must be declared in the package.json.` ) ;
0 commit comments