Skip to content

Commit 18d805b

Browse files
authored
Fix showing of CSP files in project folders (#1408)
1 parent 5255bac commit 18d805b

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/commands/project.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ async function pickAdditions(
469469
if (items.findIndex((pi) => pi.Type == "DIR" && pi.Name == app) == -1) {
470470
return {
471471
label: "$(folder) " + app,
472-
fullName: app,
472+
fullName: i,
473473
buttons: [
474474
{
475475
iconPath: new vscode.ThemeIcon("chevron-right"),
@@ -536,7 +536,7 @@ async function pickAdditions(
536536
if (category == "CLS" || !item.fullName.includes("/")) {
537537
tmpParams = [item.fullName + "/*.cls", sys, gen, project, item.fullName + ".", item.fullName + "."];
538538
} else {
539-
tmpParams = [item.fullName + "/*", sys, gen, project, item.fullName + "/"];
539+
tmpParams = [item.fullName + "/*", sys, gen, project, item.fullName.slice(1) + "/"];
540540
}
541541
if (category == undefined) {
542542
if (item.fullName.includes("/")) {
@@ -749,7 +749,11 @@ export async function modifyProject(
749749

750750
let newAdd: ProjectItem[] = [];
751751
let newRemove: ProjectItem[] = [];
752-
const addResult = addProjectItem(type == "CLS" || type == "PKG" ? pick.slice(0, -4) : pick, type, items);
752+
const addResult = addProjectItem(
753+
type == "CLS" || type == "PKG" ? pick.slice(0, -4) : type == "CSP" || type == "DIR" ? pick.slice(1) : pick,
754+
type,
755+
items
756+
);
753757
newAdd = addResult.add;
754758
newRemove = addResult.remove;
755759

src/utils/FileProviderUtil.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export async function projectContentsFromUri(uri: vscode.Uri, overrideFlat?: boo
9393
`SELECT DISTINCT BY (${nameCol}) ${nameCol} ` +
9494
"Name, Type FROM %Studio.Project_ProjectItemsList(?,1) AS pil WHERE " +
9595
"(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 " +
96-
"(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 " +
96+
"(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 " +
9797
"(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 " +
9898
"$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 " +
9999
"(Type = 'CLS' AND EXISTS (SELECT dcd.ID FROM %Dictionary.ClassDefinition AS dcd WHERE dcd.ID = pil.Name)) OR " +

0 commit comments

Comments
 (0)