Skip to content

Commit

Permalink
feat: dont generate new object
Browse files Browse the repository at this point in the history
  • Loading branch information
kazushisan committed Dec 15, 2024
1 parent 06bdfec commit 603c8a2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/util/edit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,12 @@ export const edit = async ({
break;
}

const current = {
vertexes: dependencyGraph.vertexes,
files: fileService.eject(),
fileNames: fileService.getFileNames(),
};

const next = first
.map((v) => {
// if the file is not in the file service, it means it has been deleted in a previous iteration
Expand All @@ -644,9 +650,9 @@ export const edit = async ({

const result = processFile({
targetFile: v.file,
vertexes: dependencyGraph.eject(),
files: fileService.eject(),
fileNames: fileService.getFileNames(),
vertexes: current.vertexes,
files: current.files,
fileNames: current.fileNames,
deleteUnusedFile,
enableCodeFix,
options,
Expand Down

0 comments on commit 603c8a2

Please sign in to comment.