[Mlir-commits] [mlir] [vscode] Use which to default path (PR #83681)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sat Mar 2 08:06:20 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir

Author: wzy (Freed-Wu)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/83681.diff


2 Files Affected:

- (modified) mlir/utils/vscode/package.json (+2-1) 
- (modified) mlir/utils/vscode/src/mlirContext.ts (+2-1) 


``````````diff
diff --git a/mlir/utils/vscode/package.json b/mlir/utils/vscode/package.json
index bd550e2b6e61e2..cb4a25cdaecea3 100644
--- a/mlir/utils/vscode/package.json
+++ b/mlir/utils/vscode/package.json
@@ -48,7 +48,8 @@
     "@vscode/vsce": "^2.19.0",
     "clang-format": "^1.8.0",
     "typescript": "^4.6.4",
-    "vscode-test": "^1.3.0"
+    "vscode-test": "^1.3.0",
+    "which": "^4.0.0"
   },
   "repository": {
     "type": "git",
diff --git a/mlir/utils/vscode/src/mlirContext.ts b/mlir/utils/vscode/src/mlirContext.ts
index c7b6de6322d27f..0c8b575f36cde9 100644
--- a/mlir/utils/vscode/src/mlirContext.ts
+++ b/mlir/utils/vscode/src/mlirContext.ts
@@ -2,6 +2,7 @@ import * as fs from 'fs';
 import * as path from 'path';
 import * as vscode from 'vscode';
 import * as vscodelc from 'vscode-languageclient/node';
+import * as which from 'which';
 
 import * as config from './config';
 import * as configWatcher from './configWatcher';
@@ -334,7 +335,7 @@ export class MLIRContext implements vscode.Disposable {
       if (defaultPath === '') {
         return filePath;
       }
-      filePath = defaultPath;
+      return await which(defaultPath);
 
       // Fallthrough to try resolving the default path.
     }

``````````

</details>


https://github.com/llvm/llvm-project/pull/83681


More information about the Mlir-commits mailing list