Skip to content

Commit

Permalink
Fix showing of CSP files in project folders (#1408)
Browse files Browse the repository at this point in the history
  • Loading branch information
isc-bsaviano authored Jul 24, 2024
1 parent 5255bac commit 18d805b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions src/commands/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -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("/")) {
Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/utils/FileProviderUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 " +
Expand Down

0 comments on commit 18d805b

Please sign in to comment.