(params: {
helper: HelperVars;
editableRegionStartLine: number;
editableRegionEndLine: number;
startTime: number;
llm: ILLM;
nextCompletion: string;
promptMetadata: PromptMetadata;
ide: IDE;
})
| 99 | } |
| 100 | |
| 101 | public async handleFullFileDiff(params: { |
| 102 | helper: HelperVars; |
| 103 | editableRegionStartLine: number; |
| 104 | editableRegionEndLine: number; |
| 105 | startTime: number; |
| 106 | llm: ILLM; |
| 107 | nextCompletion: string; |
| 108 | promptMetadata: PromptMetadata; |
| 109 | ide: IDE; |
| 110 | }): Promise<NextEditOutcome | undefined> { |
| 111 | const { |
| 112 | helper, |
| 113 | editableRegionStartLine, |
| 114 | editableRegionEndLine, |
| 115 | startTime, |
| 116 | llm, |
| 117 | nextCompletion, |
| 118 | promptMetadata, |
| 119 | ide, |
| 120 | } = params; |
| 121 | const fileSlice = helper.fileLines |
| 122 | .slice(editableRegionStartLine, editableRegionEndLine + 1) |
| 123 | .join("\n"); |
| 124 | |
| 125 | const diffLines = myersDiff(fileSlice, nextCompletion); |
| 126 | const diffGroups = groupDiffLines( |
| 127 | diffLines, |
| 128 | editableRegionStartLine, |
| 129 | 5, |
| 130 | ).filter((group) => !isWhitespaceOnlyDeletion(group.lines)); |
| 131 | const currentLine = helper.pos.line; |
| 132 | const prefetchQueue = PrefetchQueue.getInstance(); |
| 133 | |
| 134 | const cursorLocalDiffGroup = await this.processDiffGroups({ |
| 135 | diffGroups, |
| 136 | currentLine, |
| 137 | helper, |
| 138 | startTime, |
| 139 | llm, |
| 140 | prefetchQueue, |
| 141 | promptMetadata, |
| 142 | ide, |
| 143 | }); |
| 144 | |
| 145 | if (cursorLocalDiffGroup) { |
| 146 | return await this.createOutcomeFromDiffGroup({ |
| 147 | diffGroup: cursorLocalDiffGroup, |
| 148 | helper, |
| 149 | startTime, |
| 150 | llm, |
| 151 | completionId: helper.input.completionId, |
| 152 | isCurrentCursorGroup: true, |
| 153 | promptMetadata, |
| 154 | ide, |
| 155 | }); |
| 156 | } |
| 157 | |
| 158 | return undefined; |
nothing calls this directly
no test coverage detected