From 6f8fe529c29bf2eab64df28a2cf91f2aa930e9f3 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Thu, 3 Dec 2026 16:03:40 +0800 Subject: [PATCH] refactor(vsix): share interesting-member projection (#16280) --- src/vsix/VsixPackageParser.ts | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/src/vsix/VsixPackageParser.ts b/src/vsix/VsixPackageParser.ts index 08d5e02d497..5c46ca2f08b 100644 --- a/src/vsix/VsixPackageParser.ts +++ b/src/vsix/VsixPackageParser.ts @@ -1062,30 +1062,20 @@ export const parseVsixPackage = async ( kind = resolved.kind; classification = resolved.classification; contents[index] = { ...contents[index]!, kind }; - if (isVsixInterestingMemberKind(kind)) - interestingMembers.push({ - path: file.path, - kind, - bytes: hashed.length, - sha256: sha256Hex(hashed), - classification, - }); - } else { + } else if (modeExecutable) { // Unread members keep the executable kind their Unix mode implies, // so oversize, encrypted, or traversing helpers stay inventoried. - if (modeExecutable) { - kind = "executable"; - contents[index] = { ...contents[index]!, kind }; - } - if (isVsixInterestingMemberKind(kind)) - interestingMembers.push({ - path: file.path, - kind, - bytes: zipMemberSize(file.entry.uncompressedSize), - sha256: null, - classification: "inferred", - }); + kind = "executable"; + contents[index] = { ...contents[index]!, kind }; } + if (isVsixInterestingMemberKind(kind)) + interestingMembers.push({ + path: file.path, + kind, + bytes: hashed?.length ?? zipMemberSize(file.entry.uncompressedSize), + sha256: hashed === undefined ? null : sha256Hex(hashed), + classification, + }); kindCounts[kind] += 1; } const vsixIdentity = vsixParsed?.identity ?? null;