Skip to content

Commit f4b44d9

Browse files
committed
refactor: simplify getLabel logic in PackageRootNode
1 parent 39b10c7 commit f4b44d9

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/views/packageRootNode.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,8 @@ export class PackageRootNode extends DataNode {
2121
}
2222

2323
public getLabel(): string {
24-
if (this.getParent() instanceof ContainerNode) {
25-
const parent = this.getParent() as ContainerNode;
26-
if (parent.getContainerType() == ContainerType.Maven) {
27-
return `${this._nodeData.metaData?.['maven.groupId']}:${this._nodeData.metaData?.['maven.artifactId']}:${this._nodeData.metaData?.['maven.version']}`;
28-
}
24+
if (this._nodeData.metaData?.['maven.groupId']) {
25+
return `${this._nodeData.metaData?.['maven.groupId']}:${this._nodeData.metaData?.['maven.artifactId']}:${this._nodeData.metaData?.['maven.version']}`;
2926
}
3027
return this._nodeData.displayName ?? this._nodeData.name;
3128
}

0 commit comments

Comments
 (0)