codefori / codefori/vscode-rpgle

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

Open
#322 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
57
Forks
35
Avg merge
2d 3h
Merged PRs (30d)
1

Description

**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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.