()
| 59 | // caching within the closure's lifetime. Callers should scope this to a |
| 60 | // single detection pass — PIDs recycle and process trees change over time. |
| 61 | function makeAncestorPidLookup(): () => Promise<Set<number>> { |
| 62 | let promise: Promise<Set<number>> | null = null |
| 63 | return () => { |
| 64 | if (!promise) { |
| 65 | promise = getAncestorPidsAsync(process.ppid, 10).then( |
| 66 | pids => new Set(pids), |
| 67 | ) |
| 68 | } |
| 69 | return promise |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | type LockfileJsonContent = { |
| 74 | workspaceFolders?: string[] |
no test coverage detected