Skip to content

Commit b3edfe3

Browse files
committed
Use unnormalized paths when removing fileInformationCache entries
and add a debug log message when we do so.
1 parent 5344ad8 commit b3edfe3

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

‎src/command/preview/preview.ts‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Copyright (C) 2020-2022 Posit Software, PBC
55
*/
66

7-
import { info, warning } from "../../deno_ral/log.ts";
7+
import { debug, info, warning } from "../../deno_ral/log.ts";
88
import {
99
basename,
1010
dirname,
@@ -429,10 +429,8 @@ export async function renderForPreview(
429429
// fileInformationCache contains file content that needs to be refreshed.
430430
// TODO(#13955): Consider adding a dedicated invalidateForFile() method on ProjectContext
431431
if (project?.fileInformationCache) {
432-
const normalizedFile = normalizePath(file);
433-
if (project.fileInformationCache.has(normalizedFile)) {
434-
project.fileInformationCache.delete(normalizedFile);
435-
}
432+
debug(`[renderForPreview] Invalidating file information cache for ${file}`);
433+
project.fileInformationCache.delete(file);
436434
}
437435

438436
// render

0 commit comments

Comments
 (0)