When large projects have a lot of missing objects in the first pass of parsing Ruby files we would run into stack overflows. This happens because, when there was a missing object in a parsed Ruby file, we would recursively call #parse_remaining_files. When this happens a lot the stack would get huge.
We fix this by instead keeping a list of files that we want to retry and re-parse them in another pass. When we can no longer resolve any more files we break the loop.
Description
When large projects have a lot of missing objects in the first pass of parsing Ruby files we would run into stack overflows. This happens because, when there was a missing object in a parsed Ruby file, we would recursively call
#parse_remaining_files
. When this happens a lot the stack would get huge.We fix this by instead keeping a list of files that we want to retry and re-parse them in another pass. When we can no longer resolve any more files we break the loop.
Fixes https://github.com/lsegal/yard/issues/1375
Completed Tasks
bundle exec rake
locally (if code is attached to PR).It's difficult to write a test for this because it depended on a lot of files until it would break.
I tested this by running
yard doc
on my company's internal monolith and having it working, whereas the current release of yard wouldSystemStackError