Skip to content

Commit

Permalink
Merge pull request #1945 from codefori/fix/quickFilter
Browse files Browse the repository at this point in the history
Fixed quick filter creation for listing libraries
  • Loading branch information
chrjorgensen authored Mar 20, 2024
2 parents a1fc8aa + 0427d12 commit c522a58
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
11 changes: 7 additions & 4 deletions src/instantiate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,15 +430,18 @@ export async function loadAllofExtension(context: vscode.ExtensionContext) {
const selectionSplit = connection!.upperCaseName(selection).split('/')
if (selectionSplit.length === 3 || selection.startsWith(`/`)) {
if (config && config.enableSQL && !selection.startsWith(`/`)) {
const lib = `${connection!.sysNameInAmerican(selectionSplit[0])}`;
const file = `${connection!.sysNameInAmerican(selectionSplit[1])}`;
const member = path.parse(`${connection!.sysNameInAmerican(selectionSplit[2])}`);
const libUS = connection!.sysNameInAmerican(selectionSplit[0]);
const fileUS = connection!.sysNameInAmerican(selectionSplit[1]);
const memberUS = path.parse(connection!.sysNameInAmerican(selectionSplit[2]));
const lib = selectionSplit[0];
const file = selectionSplit[1];
const member = path.parse(selectionSplit[2]);
member.ext = member.ext.substring(1);
const fullMember = await content!.runSQL(`
select rtrim( cast( SYSTEM_TABLE_MEMBER as char( 10 ) for bit data ) ) as MEMBER
, rtrim( coalesce( SOURCE_TYPE, '' ) ) as TYPE
from QSYS2.SYSPARTITIONSTAT
where ( SYSTEM_TABLE_SCHEMA, SYSTEM_TABLE_NAME, SYSTEM_TABLE_MEMBER ) = ( '${lib}', '${file}', '${member.name}' )
where ( SYSTEM_TABLE_SCHEMA, SYSTEM_TABLE_NAME, SYSTEM_TABLE_MEMBER ) = ( '${libUS}', '${fileUS}', '${memberUS.name}' )
limit 1
`).then((resultSet) => {
return resultSet.length !== 1 ? {} :
Expand Down
8 changes: 4 additions & 4 deletions src/views/objectBrowser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,9 @@ export function initializeObjectBrowser(context: vscode.ExtensionContext) {
const filter = {
name: `Filter ${objectFilters.length + 1}`,
filterType: 'simple',
library: `QSYS`,
object: `${parsedFilter.lib}*`,
types: [`*LIB`],
library: `${parsedFilter.lib}*`,
object: `*`,
types: [`*ALL`],
member: `*`,
memberType: `*`,
protected: false
Expand Down Expand Up @@ -1427,4 +1427,4 @@ async function deleteObject(object: IBMiObject) {
}

return deleteResult.code === 0;
}
}

0 comments on commit c522a58

Please sign in to comment.