* One file's snapshot entry. Every sync looks at these files, so one whose * modified time and size haven't moved keeps the digest it has and isn't read: * a compile database runs to megabytes, and a Cargo workspace to a manifest per * crate.
(abs: string, previous: string | undefined, projectRoot: string)
| 294 | * crate. |
| 295 | */ |
| 296 | function moduleConfigEntry(abs: string, previous: string | undefined, projectRoot: string): string { |
| 297 | let stat: fs.Stats | undefined; |
| 298 | try { |
| 299 | stat = fs.statSync(abs, { throwIfNoEntry: false }); |
| 300 | } catch { /* a file that can't be looked at is not there */ } |
| 301 | // (A FIFO under one of these names would park the read.) |
| 302 | if (!stat?.isFile()) return 'absent'; |
| 303 | const stamp = `${stat.mtimeMs}:${stat.size}`; |
| 304 | return previous?.endsWith(`@${stamp}`) ? previous : `${moduleConfigDigest(abs, projectRoot)}@${stamp}`; |
| 305 | } |
| 306 | |
| 307 | /** |
| 308 | * A digest of what resolution reads from one config file: a go.mod's module |
no test coverage detected