about summary refs log tree commit diff
path: root/editors/code/src
diff options
context:
space:
mode:
authorBruno Ortiz <brunortiz11@gmail.com>2023-04-08 13:07:25 -0300
committerBruno Ortiz <brunortiz11@gmail.com>2023-05-02 10:59:31 -0300
commita3081a67742a67680f7ddef503094e62e2e68c55 (patch)
tree6fa8454e8c603deb2c714ccd2bb13706cd5e673d /editors/code/src
parent8e687f7afb156a7ad2458b7a5aa481b5d7e435d1 (diff)
downloadrust-a3081a67742a67680f7ddef503094e62e2e68c55.tar.gz
rust-a3081a67742a67680f7ddef503094e62e2e68c55.zip
Adding crate_root_path to crate_graph
Diffstat (limited to 'editors/code/src')
-rw-r--r--editors/code/src/dependencies_provider.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/editors/code/src/dependencies_provider.ts b/editors/code/src/dependencies_provider.ts
index 3edbb316814..aff5102e01f 100644
--- a/editors/code/src/dependencies_provider.ts
+++ b/editors/code/src/dependencies_provider.ts
@@ -110,9 +110,13 @@ export class Dependency extends vscode.TreeItem {
     ) {
         super(label, collapsibleState);
         this.id = this.dependencyPath.toLowerCase();
-        this.tooltip = `${this.label}-${this.version}`;
         this.description = this.version;
         this.resourceUri = vscode.Uri.file(dependencyPath);
+        if (this.version) {
+            this.tooltip = `${this.label}-${this.version}`;
+        } else {
+            this.tooltip = this.label;
+        }
     }
 }
 
@@ -124,8 +128,8 @@ export class DependencyFile extends vscode.TreeItem {
         public readonly collapsibleState: vscode.TreeItemCollapsibleState
     ) {
         super(vscode.Uri.file(dependencyPath), collapsibleState);
-        const isDir = fs.lstatSync(this.dependencyPath).isDirectory();
         this.id = this.dependencyPath.toLowerCase();
+        const isDir = fs.lstatSync(this.dependencyPath).isDirectory();
         if (!isDir) {
             this.command = { command: "vscode.open",
                 title: "Open File",