[Mlir-commits] [mlir] 867cd50 - [mlir-LSP] Ensure existing documents are process synchronously

River Riddle llvmlistbot at llvm.org
Mon May 9 15:24:05 PDT 2022


Author: River Riddle
Date: 2022-05-09T15:23:23-07:00
New Revision: 867cd5007d1124f839fdf8c5b51442586ae7d360

URL: https://github.com/llvm/llvm-project/commit/867cd5007d1124f839fdf8c5b51442586ae7d360
DIFF: https://github.com/llvm/llvm-project/commit/867cd5007d1124f839fdf8c5b51442586ae7d360.diff

LOG: [mlir-LSP] Ensure existing documents are process synchronously

This prevents races where we accidentally launched multiple servers.

Added: 
    

Modified: 
    mlir/utils/vscode/src/mlirContext.ts

Removed: 
    


################################################################################
diff  --git a/mlir/utils/vscode/src/mlirContext.ts b/mlir/utils/vscode/src/mlirContext.ts
index 76a990c87b6c2..a8dbb229b5bd1 100644
--- a/mlir/utils/vscode/src/mlirContext.ts
+++ b/mlir/utils/vscode/src/mlirContext.ts
@@ -68,7 +68,9 @@ export class MLIRContext implements vscode.Disposable {
       }
     };
     // Process any existing documents.
-    vscode.workspace.textDocuments.forEach(startClientOnOpenDocument);
+    for (const textDoc of vscode.workspace.textDocuments) {
+      await startClientOnOpenDocument(textDoc);
+    }
 
     // Watch any new documents to spawn servers when necessary.
     this.subscriptions.push(


        


More information about the Mlir-commits mailing list