Skip to content

Support new context resolve handler #8126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 7, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/lsptoolshost/copilot/contextProviders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export const copilotLanguageServerExtensionComponentName = '@microsoft/visualstu
export const copilotLanguageServerExtensionAssemblyName = 'Microsoft.VisualStudio.Copilot.Roslyn.LanguageServer.dll';
const copilotLanguageServerExtensionCapabilitiesFileName = 'capabilities.json';

type ActiveExperiments = { [name: string]: string | number | boolean | string[] };

export interface DocumentContext {
textDocument: lsp.TextDocumentIdentifier;
position: lsp.Position;
Expand All @@ -25,6 +27,7 @@ export interface ContextResolveParam {
completionId: string;
timeBudget: number;
data?: any;
activeExperiments: ActiveExperiments;
}

const resolveContextMethodName = 'roslyn/resolveContext';
Expand Down Expand Up @@ -60,6 +63,8 @@ function createContextResolveParam(request: ResolveRequest): ContextResolveParam
},
completionId: request.completionId,
timeBudget: request.timeBudget,
data: request.data,
activeExperiments: Object.fromEntries(request.activeExperiments),
};
return contextResolveParam;
}
Expand Down
Loading