Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vscode-dts/vscode.proposed.aiRelatedInformation.d.ts
3290 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
declare module 'vscode' {
7
8
// https://github.com/microsoft/vscode/issues/190909
9
10
export enum RelatedInformationType {
11
SymbolInformation = 1,
12
CommandInformation = 2,
13
SearchInformation = 3,
14
SettingInformation = 4
15
}
16
17
export interface RelatedInformationBaseResult {
18
type: RelatedInformationType;
19
weight: number;
20
}
21
22
// TODO: Symbols and Search
23
24
export interface CommandInformationResult extends RelatedInformationBaseResult {
25
type: RelatedInformationType.CommandInformation;
26
command: string;
27
}
28
29
export interface SettingInformationResult extends RelatedInformationBaseResult {
30
type: RelatedInformationType.SettingInformation;
31
setting: string;
32
}
33
34
export type RelatedInformationResult = CommandInformationResult | SettingInformationResult;
35
36
export interface RelatedInformationProvider {
37
provideRelatedInformation(query: string, token: CancellationToken): ProviderResult<RelatedInformationResult[]>;
38
}
39
40
export interface EmbeddingVectorProvider {
41
provideEmbeddingVector(strings: string[], token: CancellationToken): ProviderResult<number[][]>;
42
}
43
44
export namespace ai {
45
export function getRelatedInformation(query: string, types: RelatedInformationType[], token: CancellationToken): Thenable<RelatedInformationResult[]>;
46
export function registerRelatedInformationProvider(type: RelatedInformationType, provider: RelatedInformationProvider): Disposable;
47
export function registerEmbeddingVectorProvider(model: string, provider: EmbeddingVectorProvider): Disposable;
48
}
49
}
50
51