-
Notifications
You must be signed in to change notification settings - Fork 21
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
Outline missing for struct fields defined via copybook #328
Comments
This is intended behaviour. The outline view only shows explicit definitions in the current source as other languages do. |
Thanks for the quick response! So if you define a template data structure in a copybook (like GlobalStruct in my original example) I wouldn't want to see it in an outline including the copybook.
|
Yep, that is correct. Perhaps there is a bug, and since you provided a test case, we should create one. I will do that now and get back to you. |
I have to apologize, seems I've been blinded by the "mighty RDI" this time. That means you were right all along - the extension works as intended and this would be an enhancement (which is still tempting as we're used to RDI). |
@EVLSDE No problem. It would make sense to see the children members of the struct in the file - I will see about trying it out. |
Describe the bug
Defining an external data structure in a copybook and copying it inside another rpg source via likeds leads to the outline not being correctly filled in the main source.
To Reproduce
Let's define an external data structure in a copybook.
Now use a /copy statement inside another rpg source.
Define a data structure inside the rpg source which uses the externally described data structure from your copybook via likeds.
In the copybook outline, the external data structure gets extended and you can see the fields. In the main outline, you'll only see the local struct but without fields. Completion items and linting errors ("no reference" for fields) get shown correctly, but the outline is missing.
RPG source:
**free
ctl-opt main(Main);
/copy 'QCPYLESRC/somecopybook.rpgle'
dcl-proc Main;
dcl-pi *n;
end-pi;
dcl-ds SomeStruct likeds(GlobalStruct) inz;
end-proc;
Copy source:
**free
// data structure for file SomeFile
dcl-ds GlobalStruct extname('SOMEFILE') qualified template;
end-ds;
Expected behavior
The outline should show the same fields in both sources if you just use a likeds.
Screenshots
See example code given above
Environment
Additional context
In documentSymbols.ts, when structs are being extended, the path of a subItem is filtered against the currentPath. While the line number of the subItem is correctly set in the main source, the path is still pointing to the copybook.
Similar to #325, the issue seems to be the parser.js while fetching local definitions in expandDs.
After cloning the subItems, I should simply have added newItem.position.path = ds.position.path
The text was updated successfully, but these errors were encountered: