From 084db7a1f0a8b981ed06ca2fdc6bf855522e5939 Mon Sep 17 00:00:00 2001 From: jan Frode Haaskjold Date: Wed, 15 Jan 2025 15:59:33 +0100 Subject: [PATCH 1/3] fix: filtering objects when filter contains both source files and other object types --- src/api/IBMiContent.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/api/IBMiContent.ts b/src/api/IBMiContent.ts index 8455e5f1c..6e3380567 100644 --- a/src/api/IBMiContent.ts +++ b/src/api/IBMiContent.ts @@ -496,7 +496,6 @@ export default class IBMiContent { const nameFilter = parseFilter(filters.object, filters.filterType); const objectFilter = filters.object && (nameFilter.noFilter || singleEntry) && filters.object !== `*` ? this.ibmi.upperCaseName(filters.object) : undefined; - const typeFilter = filters.types && filters.types.length > 1 ? (t: string) => filters.types?.includes(t) : undefined; const type = filters.types && filters.types.length === 1 && filters.types[0] !== '*' ? filters.types[0] : '*ALL'; const sourceFilesOnly = filters.types && filters.types.length === 1 && filters.types.includes(`*SRCPF`); @@ -615,7 +614,9 @@ export default class IBMiContent { owner: object.OWNER, asp: this.ibmi.aspInfo[Number(object.IASP_NUMBER)] } as IBMiObject)) - .filter(object => !typeFilter || typeFilter(object.type)) + .filter(object => !filters.types || filters.types.length < 1 + || (filters.types.includes('*SRCPF') && object.sourceFile) + || filters.types.includes(object.type)) .filter(object => objectFilter || nameFilter.test(object.name)) .sort((a, b) => { if (a.library.localeCompare(b.library) != 0) { From f95789c997c15e9ed1101de0ecc9eda10c1812ac Mon Sep 17 00:00:00 2001 From: jan Frode Haaskjold Date: Wed, 15 Jan 2025 16:03:48 +0100 Subject: [PATCH 2/3] fix: updated contributing.md --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c072167f3..b532e4f5d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -59,3 +59,4 @@ Thanks so much to everyone [who has contributed](https://github.com/codefori/vsc * [@NicolasSchindler](https://github.com/NicolasSchindler) * [@marcin-ogon](https://github.com/marcin-ogon) * [@Detrytus59](https://github.com/Detrytus59) +* [@janfh](https://github.com/janfh) From a9c2a69c51d15ab3f692d23a97c23ab9ab166a80 Mon Sep 17 00:00:00 2001 From: jan Frode Haaskjold Date: Wed, 22 Jan 2025 16:17:53 +0100 Subject: [PATCH 3/3] fix: object type *ALL in filter --- src/api/IBMiContent.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/api/IBMiContent.ts b/src/api/IBMiContent.ts index 1c43bc233..dbd3e14f1 100644 --- a/src/api/IBMiContent.ts +++ b/src/api/IBMiContent.ts @@ -615,6 +615,7 @@ export default class IBMiContent { asp: this.ibmi.aspInfo[Number(object.IASP_NUMBER)] } as IBMiObject)) .filter(object => !filters.types || filters.types.length < 1 + || filters.types.includes('*ALL') || (filters.types.includes('*SRCPF') && object.sourceFile) || filters.types.includes(object.type)) .filter(object => objectFilter || nameFilter.test(object.name))