mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-18 15:55:59 +01:00
Contributable chat context (#273736)
* Contributable chat context * Copilot feedback * Matt and Ben feedback * Also resolve for resources * Clean up API * More polish * Fix double context
This commit is contained in:
@@ -114,6 +114,7 @@ import { ExtHostWebviewPanels } from './extHostWebviewPanels.js';
|
||||
import { ExtHostWebviewViews } from './extHostWebviewView.js';
|
||||
import { IExtHostWindow } from './extHostWindow.js';
|
||||
import { IExtHostWorkspace } from './extHostWorkspace.js';
|
||||
import { ExtHostChatContext } from './extHostChatContext.js';
|
||||
|
||||
export interface IExtensionRegistries {
|
||||
mine: ExtensionDescriptionRegistry;
|
||||
@@ -227,6 +228,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
|
||||
const extHostLanguageModelTools = rpcProtocol.set(ExtHostContext.ExtHostLanguageModelTools, new ExtHostLanguageModelTools(rpcProtocol, extHostLanguageModels));
|
||||
const extHostChatSessions = rpcProtocol.set(ExtHostContext.ExtHostChatSessions, new ExtHostChatSessions(extHostCommands, extHostLanguageModels, rpcProtocol, extHostLogService));
|
||||
const extHostChatAgents2 = rpcProtocol.set(ExtHostContext.ExtHostChatAgents2, new ExtHostChatAgents2(rpcProtocol, extHostLogService, extHostCommands, extHostDocuments, extHostLanguageModels, extHostDiagnostics, extHostLanguageModelTools));
|
||||
const extHostChatContext = rpcProtocol.set(ExtHostContext.ExtHostChatContext, new ExtHostChatContext(rpcProtocol));
|
||||
const extHostAiRelatedInformation = rpcProtocol.set(ExtHostContext.ExtHostAiRelatedInformation, new ExtHostRelatedInformation(rpcProtocol));
|
||||
const extHostAiEmbeddingVector = rpcProtocol.set(ExtHostContext.ExtHostAiEmbeddingVector, new ExtHostAiEmbeddingVector(rpcProtocol));
|
||||
const extHostAiSettingsSearch = rpcProtocol.set(ExtHostContext.ExtHostAiSettingsSearch, new ExtHostAiSettingsSearch(rpcProtocol));
|
||||
@@ -1279,6 +1281,10 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
|
||||
},
|
||||
encode(content: string, options?: { uri?: vscode.Uri; encoding?: string }) {
|
||||
return extHostWorkspace.encode(content, options);
|
||||
},
|
||||
registerChatContextProvider(selector: vscode.DocumentSelector, id: string, provider: vscode.ChatContextProvider): vscode.Disposable {
|
||||
checkProposedApiEnabled(extension, 'chatContextProvider');
|
||||
return extHostChatContext.registerChatContextProvider(checkSelector(selector), `${extension.id}-${id}`, provider);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user