Skip to content
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

Linter marks program main procedure as unreferenced if ctl-opt is in copybook #322

Open
EVLSDE opened this issue Sep 9, 2024 · 1 comment

Comments

@EVLSDE
Copy link

EVLSDE commented Sep 9, 2024

Describe the bug
If you use a copybook for your control statements and include the main() statement, a program using this copybook will have its correctly defined main procedure marked as "No reference to definition.".

To Reproduce
Let's say you want to use a standard name for the main procedure of your programs, e.g. "Main".
You define a copybook (e.g. "qcpylesrc/cpypgm_h.rpgle", which includes the following statement:
ctl-opt main(Main);

You include the copybook in your program source and define the main procedure:

/copy 'qcpylesrc/cpypgm_h.rpgle'

dcl-proc Main;

Then the main procedure will be marked as "no reference to definition" by the linter.
If you replace the /copy in the program source with its contents, the same warning disappears.

Expected behavior
The linter should not be marking the procedure as "No reference to definition.", because the ctl-opt statement clearly takes use of it.

Screenshots
See example code given above

Environment:

  • Extension version v0.26.8
  • IBM i OS version 7.4

Additional context
None.

@worksofliam
Copy link
Contributor

worksofliam commented Sep 16, 2024

I've been thinking about this and I'd consider this valid since the linter expects it to be in the main source and not a copybook. We likely need something else to allow this.

edit: thanks for your great bug reports btw!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants