diff --git a/src/commands/project.ts b/src/commands/project.ts index 8211f48e..673bc146 100644 --- a/src/commands/project.ts +++ b/src/commands/project.ts @@ -469,7 +469,7 @@ async function pickAdditions( if (items.findIndex((pi) => pi.Type == "DIR" && pi.Name == app) == -1) { return { label: "$(folder) " + app, - fullName: app, + fullName: i, buttons: [ { iconPath: new vscode.ThemeIcon("chevron-right"), @@ -536,7 +536,7 @@ async function pickAdditions( if (category == "CLS" || !item.fullName.includes("/")) { tmpParams = [item.fullName + "/*.cls", sys, gen, project, item.fullName + ".", item.fullName + "."]; } else { - tmpParams = [item.fullName + "/*", sys, gen, project, item.fullName + "/"]; + tmpParams = [item.fullName + "/*", sys, gen, project, item.fullName.slice(1) + "/"]; } if (category == undefined) { if (item.fullName.includes("/")) { @@ -749,7 +749,11 @@ export async function modifyProject( let newAdd: ProjectItem[] = []; let newRemove: ProjectItem[] = []; - const addResult = addProjectItem(type == "CLS" || type == "PKG" ? pick.slice(0, -4) : pick, type, items); + const addResult = addProjectItem( + type == "CLS" || type == "PKG" ? pick.slice(0, -4) : type == "CSP" || type == "DIR" ? pick.slice(1) : pick, + type, + items + ); newAdd = addResult.add; newRemove = addResult.remove; diff --git a/src/utils/FileProviderUtil.ts b/src/utils/FileProviderUtil.ts index e4bad5ce..3cb4d194 100644 --- a/src/utils/FileProviderUtil.ts +++ b/src/utils/FileProviderUtil.ts @@ -93,7 +93,7 @@ export async function projectContentsFromUri(uri: vscode.Uri, overrideFlat?: boo `SELECT DISTINCT BY (${nameCol}) ${nameCol} ` + "Name, Type FROM %Studio.Project_ProjectItemsList(?,1) AS pil WHERE " + "(Type = 'MAC' AND EXISTS (SELECT sod.Size FROM %Library.RoutineMgr_StudioOpenDialog('*.mac,*.int,*.inc,*.bas,*.mvi',1,1,1,1,0,1) AS sod WHERE pil.Name = sod.Name)) OR " + - "(Type = 'CSP' AND EXISTS (SELECT sod.Size FROM %Library.RoutineMgr_StudioOpenDialog('*.cspall',1,1,1,1,0,1) AS sod WHERE pil.Name = sod.Name)) OR " + + "(Type = 'CSP' AND EXISTS (SELECT sod.Size FROM %Library.RoutineMgr_StudioOpenDialog('*.cspall',1,1,1,1,0,1) AS sod WHERE '/'||pil.Name = sod.Name)) OR " + "(Type NOT IN ('CLS','PKG','MAC','CSP','DIR','GBL') AND EXISTS (SELECT sod.Size FROM %Library.RoutineMgr_StudioOpenDialog('*.other',1,1,1,1,0,1) AS sod WHERE " + "$PIECE(sod.Name,'.',1,$LENGTH(sod.Name,'.')-1) = $PIECE(pil.Name,'.',1,$LENGTH(pil.Name,'.')-1) AND UPPER($PIECE(sod.Name,'.',$LENGTH(sod.Name,'.'))) = $PIECE(pil.Name,'.',$LENGTH(pil.Name,'.')))) OR " + "(Type = 'CLS' AND EXISTS (SELECT dcd.ID FROM %Dictionary.ClassDefinition AS dcd WHERE dcd.ID = pil.Name)) OR " +