Skip to content

Commit 5e5183a

Browse files
authored
🔪 DELETE chatVariableResolver API proposal 💀 (microsoft#239755)
* 🔪 DELETE chatVariableResolver API proposal 💀 * Remove import * Remove chat variable test * Bump distro
1 parent 2ef2dbd commit 5e5183a

File tree

9 files changed

+4
-313
lines changed

9 files changed

+4
-313
lines changed

extensions/vscode-api-tests/src/singlefolder-tests/chat.test.ts

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import * as assert from 'assert';
77
import 'mocha';
8-
import { ChatContext, ChatRequest, ChatResult, ChatVariableLevel, Disposable, Event, EventEmitter, chat, commands, lm } from 'vscode';
8+
import { ChatContext, ChatRequest, ChatResult, Disposable, Event, EventEmitter, chat, commands, lm } from 'vscode';
99
import { DeferredPromise, asPromise, assertNoRpc, closeAllEditors, delay, disposeAll } from '../utils';
1010

1111
suite('chat', () => {
@@ -40,13 +40,6 @@ suite('chat', () => {
4040
disposeAll(disposables);
4141
});
4242

43-
function getDeferredForRequest(): DeferredPromise<ChatRequest> {
44-
const deferred = new DeferredPromise<ChatRequest>();
45-
disposables.push(setupParticipant()(request => deferred.complete(request.request)));
46-
47-
return deferred;
48-
}
49-
5043
function setupParticipant(second?: boolean): Event<{ request: ChatRequest; context: ChatContext }> {
5144
const emitter = new EventEmitter<{ request: ChatRequest; context: ChatContext }>();
5245
disposables.push(emitter);
@@ -88,20 +81,6 @@ suite('chat', () => {
8881
await deferred.p;
8982
});
9083

91-
test('participant and variable', async () => {
92-
disposables.push(chat.registerChatVariableResolver('myVarId', 'myVar', 'My variable', 'My variable', false, {
93-
resolve(_name, _context, _token) {
94-
return [{ level: ChatVariableLevel.Full, value: 'myValue' }];
95-
}
96-
}));
97-
98-
const deferred = getDeferredForRequest();
99-
commands.executeCommand('workbench.action.chat.open', { query: '@participant hi #myVar' });
100-
const request = await deferred.p;
101-
assert.strictEqual(request.prompt, 'hi #myVar');
102-
assert.strictEqual(request.references[0].value, 'myValue');
103-
});
104-
10584
test('result metadata is returned to the followup provider', async () => {
10685
const deferred = new DeferredPromise<ChatResult>();
10786
const participant = chat.createChatParticipant('api-test.participant', (_request, _context, _progress, _token) => {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "code-oss-dev",
33
"version": "1.98.0",
4-
"distro": "41de7f370f100ee0374fe780e73a995803da6a9c",
4+
"distro": "8003b9520817bc4fb7e06779aaca5f9e2f730e98",
55
"author": {
66
"name": "Microsoft Corporation"
77
},
@@ -237,4 +237,4 @@
237237
"optionalDependencies": {
238238
"windows-foreground-love": "0.5.0"
239239
}
240-
}
240+
}

src/vs/platform/extensions/common/extensionsApiProposals.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ const _allApiProposals = {
4747
chatTab: {
4848
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatTab.d.ts',
4949
},
50-
chatVariableResolver: {
51-
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatVariableResolver.d.ts',
52-
},
5350
codeActionAI: {
5451
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codeActionAI.d.ts',
5552
},

src/vs/workbench/api/browser/extensionHost.contribution.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import './mainThreadLocalization.js';
1919
import './mainThreadBulkEdits.js';
2020
import './mainThreadLanguageModels.js';
2121
import './mainThreadChatAgents2.js';
22-
import './mainThreadChatVariables.js';
2322
import './mainThreadChatCodeMapper.js';
2423
import './mainThreadLanguageModelTools.js';
2524
import './mainThreadEmbeddings.js';

src/vs/workbench/api/browser/mainThreadChatVariables.ts

Lines changed: 0 additions & 50 deletions
This file was deleted.

src/vs/workbench/api/common/extHost.api.impl.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import { IExtHostApiDeprecationService } from './extHostApiDeprecationService.js
2828
import { IExtHostAuthentication } from './extHostAuthentication.js';
2929
import { ExtHostBulkEdits } from './extHostBulkEdits.js';
3030
import { ExtHostChatAgents2 } from './extHostChatAgents2.js';
31-
import { ExtHostChatVariables } from './extHostChatVariables.js';
3231
import { ExtHostClipboard } from './extHostClipboard.js';
3332
import { ExtHostEditorInsets } from './extHostCodeInsets.js';
3433
import { IExtHostCommands } from './extHostCommands.js';
@@ -213,7 +212,6 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
213212
const extHostProfileContentHandlers = rpcProtocol.set(ExtHostContext.ExtHostProfileContentHandlers, new ExtHostProfileContentHandlers(rpcProtocol));
214213
rpcProtocol.set(ExtHostContext.ExtHostInteractive, new ExtHostInteractive(rpcProtocol, extHostNotebook, extHostDocumentsAndEditors, extHostCommands, extHostLogService));
215214
const extHostChatAgents2 = rpcProtocol.set(ExtHostContext.ExtHostChatAgents2, new ExtHostChatAgents2(rpcProtocol, extHostLogService, extHostCommands, extHostDocuments, extHostLanguageModels));
216-
const extHostChatVariables = rpcProtocol.set(ExtHostContext.ExtHostChatVariables, new ExtHostChatVariables(rpcProtocol));
217215
const extHostLanguageModelTools = rpcProtocol.set(ExtHostContext.ExtHostLanguageModelTools, new ExtHostLanguageModelTools(rpcProtocol));
218216
const extHostAiRelatedInformation = rpcProtocol.set(ExtHostContext.ExtHostAiRelatedInformation, new ExtHostRelatedInformation(rpcProtocol));
219217
const extHostAiEmbeddingVector = rpcProtocol.set(ExtHostContext.ExtHostAiEmbeddingVector, new ExtHostAiEmbeddingVector(rpcProtocol));
@@ -1422,10 +1420,6 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
14221420
checkProposedApiEnabled(extension, 'chatProvider');
14231421
return extHostLanguageModels.registerLanguageModel(extension, id, provider, metadata);
14241422
},
1425-
registerChatVariableResolver(id: string, name: string, userDescription: string, modelDescription: string | undefined, isSlow: boolean | undefined, resolver: vscode.ChatVariableResolver, fullName?: string, icon?: vscode.ThemeIcon) {
1426-
checkProposedApiEnabled(extension, 'chatVariableResolver');
1427-
return extHostChatVariables.registerVariableResolver(extension, id, name, userDescription, modelDescription, isSlow, resolver, fullName, icon?.id);
1428-
},
14291423
registerMappedEditsProvider(_selector: vscode.DocumentSelector, _provider: vscode.MappedEditsProvider) {
14301424
checkProposedApiEnabled(extension, 'mappedEditsProvider');
14311425
// no longer supported

src/vs/workbench/api/common/extHost.protocol.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ import { ICodeMapperRequest, ICodeMapperResult } from '../../contrib/chat/common
5555
import { IChatRelatedFile, IChatRelatedFileProviderMetadata as IChatRelatedFilesProviderMetadata, IChatRequestDraft } from '../../contrib/chat/common/chatEditingService.js';
5656
import { IChatProgressHistoryResponseContent } from '../../contrib/chat/common/chatModel.js';
5757
import { IChatContentInlineReference, IChatFollowup, IChatProgress, IChatResponseErrorDetails, IChatTask, IChatTaskDto, IChatUserActionEvent, IChatVoteAction } from '../../contrib/chat/common/chatService.js';
58-
import { IChatRequestVariableValue, IChatVariableData, IChatVariableResolverProgress } from '../../contrib/chat/common/chatVariables.js';
58+
import { IChatRequestVariableValue } from '../../contrib/chat/common/chatVariables.js';
5959
import { IChatMessage, IChatResponseFragment, ILanguageModelChatMetadata, ILanguageModelChatSelector, ILanguageModelsChangeEvent } from '../../contrib/chat/common/languageModels.js';
6060
import { IPreparedToolInvocation, IToolData, IToolInvocation, IToolResult } from '../../contrib/chat/common/languageModelToolsService.js';
6161
import { DebugConfigurationProviderTriggerKind, IAdapterDescriptor, IConfig, IDebugSessionReplMode, IDebugTestRunReference, IDebugVisualization, IDebugVisualizationContext, IDebugVisualizationTreeItem, MainThreadDebugVisualization } from '../../contrib/debug/common/debug.js';
@@ -1354,15 +1354,6 @@ export interface IChatParticipantDetectionResult {
13541354
command?: string;
13551355
}
13561356

1357-
export type IChatVariableResolverProgressDto =
1358-
| Dto<IChatVariableResolverProgress>;
1359-
1360-
export interface MainThreadChatVariablesShape extends IDisposable {
1361-
$registerVariable(handle: number, data: IChatVariableData): void;
1362-
$handleProgressChunk(requestId: string, progress: IChatVariableResolverProgressDto): Promise<number | void>;
1363-
$unregisterVariable(handle: number): void;
1364-
}
1365-
13661357
export type IToolDataDto = Omit<IToolData, 'when'>;
13671358

13681359
export interface MainThreadLanguageModelToolsShape extends IDisposable {
@@ -1375,10 +1366,6 @@ export interface MainThreadLanguageModelToolsShape extends IDisposable {
13751366

13761367
export type IChatRequestVariableValueDto = Dto<IChatRequestVariableValue>;
13771368

1378-
export interface ExtHostChatVariablesShape {
1379-
$resolveVariable(handle: number, requestId: string, messageText: string, token: CancellationToken): Promise<IChatRequestVariableValueDto | undefined>;
1380-
}
1381-
13821369
export interface ExtHostLanguageModelToolsShape {
13831370
$onDidChangeTools(tools: IToolDataDto[]): void;
13841371
$invokeTool(dto: IToolInvocation, token: CancellationToken): Promise<IToolResult>;
@@ -3017,7 +3004,6 @@ export const MainContext = {
30173004
MainThreadEmbeddings: createProxyIdentifier<MainThreadEmbeddingsShape>('MainThreadEmbeddings'),
30183005
MainThreadChatAgents2: createProxyIdentifier<MainThreadChatAgentsShape2>('MainThreadChatAgents2'),
30193006
MainThreadCodeMapper: createProxyIdentifier<MainThreadCodeMapperShape>('MainThreadCodeMapper'),
3020-
MainThreadChatVariables: createProxyIdentifier<MainThreadChatVariablesShape>('MainThreadChatVariables'),
30213007
MainThreadLanguageModelTools: createProxyIdentifier<MainThreadLanguageModelToolsShape>('MainThreadChatSkills'),
30223008
MainThreadClipboard: createProxyIdentifier<MainThreadClipboardShape>('MainThreadClipboard'),
30233009
MainThreadCommands: createProxyIdentifier<MainThreadCommandsShape>('MainThreadCommands'),
@@ -3138,7 +3124,6 @@ export const ExtHostContext = {
31383124
ExtHostNotebookDocumentSaveParticipant: createProxyIdentifier<ExtHostNotebookDocumentSaveParticipantShape>('ExtHostNotebookDocumentSaveParticipant'),
31393125
ExtHostInteractive: createProxyIdentifier<ExtHostInteractiveShape>('ExtHostInteractive'),
31403126
ExtHostChatAgents2: createProxyIdentifier<ExtHostChatAgentsShape2>('ExtHostChatAgents'),
3141-
ExtHostChatVariables: createProxyIdentifier<ExtHostChatVariablesShape>('ExtHostChatVariables'),
31423127
ExtHostLanguageModelTools: createProxyIdentifier<ExtHostLanguageModelToolsShape>('ExtHostChatSkills'),
31433128
ExtHostChatProvider: createProxyIdentifier<ExtHostLanguageModelsShape>('ExtHostChatProvider'),
31443129
ExtHostSpeech: createProxyIdentifier<ExtHostSpeechShape>('ExtHostSpeech'),

src/vs/workbench/api/common/extHostChatVariables.ts

Lines changed: 0 additions & 130 deletions
This file was deleted.

0 commit comments

Comments
 (0)