Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions client/src/components/ContentNavigator/ContentDataProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
TabInputText,
TextDocument,
TextDocumentContentProvider,
ThemeIcon,
TreeDataProvider,
TreeDragAndDropController,
TreeItem,
Expand Down Expand Up @@ -230,6 +229,7 @@ class ContentDataProvider
iconPath: this.iconPathForItem(item),
id: item.uid,
label: item.name,
resourceUri: uri,
};
}

Expand Down Expand Up @@ -698,7 +698,7 @@ class ContentDataProvider

private iconPathForItem(
item: ContentItem,
): ThemeIcon | { light: Uri; dark: Uri } {
): undefined | { light: Uri; dark: Uri } {
const isContainer = getIsContainer(item);
let icon = "";
if (isContainer) {
Expand All @@ -723,11 +723,6 @@ class ContentDataProvider
icon = "folder";
break;
}
} else {
const extension = item.name.split(".").pop().toLowerCase();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I understanding correctly? By removing this case, we return undefined, and package.json basically dictates the icon for .sas extension files, right? (looking at

"icon": {
"dark": "icons/dark/sasProgramFileDark.svg",
"light": "icons/light/sasProgramFileLight.svg"
},
)

If this is accurate, this LGTM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes correct

if (extension === "sas") {
icon = "sasProgramFile";
}
}

return icon !== ""
Expand All @@ -738,7 +733,7 @@ class ContentDataProvider
`icons/light/${icon}Light.svg`,
),
}
: ThemeIcon.File;
: undefined;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
DataTransferItem,
FileStat,
FileType,
ThemeIcon,
TreeItem,
Uri,
authentication,
Expand Down Expand Up @@ -175,14 +174,14 @@ describe("ContentDataProvider", async function () {
const treeItem = await dataProvider.getTreeItem(contentItem);
const uri = contentItem.vscUri;
const expectedTreeItem: TreeItem = {
iconPath: ThemeIcon.File,
id: "unique-id",
label: "testFile",
command: {
command: "vscode.open",
arguments: [uri],
title: "Open SAS File",
},
resourceUri: uri,
};

expect(treeItem).to.deep.include(expectedTreeItem);
Expand Down
Loading