================ @@ -149,27 +149,40 @@ Restarting the server will interrupt any existing debug sessions and start a new this.cleanUp(this.serverProcess); } - cleanUp(process: child_process.ChildProcessWithoutNullStreams) { + private cleanUp(process: child_process.ChildProcessWithoutNullStreams) { // If the following don't equal, then the fields have already been updated // (either a new process has started, or the fields were already cleaned // up), and so the cleanup should be skipped. if (this.serverProcess === process) { this.serverProcess = undefined; this.serverInfo = undefined; + this.serverSpawnInfo = undefined; } } - getSpawnInfo( + private async getSpawnInfo( path: string, args: string[], env: NodeJS.ProcessEnv | { [key: string]: string } | undefined, - ): string[] { + ): Promise<string[]> { return [ path, ...args, ...Object.entries(env ?? {}).map( (entry) => String(entry[0]) + "=" + String(entry[1]), ), + `(${await this.getFileModifiedTimestamp(path)})`, ]; } + + private async getFileModifiedTimestamp(file: string): Promise<string | null> { + try { + if (!(await fs.pathExists(file))) { + return null; + } + return (await fs.promises.stat(file)).mtime.toLocaleString(); + } catch (error) { + return null; + } + } ---------------- walter-erquinigo wrote:
I was wrong. What my extensions were using is https://www.npmjs.com/package/chokidar Try using that one https://github.com/llvm/llvm-project/pull/159481 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits