mirror of
https://github.com/Microsoft/vscode
synced 2024-10-30 03:47:56 +00:00
Move 'variableName' form of 'reference' to chatParticipantAdditions.d.ts (#212648)
Because this is confusing, and might be less relevant in the future
This commit is contained in:
parent
597cd68a41
commit
bbc4ba1eff
4 changed files with 11 additions and 5 deletions
|
@ -153,6 +153,10 @@ class ChatAgentResponseStream {
|
|||
reference(value, iconPath) {
|
||||
throwIfDone(this.reference);
|
||||
|
||||
if ('variableName' in value) {
|
||||
checkProposedApiEnabled(that._extension, 'chatParticipantAdditions');
|
||||
}
|
||||
|
||||
if ('variableName' in value && !value.value) {
|
||||
// The participant used this variable. Does that variable have any references to pull in?
|
||||
const matchingVarData = that._request.variables.variables.find(v => v.name === value.variableName);
|
||||
|
|
|
@ -2439,7 +2439,7 @@ export namespace ChatResponseTextEditPart {
|
|||
}
|
||||
|
||||
export namespace ChatResponseReferencePart {
|
||||
export function from(part: vscode.ChatResponseReferencePart): Dto<IChatContentReference> {
|
||||
export function from(part: types.ChatResponseReferencePart): Dto<IChatContentReference> {
|
||||
const iconPath = ThemeIcon.isThemeIcon(part.iconPath) ? part.iconPath
|
||||
: URI.isUri(part.iconPath) ? { light: URI.revive(part.iconPath) }
|
||||
: (part.iconPath && 'light' in part.iconPath && 'dark' in part.iconPath && URI.isUri(part.iconPath.light) && URI.isUri(part.iconPath.dark) ? { light: URI.revive(part.iconPath.light), dark: URI.revive(part.iconPath.dark) }
|
||||
|
@ -2478,7 +2478,7 @@ export namespace ChatResponseReferencePart {
|
|||
value: value.reference.value && mapValue(value.reference.value)
|
||||
} :
|
||||
mapValue(value.reference)
|
||||
);
|
||||
) as vscode.ChatResponseReferencePart; // 'value' is extended with variableName
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -358,7 +358,7 @@ declare module 'vscode' {
|
|||
* @param iconPath Icon for the reference shown in UI
|
||||
* @returns This stream.
|
||||
*/
|
||||
reference(value: Uri | Location | { variableName: string; value?: Uri | Location }, iconPath?: Uri | ThemeIcon | { light: Uri; dark: Uri }): ChatResponseStream;
|
||||
reference(value: Uri | Location, iconPath?: Uri | ThemeIcon | { light: Uri; dark: Uri }): ChatResponseStream;
|
||||
|
||||
/**
|
||||
* Pushes a part to this stream.
|
||||
|
@ -400,9 +400,9 @@ declare module 'vscode' {
|
|||
}
|
||||
|
||||
export class ChatResponseReferencePart {
|
||||
value: Uri | Location | { variableName: string; value?: Uri | Location };
|
||||
value: Uri | Location;
|
||||
iconPath?: Uri | ThemeIcon | { light: Uri; dark: Uri };
|
||||
constructor(value: Uri | Location | { variableName: string; value?: Uri | Location }, iconPath?: Uri | ThemeIcon | { light: Uri; dark: Uri });
|
||||
constructor(value: Uri | Location, iconPath?: Uri | ThemeIcon | { light: Uri; dark: Uri });
|
||||
}
|
||||
|
||||
export class ChatResponseCommandButtonPart {
|
||||
|
|
|
@ -160,6 +160,8 @@ declare module 'vscode' {
|
|||
*/
|
||||
warning(message: string | MarkdownString): ChatResponseStream;
|
||||
|
||||
reference(value: Uri | Location | { variableName: string; value?: Uri | Location }, iconPath?: Uri | ThemeIcon | { light: Uri; dark: Uri }): ChatResponseStream;
|
||||
|
||||
push(part: ExtendedChatResponsePart): ChatResponseStream;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue