Stub out copilotRelated command (#60488)

This commit is contained in:
Nathan Shively-Sanders
2024-11-13 08:33:00 -08:00
committed by GitHub
parent b58ac4abf2
commit 79ea5a5b35
17 changed files with 5 additions and 290 deletions

View File

@@ -202,6 +202,7 @@ export const enum CommandTypes {
ProvideInlayHints = "provideInlayHints",
WatchChange = "watchChange",
MapCode = "mapCode",
/** @internal */
CopilotRelated = "copilotRelated",
}
@@ -2417,18 +2418,6 @@ export interface MapCodeResponse extends Response {
body: readonly FileCodeEdits[];
}
export interface CopilotRelatedRequest extends FileRequest {
command: CommandTypes.CopilotRelated;
arguments: FileRequestArgs;
}
export interface CopilotRelatedItems {
relatedFiles: readonly string[];
}
export interface CopilotRelatedResponse extends Response {
body: CopilotRelatedItems;
}
/**
* Synchronous request for semantic diagnostics of one file.
*/

View File

@@ -2052,11 +2052,9 @@ export class Session<TMessage = string> implements EventSender {
return this.mapTextChangesToCodeEdits(changes);
}
private getCopilotRelatedInfo(args: protocol.FileRequestArgs): protocol.CopilotRelatedItems {
const { file, project } = this.getFileAndProject(args);
private getCopilotRelatedInfo(): { relatedFiles: never[]; } {
return {
relatedFiles: project.getLanguageService().getImports(file),
relatedFiles: [],
};
}
@@ -3802,8 +3800,8 @@ export class Session<TMessage = string> implements EventSender {
[protocol.CommandTypes.MapCode]: (request: protocol.MapCodeRequest) => {
return this.requiredResponse(this.mapCode(request.arguments));
},
[protocol.CommandTypes.CopilotRelated]: (request: protocol.CopilotRelatedRequest) => {
return this.requiredResponse(this.getCopilotRelatedInfo(request.arguments));
[protocol.CommandTypes.CopilotRelated]: () => {
return this.requiredResponse(this.getCopilotRelatedInfo());
},
}));