Skip to content

Commit

Permalink
Merge pull request #7622 from genlu/AddContext
Browse files Browse the repository at this point in the history
Update registerRelatedFilesProvider API
  • Loading branch information
genlu authored Oct 3, 2024
2 parents 7936fa2 + 1c17106 commit cfb38c8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/lsptoolshost/copilot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,21 @@ import { UriConverter } from './uriConverter';
import { TextDocumentIdentifier } from 'vscode-languageserver-protocol';
import { languageServerOptions } from '../shared/options';

interface CopilotTrait {
name: string;
value: string;
includeInPrompt?: boolean;
promptTextOverride?: string;
}

interface CopilotRelatedFilesProviderRegistration {
registerRelatedFilesProvider(
providerId: { extensionId: string; languageId: string },
callback: (
uri: vscode.Uri,
context: { flags: Record<string, unknown> },
cancellationToken?: vscode.CancellationToken
) => Promise<{ entries: vscode.Uri[]; traits?: { name: string; value: string }[] }>
) => Promise<{ entries: vscode.Uri[]; traits?: CopilotTrait[] }>
): vscode.Disposable;
}

Expand Down Expand Up @@ -55,7 +63,7 @@ export function registerCopilotExtension(languageServer: RoslynLanguageServer, c
languageId: 'csharp',
};

relatedAPI.registerRelatedFilesProvider(id, async (uri, token) => {
relatedAPI.registerRelatedFilesProvider(id, async (uri, _, token) => {
const buildResult = (reports: CopilotRelatedDocumentsReport[], builder?: vscode.Uri[]) => {
if (reports) {
for (const report of reports) {
Expand Down

0 comments on commit cfb38c8

Please sign in to comment.