diff --git a/mlir/utils/vscode/package.json b/mlir/utils/vscode/package.json index bd550e2b6e61e..cb4a25cdaecea 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 c7b6de6322d27..0c8b575f36cde 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. }