Skip to content

Commit 0a4b889

Browse files
committed
Fix member resolve with variant characters
1 parent 0e6d428 commit 0a4b889

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

src/api/IBMiContent.ts

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -778,22 +778,24 @@ export default class IBMiContent {
778778
}
779779

780780
async memberResolve(member: string, files: QsysPath[]): Promise<IBMiMember | undefined> {
781+
const inAmerican = (s: string) => { return this.ibmi.sysNameInAmerican(s) };
782+
const inLocal = (s: string) => { return this.ibmi.sysNameInLocal(s) };
783+
781784
// Escape names for shell
782-
const pathList = this.ibmi.upperCaseName(
783-
files
784-
.map(file => {
785-
const asp = file.asp || this.config.sourceASP;
786-
if (asp && asp.length > 0) {
787-
return [
788-
Tools.qualifyPath(file.library, file.name, member, asp, true),
789-
Tools.qualifyPath(file.library, file.name, member, undefined, true)
790-
].join(` `);
791-
} else {
792-
return Tools.qualifyPath(file.library, file.name, member, undefined, true);
793-
}
794-
})
795-
.join(` `)
796-
);
785+
const pathList = files
786+
.map(file => {
787+
const asp = file.asp || this.config.sourceASP;
788+
if (asp && asp.length > 0) {
789+
return [
790+
Tools.qualifyPath(inAmerican(file.library), inAmerican(file.name), inAmerican(member), asp, true),
791+
Tools.qualifyPath(inAmerican(file.library), inAmerican(file.name), inAmerican(member), undefined, true)
792+
].join(` `);
793+
} else {
794+
return Tools.qualifyPath(inAmerican(file.library), inAmerican(file.name), inAmerican(member), undefined, true);
795+
}
796+
})
797+
.join(` `)
798+
.toUpperCase();
797799

798800
const command = `for f in ${pathList}; do if [ -f $f ]; then echo $f; break; fi; done`;
799801
const result = await this.ibmi.sendCommand({
@@ -805,7 +807,7 @@ export default class IBMiContent {
805807

806808
if (firstMost) {
807809
try {
808-
const simplePath = Tools.unqualifyPath(firstMost);
810+
const simplePath = inLocal(Tools.unqualifyPath(firstMost));
809811

810812
// This can error if the path format is wrong for some reason.
811813
// Not that this would ever happen, but better to be safe than sorry

0 commit comments

Comments
 (0)