chat: better problems integration (#241276)

chat: allow referencing and dragging in diagnostics

- There is a new proposal which adds `ChatReferenceDiagnostic` as a
  prompt reference type
- You can now pick "Problems..." as part of the chat attachment context
- You can drag and drop files and individual diagnostics from the
  Problems view into chat. Previously trying to do this would just
  attach the file.
This commit is contained in:
Connor Peet
2025-02-19 17:38:32 -08:00
committed by GitHub
parent 5312579ab0
commit f9dd5e1a8d
15 changed files with 414 additions and 99 deletions

View File

@@ -0,0 +1,23 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'vscode' {
export interface ChatPromptReference {
/**
* The value of this reference. The `string | Uri | Location` types are used today, but this could expand in the future.
*/
readonly value: string | Uri | Location | ChatReferenceDiagnostic | unknown;
}
export class ChatReferenceDiagnostic {
/**
* All attached diagnostics. An array of uri-diagnostics tuples or an empty array.
*/
readonly diagnostics: [Uri, Diagnostic[]][];
protected constructor(diagnostics: [Uri, Diagnostic[]][]);
}
}