-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Member resolves, IFS resolves and local includePath
support
#225
Conversation
Signed-off-by: Liam Allan <mrliamallan@live.co.uk>
Signed-off-by: Liam Allan <mrliamallan@live.co.uk>
Signed-off-by: Liam Allan <mrliamallan@live.co.uk>
Signed-off-by: Liam Allan <mrliamallan@live.co.uk>
@worksofliam I was curious and went through your code for
It seems like there's some confusion about this subject, probably because of different conventions and company standards. But IMHO we should follow the rules laid out by the RPG compiler. ➡️ |
@chrjorgensen wow, great write up!
Changes incoming over the next day or two with your suggestions. Thanks you!! |
Signed-off-by: Liam Allan <mrliamallan@live.co.uk>
@chrjorgensen Based on your feedback, the only change I made is to use The plan is to first get member resolves working, and then move onto IFS/local. |
Signed-off-by: Liam Allan <mrliamallan@live.co.uk>
Signed-off-by: Liam Allan <mrliamallan@live.co.uk>
includePath
support
Signed-off-by: Liam Allan <mrliamallan@live.co.uk>
@chrjorgensen Further updates to improve the code and allow cross file system resolves and cleaner code. I updated the PR description to reflect all new changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested by creating a library TESTPR225 and using the following RPGLE main source with /copy
and /include
statements from the documentation:
**free
/COPY MBR1
/INCLUDE SRCFIL,MBR2
/COPY TESTPR225/SRCFIL,MBR3
/INCLUDE TESTPR225/"SRC>3","MBR¬3"
/COPY /dir1/dir2/file.rpg
/COPY /dir1/dir2/file
/COPY dir1/dir2/file.rpg¬3"
/COPY "ifs file containing blanks"
/COPY 'ifs file containing blanks'
I tested the member / streamfile resolve by putting the cursor on the name and press Alt-F12
to peek the content of the include file.
I noted the following:
- The copy of
MBR1
worked fine, member found wasTESTPR225/QRPGLESRC/MBR1.RPGLE
. - The include of
SRCFIL/MBR2
worked fine, member found wasTESTPR225/SRCFIL/MBR2.RPGLE
. - The copy of
TESTPR225/SRCFIL/MBR3
worked fine, member found wasTESTPR225/SRCFIL/MBR3.RPGLE
. - The include of
TESTPR225/"SRC>3","MBR¬3"
could not be resolved. Compile found it. - The IFS copy of
/dir1/dir2/file.rpg
could not be resolved. Compile found it. - The IFS copy of
/dir1/dir2/file
could not be resolved. Compile found it. - The IFS copy of
dir1/dir2/file.rpg
could not be resolved. Compile found it. - The IFS copy of
"ifs file containing blanks"
could not be resolved. Compile found it. - The IFS copy of
'ifs file containing blanks'
could not be resolved. Compile found it. - The member resolve worked both when
TESTPR225
was the current library or in the library list (I had it as the last library in the list with a prior library also containing a source file calledSRCFIL
).
Changing the current library also didn't affect the resolve cache - I had to disconnect and reconnect to make the resolve work, after first having another current library than TESTPR225
.
Should there be some command or other way of resetting the cache? Would be nice for the user to be able to do that, when the cache has old or obsolete content... or at least it should be cleared when the current library or library list changes...
Signed-off-by: Liam Allan <mrliamallan@live.co.uk>
👋 A new build is available for this PR based on 6178f1d. |
Signed-off-by: Liam Allan <mrliamallan@live.co.uk>
👋 A new build is available for this PR based on 173bfb7. |
You can simple close and re-open the member/IFS/local file now. I will post again when the remaining items are complete. |
Great progress has been made. @chrjorgensen Back to you for another review whenever you can. |
includePath
supportincludePath
support
Signed-off-by: Liam Allan <mrliamallan@live.co.uk>
👋 A new build is available for this PR based on 7dfe7f7. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some further testing on the same test source:
❌ The copy of TESTPR225/SRCFIL,MBR3
no longer worked - your code probably thinks it's a UNIX path, when it's actually a QSYS path.
✔️ The IFS copy of /dir1/dir2/file.rpg
worked now.
❌ The IFS copy of /dir1/dir2/file
worked - partially. Could only be resolved, when exact filename existed, but no seatch for suffixes .rpgle
and .rpgleinc
is performed.
✔️ The IFS copy of dir1/dir2/file.rpg
worked now.
❌ I could not get the IFS copy of "ifs file containing blanks"
to work.
❌ I could not get the IFS copy of 'ifs file containing blanks'
to work.
You should probably also take into consideration the rules for when the compiler can't determine the filesystem specified, as described here: https://www.ibm.com/docs/en/i/7.3?topic=files-include. Then both QSYS and IFS will be searched as documented. I see that you already commented on this in the code, but it seems not implemented yet?
extension/server/src/server.ts
Outdated
|
||
} else { | ||
// Path from home directory? | ||
if (path.extname(cleanString) === ``) cleanString += `.*`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not correct - you can't just take any file with the name as specified and a random suffix.
The rules are like this for copy-files specified without extension:
If the path does not end with a suffix (for example ".txt"), the compiler will search for the file as named, and also for files with suffixes of ".rpgle" or ".rpgleinc".
So three files may be picked:
- File without suffix
- File with suffix
.rpgleinc
- File with suffix
.rpgle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to wait for 2.0.0 of vscode-ibmi to search for multiple extensions.
@worksofliam IMHO the RPG /COPY documentation is confusingly organized - the INCLUDE FILES page seems the most important. It was probably added when RPG source code was allowed in the IFS. An example that I was not really aware of:
The page above has more examples. So both QSYS and IFS filesystem are searched by the compiler unless the filename is in quotes. I won't even go into the IFS include path using |
One test still missing is |
Signed-off-by: Liam Allan <mrliamallan@live.co.uk>
👋 A new build is available for this PR based on a11c031. |
|
👋 A new build is available for this PR based on f912aed. |
@chrjorgensen I know you're about to depart for holiday, but whenever you're back... ✅ The copy of TESTPR225/SRCFIL,MBR3 no longer worked |
👋 A new build is available for this PR based on 1ccde46. |
👋 A new build is available for this PR based on 2be46c7. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@worksofliam I made a new review of the source and include statements:
- ❓ The copy of
MBR1
worked almost, member found wasTESTPR225/QRPGLESRC/MBR1.rpgleinc
- but member extension actually wasTXT
. - ❓ The include of
SRCFIL/MBR2
worked almost, member found wasTESTPR225/SRCFIL/MBR2.rpgleinc
- but member extension actually wasRPGLE
. - ❓ The copy of
TESTPR225/SRCFIL/MBR3
worked almost, member found wasTESTPR225/SRCFIL/MBR3.rpgleinc
- but member extension actually wasRPGLE
. - ✔️ The IFS copy of
/dir1/dir2/file.rpg
worked fine. - ❓ The IFS copy of
/dir1/dir2/file
only worked, when the filename wasfile
- but not withfile.rpgle
orfile.rpgleinc
. Can we include multi file search now? - ✔️ The IFS copy of
dir1/dir2/file.rpg
worked fine. - ❌ The IFS copy of
"ifs file containing blanks"
could not be resolved, even though a file namedifs file containing blanks
was put in the current working directory. - ❌ The IFS copy of
'ifs file containing blanks'
could not be resolved, even though a file namedifs file containing blanks
was put in the current working directory.
I think we're very close to having it - only minor issues except for the question of multi file search... 👍
edit from barry: added numbers to make it easier to reference
Thanks for testing @chrjorgensen! For 1, 2 & 3: Right now, when including a member we default to For 5: I tested this and it seemed to work as you described: For 7 & 8: I mentioned previously that this style of include (paths with spaces) won't be supported in this PR (a risk I am also willing to take). It looks like there is a bug in the |
👋 A new build is available for this PR based on d8f74bc. |
@worksofliam IMHO it would be better to have no extension for members - since the extension is not specified in the Instead of showing I have reviewed your PR #1482 and made a suggestion... |
👋 A new build is available for this PR based on 4920529. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@worksofliam I just did a final test: The hover is great now, 5 and 7-8 are still not working.
But we can fix this later, let's get this in now! Okay?
@chrjorgensen 5 isn't working for you? That is odd! I actually wonder if we should take a look at that together before we merge this. |
@chrjorgensen I went ahead and fixed the issue where the path name was being cut off as you discovered! Whenever you have the time, take another look with my latest commit! |
👋 A new build is available for this PR based on 4bb0894. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@worksofliam Everything is working as expected now - even test 5, which was due to a mistake on my part!
Looking good! Approved! Merge at any time! 😄
Changes
includePath
iniproj.json
.Checklist
console.log
s I added