introduce a SemanticSimilarity provider model (#179640)

* introduce a SemanticSimilarity provider model

* have raceCancellablePromises also cancel if it rejects

* remove extensionId for now

* remove unused code
This commit is contained in:
Tyler James Leonhardt
2023-04-10 16:07:07 -07:00
committed by GitHub
parent a58d9dc08f
commit a0361ed685
10 changed files with 235 additions and 19 deletions

View File

@@ -100,6 +100,7 @@ import { ExtHostQuickDiff } from 'vs/workbench/api/common/extHostQuickDiff';
import { ExtHostInteractiveSession } from 'vs/workbench/api/common/extHostInteractiveSession';
import { ExtHostInteractiveEditor } from 'vs/workbench/api/common/extHostInteractiveEditor';
import { ExtHostNotebookDocumentSaveParticipant } from 'vs/workbench/api/common/extHostNotebookDocumentSaveParticipant';
import { ExtHostSemanticSimilarity } from 'vs/workbench/api/common/extHostSemanticSimilarity';
export interface IExtensionRegistries {
mine: ExtensionDescriptionRegistry;
@@ -197,6 +198,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
rpcProtocol.set(ExtHostContext.ExtHostInteractive, new ExtHostInteractive(rpcProtocol, extHostNotebook, extHostDocumentsAndEditors, extHostCommands, extHostLogService));
const extHostInteractiveEditor = rpcProtocol.set(ExtHostContext.ExtHostInteractiveEditor, new ExtHostInteractiveEditor(rpcProtocol, extHostDocuments, extHostLogService));
const extHostInteractiveSession = rpcProtocol.set(ExtHostContext.ExtHostInteractiveSession, new ExtHostInteractiveSession(rpcProtocol, extHostLogService));
const extHostSemanticSimilarity = rpcProtocol.set(ExtHostContext.ExtHostSemanticSimilarity, new ExtHostSemanticSimilarity(rpcProtocol));
// Check that no named customers are missing
const expected = Object.values<ProxyIdentifier<any>>(ExtHostContext);
@@ -1248,9 +1250,18 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
}
};
// namespace: ai
const ai: typeof vscode.ai = {
registerSemanticSimilarityProvider(provider: vscode.SemanticSimilarityProvider) {
checkProposedApiEnabled(extension, 'semanticSimilarity');
return extHostSemanticSimilarity.registerSemanticSimilarityProvider(extension, provider);
}
};
return <typeof vscode>{
version: initData.version,
// namespaces
ai,
authentication,
commands,
comments,