Currently, all include insertions are directed to the main file. However,
Transformer rules can specify alternative destinations for include
insertions. This patch fixes the code to associate the include with the correct
file.
This patch was tested manually. The clang tidy unit test framework does not
support testing changes to header files. Given that this is a bug fix for a live
bug, the patch relies on manual testing rather than blocking on upgrading the
unit test framework.
Can this be a macro file id? I'd suggest to add tests (probably for checks using this functionality) with a few nested includes and fixes in normal code, code in macros declared and expanded in different files, locations in macro bodies, macro arguments, and some tricky cases like fix pointing to a pasted token.