Skip to content

Commit

Permalink
feat: Adopt resourceUri API to the Java Project explorer (#453)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdneo committed Feb 5, 2021
1 parent 30fc493 commit dd40a30
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 17 deletions.
28 changes: 14 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"explorer"
],
"engines": {
"vscode": "^1.52.0"
"vscode": "^1.53.0"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -582,7 +582,7 @@
"@types/minimatch": "^3.0.3",
"@types/mocha": "^8.0.4",
"@types/node": "^8.10.66",
"@types/vscode": "1.52.0",
"@types/vscode": "1.53.0",
"copy-webpack-plugin": "^6.3.2",
"glob": "^7.1.6",
"gulp": "^4.0.2",
Expand Down
14 changes: 13 additions & 1 deletion src/views/dataNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import * as _ from "lodash";
import { ThemeIcon, TreeItem, TreeItemCollapsibleState, Uri } from "vscode";
import { INodeData } from "../java/nodeData";
import { INodeData, NodeKind } from "../java/nodeData";
import { Lock } from "../utils/Lock";
import { ExplorerNode } from "./explorerNode";

Expand All @@ -26,6 +26,18 @@ export abstract class DataNode extends ExplorerNode {
item.iconPath = this.iconPath;
item.command = this.command;
item.contextValue = this.computeContextValue();
if (this.uri) {
switch (this._nodeData.kind) {
case NodeKind.PackageRoot:
case NodeKind.Package:
case NodeKind.PrimaryType:
case NodeKind.Folder:
case NodeKind.File:
item.resourceUri = Uri.parse(this.uri);
break;
}
}

return item;
}

Expand Down

0 comments on commit dd40a30

Please sign in to comment.