5
5
6
6
import { Disposable , DisposableMap } from 'vs/base/common/lifecycle' ;
7
7
import { URI } from 'vs/base/common/uri' ;
8
+ import { ILogService } from 'vs/platform/log/common/log' ;
9
+ import { IProductService } from 'vs/platform/product/common/productService' ;
8
10
import { ExtHostContext , ExtHostInteractiveSessionShape , IInteractiveRequestDto , MainContext , MainThreadInteractiveSessionShape } from 'vs/workbench/api/common/extHost.protocol' ;
9
11
import { IInteractiveSessionContributionService } from 'vs/workbench/contrib/interactiveSession/common/interactiveSessionContributionService' ;
10
12
import { IInteractiveProgress , IInteractiveRequest , IInteractiveResponse , IInteractiveSession , IInteractiveSessionDynamicRequest , IInteractiveSessionService } from 'vs/workbench/contrib/interactiveSession/common/interactiveSessionService' ;
@@ -22,6 +24,8 @@ export class MainThreadInteractiveSession extends Disposable implements MainThre
22
24
extHostContext : IExtHostContext ,
23
25
@IInteractiveSessionService private readonly _interactiveSessionService : IInteractiveSessionService ,
24
26
@IInteractiveSessionContributionService private readonly interactiveSessionContribService : IInteractiveSessionContributionService ,
27
+ @IProductService private readonly productService : IProductService ,
28
+ @ILogService private readonly logService : ILogService ,
25
29
) {
26
30
super ( ) ;
27
31
this . _proxy = extHostContext . getProxy ( ExtHostContext . ExtHostInteractiveSession ) ;
@@ -32,6 +36,11 @@ export class MainThreadInteractiveSession extends Disposable implements MainThre
32
36
}
33
37
34
38
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
+
35
44
const registration = this . interactiveSessionContribService . registeredProviders . find ( staticProvider => staticProvider . id === id ) ;
36
45
if ( ! registration ) {
37
46
throw new Error ( `Provider ${ id } must be declared in the package.json.` ) ;
0 commit comments