You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If you use copybooks with procedure prototypes inside you'll find vs code intellisense behaving strange: the list of suggestions doesn't match with your source at all.
To Reproduce
Define a copybook with a procedure prototype definition on a specific range of code lines, e.g. from line no. 10 to 12:
Now if you start typing on said lines (e.g. 10-12) in your rpg source, you won't be able to find local definitions (e.g. "ExportParameter1"), but will find parameter definitions from your copybook procedure prototype instead (e.g. "SomeParameter") - as if you were typing on the same line but in the copybook source.
If you instead start typing on another line where there's no definition (e.g. 14), you'll find the suggestions are correct.
Expected behavior
I'd expect to find the same local definitions as suggestions on every line of code in a procedure.
Screenshots
Environment
Extension version v0.26.8
IBM i OS version 7.4
Additional context
I found out that in completionItem.ts, currentProcedure is only found by comparing line numbers of definitions, but file path isn't being compared.
After I added the following code inside find() on line 34, the suggestions worked again for me: && currentPath === proc.position.path
I'm not sure if there's a reason why this check is missing but maybe you can consider this for a future fix.
The text was updated successfully, but these errors were encountered:
EVLSDE
pushed a commit
to EVLSDE/vscode-rpgle
that referenced
this issue
Sep 11, 2024
Describe the bug
If you use copybooks with procedure prototypes inside you'll find vs code intellisense behaving strange: the list of suggestions doesn't match with your source at all.
To Reproduce
Define a copybook with a procedure prototype definition on a specific range of code lines, e.g. from line no. 10 to 12:
Use a /copy statement to include the copybook and place a procedure inside, where the procedure body covers the same line number:
Now if you start typing on said lines (e.g. 10-12) in your rpg source, you won't be able to find local definitions (e.g. "ExportParameter1"), but will find parameter definitions from your copybook procedure prototype instead (e.g. "SomeParameter") - as if you were typing on the same line but in the copybook source.
If you instead start typing on another line where there's no definition (e.g. 14), you'll find the suggestions are correct.
Expected behavior
I'd expect to find the same local definitions as suggestions on every line of code in a procedure.
Screenshots
Environment
Additional context
I found out that in completionItem.ts, currentProcedure is only found by comparing line numbers of definitions, but file path isn't being compared.
After I added the following code inside find() on line 34, the suggestions worked again for me:
&& currentPath === proc.position.path
I'm not sure if there's a reason why this check is missing but maybe you can consider this for a future fix.
The text was updated successfully, but these errors were encountered: