CodeMapper support (#55406)

This commit is contained in:
Kat Marchán
2024-05-22 16:47:08 -07:00
committed by GitHub
parent 8537bb72eb
commit ddf43cd0e0
64 changed files with 1931 additions and 0 deletions
+33
View File
@@ -200,6 +200,7 @@ export const enum CommandTypes {
ProvideCallHierarchyOutgoingCalls = "provideCallHierarchyOutgoingCalls",
ProvideInlayHints = "provideInlayHints",
WatchChange = "watchChange",
MapCode = "mapCode",
}
/**
@@ -2342,6 +2343,38 @@ export interface InlayHintsResponse extends Response {
body?: InlayHintItem[];
}
export interface MapCodeRequestArgs extends FileRequestArgs {
/**
* The files and changes to try and apply/map.
*/
mapping: MapCodeRequestDocumentMapping;
}
export interface MapCodeRequestDocumentMapping {
/**
* The specific code to map/insert/replace in the file.
*/
contents: string[];
/**
* Areas of "focus" to inform the code mapper with. For example, cursor
* location, current selection, viewport, etc. Nested arrays denote
* priority: toplevel arrays are more important than inner arrays, and
* inner array priorities are based on items within that array. Items
* earlier in the arrays have higher priority.
*/
focusLocations?: TextSpan[][];
}
export interface MapCodeRequest extends FileRequest {
command: CommandTypes.MapCode;
arguments: MapCodeRequestArgs;
}
export interface MapCodeResponse extends Response {
body: readonly FileCodeEdits[];
}
/**
* Synchronous request for semantic diagnostics of one file.
*/