Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vscode] Use which to default path #83681

Closed
wants to merge 1 commit into from
Closed

Conversation

Freed-Wu
Copy link

@Freed-Wu Freed-Wu commented Mar 2, 2024

Currently, https://github.com/llvm/llvm-project/pull/83681/files#diff-b8e9974ee74a344420a4884b67816686649d96126f8104be2010b8dba53aeb35L343 use **/mlir-lsp-server to search the path of mlir-lsp-server. However, after installation, the mlir-lsp-server should be in PATH (e.g., /bin:/usr/bin), we should search PATH firstly, if we cannot found, we search **/mlir-lsp-server again.

Copy link

github-actions bot commented Mar 2, 2024

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be
notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write
permissions for the repository. In which case you can instead tag reviewers by
name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review
by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate
is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

@llvmbot llvmbot added the mlir label Mar 2, 2024
@llvmbot
Copy link
Member

llvmbot commented Mar 2, 2024

@llvm/pr-subscribers-mlir

Author: wzy (Freed-Wu)

Changes

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 --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.
     }

@joker-eph
Copy link
Collaborator

Can you please provide a description with context: that is the PR title describes "what" this is changing, but the description should explain "why".

@Freed-Wu
Copy link
Author

Freed-Wu commented Mar 3, 2024

Added. 👍

@Freed-Wu
Copy link
Author

Freed-Wu commented Jan 5, 2025

Replaced by llvm/vscode-mlir#10

@Freed-Wu Freed-Wu closed this Jan 5, 2025
@Freed-Wu Freed-Wu deleted the vscode branch January 5, 2025 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants