================
@@ -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:

Interesting. I used `createFileSystemWatcher` for a few extensions that are 
being shipped in the marketplace already and never got a complaint.
Can you share with me the correct link for `a bunch of reasons` and `"not 
always reliable".`? The links seem to take me to google and not actual pages 
where you got the info you mention
Also, could you share the snippet of your own local copy of 
`createFileSystemWatcher`?

What I believed so far is that `createFileSystemWatcher` is used internally by 
vscode to identify when files change, and because it's a crucial feature of the 
IDE, I assumed it was thoroughly tested in all platforms.

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

Reply via email to