Skip to content

Commit dcabaa1

Browse files
authored
feat: inherit VS Code file icons in SAS Content and Server (#1310)
1 parent 95794c6 commit dcabaa1

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

client/src/components/ContentNavigator/ContentDataProvider.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import {
1818
TabInputText,
1919
TextDocument,
2020
TextDocumentContentProvider,
21-
ThemeIcon,
2221
TreeDataProvider,
2322
TreeDragAndDropController,
2423
TreeItem,
@@ -230,6 +229,7 @@ class ContentDataProvider
230229
iconPath: this.iconPathForItem(item),
231230
id: item.uid,
232231
label: item.name,
232+
resourceUri: uri,
233233
};
234234
}
235235

@@ -698,7 +698,7 @@ class ContentDataProvider
698698

699699
private iconPathForItem(
700700
item: ContentItem,
701-
): ThemeIcon | { light: Uri; dark: Uri } {
701+
): undefined | { light: Uri; dark: Uri } {
702702
const isContainer = getIsContainer(item);
703703
let icon = "";
704704
if (isContainer) {
@@ -723,11 +723,6 @@ class ContentDataProvider
723723
icon = "folder";
724724
break;
725725
}
726-
} else {
727-
const extension = item.name.split(".").pop().toLowerCase();
728-
if (extension === "sas") {
729-
icon = "sasProgramFile";
730-
}
731726
}
732727

733728
return icon !== ""
@@ -738,7 +733,7 @@ class ContentDataProvider
738733
`icons/light/${icon}Light.svg`,
739734
),
740735
}
741-
: ThemeIcon.File;
736+
: undefined;
742737
}
743738
}
744739

client/test/components/ContentNavigator/ContentDataProvider.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {
33
DataTransferItem,
44
FileStat,
55
FileType,
6-
ThemeIcon,
76
TreeItem,
87
Uri,
98
authentication,
@@ -175,14 +174,14 @@ describe("ContentDataProvider", async function () {
175174
const treeItem = await dataProvider.getTreeItem(contentItem);
176175
const uri = contentItem.vscUri;
177176
const expectedTreeItem: TreeItem = {
178-
iconPath: ThemeIcon.File,
179177
id: "unique-id",
180178
label: "testFile",
181179
command: {
182180
command: "vscode.open",
183181
arguments: [uri],
184182
title: "Open SAS File",
185183
},
184+
resourceUri: uri,
186185
};
187186

188187
expect(treeItem).to.deep.include(expectedTreeItem);

0 commit comments

Comments
 (0)