codefori / vscode-rpgle

RPGLE language tools for VS Code
MIT License
39 stars 20 forks source link

Templates are marked as "No reference to definition." even when subfields of other data structures reference template subfields. #320

Open BotanyBayDon1 opened 1 month ago

BotanyBayDon1 commented 1 month ago

Describe the bug Templates are marked as "No reference to definition." even when subfields of other data structures reference template subfields.

To Reproduce In RPGLE, create a source member with an externally defined and qualified template data structure. Ex:

Dcl-DS tmpDS extname('TABLENAME') qualified template END-DS;

Create a separate data structure that references columns within the template to define it's subfields. Ex:

Dcl-DS dsExample qualified inz;
 Field1 like(tmpDS.Field1) inz;
 Field2 like(tmpDS.Field2) inz;
END-DS

Expected behavior

VS-Code should NOT be marking the template data structure as "No reference to definition." as clearly the template is referenced via the subfields of the dsExample data structure shown above. I realize that the data structure name (standalone without the subfield references) isn't being referenced as "tmpDS" anywhere. However I would count the template as referenced by virtue of any of the subfields in the template being referenced, and that is clearly the situation here.

Screenshots See example code given above

Environment (please complete the following information):

Additional context This is NOT a high priority IMO. It is, however, a bit of an annoyance to me as I use templates frequently.