Skip to content

Conversation

@richardm90
Copy link

Problem

The Auto Fix was adding /copy statements for includes that existed in nested include files, not just the main source file.

Root cause

When parsing RPGLE files with withIncludes: true, the parser recursively processes all includes and returns them all in cache.includes. The code was processing ALL includes without checking which file they came from.

Here's an example of what this looked like in one of my converted sources with the before and after image.

Notice lines 17, 22 and 23 in the after image.

image

Solution

I've added a filter to only process includes where include.fromPath === localPath, ensuring we only fix includes that are directly in the current file.

Additional change

I also removed a rogue public keyword from bob.ts.

Signed-off-by: Richard Moulton <richard@rmsoftwareservices.co.uk>
…udes

Signed-off-by: Richard Moulton <richard@rmsoftwareservices.co.uk>
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

Successfully merging this pull request may close these issues.

1 participant