mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
Allow APIs in stable (#184062)
This commit is contained in:
parent
bfcb70bd09
commit
4137aa15f5
|
@ -6,8 +6,6 @@
|
|||
import { Emitter } from 'vs/base/common/event';
|
||||
import { Disposable, DisposableMap } from 'vs/base/common/lifecycle';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IProductService } from 'vs/platform/product/common/productService';
|
||||
import { ExtHostChatShape, ExtHostContext, IChatRequestDto, MainContext, MainThreadChatShape } from 'vs/workbench/api/common/extHost.protocol';
|
||||
import { IChatWidgetService } from 'vs/workbench/contrib/chat/browser/chat';
|
||||
import { IChatContributionService } from 'vs/workbench/contrib/chat/common/chatContributionService';
|
||||
|
@ -28,8 +26,6 @@ export class MainThreadChat extends Disposable implements MainThreadChatShape {
|
|||
@IChatService private readonly _chatService: IChatService,
|
||||
@IChatWidgetService private readonly _chatWidgetService: IChatWidgetService,
|
||||
@IChatContributionService private readonly chatContribService: IChatContributionService,
|
||||
@IProductService private readonly productService: IProductService,
|
||||
@ILogService private readonly logService: ILogService,
|
||||
) {
|
||||
super();
|
||||
this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostChat);
|
||||
|
@ -40,11 +36,6 @@ export class MainThreadChat extends Disposable implements MainThreadChatShape {
|
|||
}
|
||||
|
||||
async $registerSlashCommandProvider(handle: number, chatProviderId: string): Promise<void> {
|
||||
if (this.productService.quality === 'stable') {
|
||||
this.logService.trace(`The interactive session API is not supported in stable VS Code.`);
|
||||
return;
|
||||
}
|
||||
|
||||
const unreg = this._chatService.registerSlashCommandProvider({
|
||||
chatProviderId,
|
||||
provideSlashCommands: async token => {
|
||||
|
@ -63,11 +54,6 @@ export class MainThreadChat extends Disposable implements MainThreadChatShape {
|
|||
}
|
||||
|
||||
async $registerChatProvider(handle: number, id: string): Promise<void> {
|
||||
if (this.productService.quality === 'stable') {
|
||||
this.logService.trace(`The interactive session API is not supported in stable VS Code.`);
|
||||
return;
|
||||
}
|
||||
|
||||
const registration = this.chatContribService.registeredProviders.find(staticProvider => staticProvider.id === id);
|
||||
if (!registration) {
|
||||
throw new Error(`Provider ${id} must be declared in the package.json.`);
|
||||
|
|
|
@ -9,8 +9,6 @@ import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'
|
|||
import { reviveWorkspaceEditDto } from 'vs/workbench/api/browser/mainThreadBulkEdits';
|
||||
import { ExtHostContext, ExtHostInteractiveEditorShape, MainContext, MainThreadInteractiveEditorShape } from 'vs/workbench/api/common/extHost.protocol';
|
||||
import { IExtHostContext, extHostNamedCustomer } from 'vs/workbench/services/extensions/common/extHostCustomers';
|
||||
import { IProductService } from 'vs/platform/product/common/productService';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
@extHostNamedCustomer(MainContext.MainThreadInteractiveEditor)
|
||||
export class MainThreadInteractiveEditor implements MainThreadInteractiveEditorShape {
|
||||
|
@ -22,8 +20,6 @@ export class MainThreadInteractiveEditor implements MainThreadInteractiveEditorS
|
|||
extHostContext: IExtHostContext,
|
||||
@IInteractiveEditorService private readonly _interactiveEditorService: IInteractiveEditorService,
|
||||
@IUriIdentityService private readonly _uriIdentService: IUriIdentityService,
|
||||
@IProductService private readonly productService: IProductService,
|
||||
@ILogService private readonly logService: ILogService,
|
||||
) {
|
||||
this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostInteractiveEditor);
|
||||
}
|
||||
|
@ -33,11 +29,6 @@ export class MainThreadInteractiveEditor implements MainThreadInteractiveEditorS
|
|||
}
|
||||
|
||||
async $registerInteractiveEditorProvider(handle: number, debugName: string, supportsFeedback: boolean): Promise<void> {
|
||||
if (this.productService.quality === 'stable') {
|
||||
this.logService.trace(`The interactive editor API is not supported in stable VS Code.`);
|
||||
return;
|
||||
}
|
||||
|
||||
const unreg = this._interactiveEditorService.addProvider({
|
||||
debugName,
|
||||
prepareInteractiveEditorSession: async (model, range, token) => {
|
||||
|
|
|
@ -11,8 +11,6 @@ import { registerAction2 } from 'vs/platform/actions/common/actions';
|
|||
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IRelaxedExtensionDescription } from 'vs/platform/extensions/common/extensions';
|
||||
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IProductService } from 'vs/platform/product/common/productService';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer';
|
||||
import { IViewContainersRegistry, IViewDescriptor, IViewsRegistry, ViewContainer, ViewContainerLocation, Extensions as ViewExtensions } from 'vs/workbench/common/views';
|
||||
|
@ -67,15 +65,8 @@ export class ChatContributionService implements IChatContributionService {
|
|||
private _registeredProviders = new Map<string, IChatProviderContribution>();
|
||||
|
||||
constructor(
|
||||
@IProductService productService: IProductService,
|
||||
@ILogService logService: ILogService,
|
||||
) {
|
||||
chatExtensionPoint.setHandler((extensions, delta) => {
|
||||
if (productService.quality === 'stable') {
|
||||
logService.trace(`ChatContributionService#setHandler: the interactiveSession extension point is not available in stable VS Code.`);
|
||||
return;
|
||||
}
|
||||
|
||||
for (const extension of delta.added) {
|
||||
const extensionDisposable = new DisposableStore();
|
||||
for (const providerDescriptor of extension.value) {
|
||||
|
|
Loading…
Reference in a new issue