Skip to content

Commit a7d6e69

Browse files
authored
Merge pull request #1960 from codefori/fix/downloadMemberParameters
Use interfaces instead of classes for type checking
2 parents ec37969 + 14c40ad commit a7d6e69

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/views/objectBrowser.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -792,18 +792,18 @@ export function initializeObjectBrowser(context: vscode.ExtensionContext) {
792792

793793
}),
794794

795-
vscode.commands.registerCommand(`code-for-ibmi.downloadMemberAsFile`, async (node: BrowserItem, nodes?: BrowserItem[]) => {
795+
vscode.commands.registerCommand(`code-for-ibmi.downloadMemberAsFile`, async (node: ObjectItem | MemberItem, nodes?: (ObjectItem | MemberItem)[]) => {
796796
const contentApi = getContent();
797797
const connection = getConnection();
798798
const config = getConfig();
799799

800800
//Gather all the members
801801
const members: IBMiMember[] = [];
802802
for (const item of (nodes || [node])) {
803-
if (item instanceof ObjectBrowserSourcePhysicalFileItem) {
803+
if ("object" in item) {
804804
members.push(...await contentApi.getMemberList({ library: item.object.library, sourceFile: item.object.name }));
805805
}
806-
else if (item instanceof ObjectBrowserMemberItem) {
806+
else if ("member" in item) {
807807
members.push(item.member);
808808
}
809809
}

0 commit comments

Comments
 (0)