()
| 220 | } |
| 221 | |
| 222 | public async deleteChain(): Promise<void> { |
| 223 | PrefetchQueue.getInstance().abort(); |
| 224 | |
| 225 | this.currentEditChainId = null; |
| 226 | this.previousCompletions = []; |
| 227 | |
| 228 | if (this.previousRequest) { |
| 229 | const fileContent = ( |
| 230 | await this.ide.readFile(this.previousRequest.filepath) |
| 231 | ).toString(); |
| 232 | |
| 233 | const ast = await getAst(this.previousRequest.filepath, fileContent); |
| 234 | |
| 235 | if (ast) { |
| 236 | DocumentHistoryTracker.getInstance().push( |
| 237 | localPathOrUriToPath(this.previousRequest.filepath), |
| 238 | fileContent, |
| 239 | ast, |
| 240 | ); |
| 241 | } |
| 242 | } |
| 243 | } |
| 244 | |
| 245 | public startChain(id?: string) { |
| 246 | this.currentEditChainId = id ?? uuidv4(); |
no test coverage detected