Skip to content

Commit

Permalink
Fix for different openedPathsList setup
Browse files Browse the repository at this point in the history
  • Loading branch information
SantoJambit authored and swsnr committed Apr 9, 2021
1 parent 9b16209 commit e316b4c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ interface MaybeOpenedPathsList {
readonly workspaces?: unknown;
readonly workspaces2?: unknown;
readonly workspaces3?: unknown;
readonly entries?: unknown;
readonly files?: unknown;
readonly files2?: unknown;
}
Expand Down Expand Up @@ -416,6 +417,19 @@ const getRecentItemsFromStorage = (
}
}

const entries = openedPathsList.entries;
if (entries && Array.isArray(entries)) {
for (const item of entries) {
if (item && typeof item.folderUri === "string") {
recentItems.push(createRecentItem("workspace", item.folderUri));
} else if (item && typeof item.fileUri === "string") {
recentItems.push(createRecentItem("file", item.fileUri));
} else {
l.error(`Failed to parse recent path: ${JSON.stringify(item)}`);
}
}
}

return recentItems;
};

Expand Down

0 comments on commit e316b4c

Please sign in to comment.