This issue may occur between files that have references to the same symbols, for example a header file and dependent source file.
The core issue is that RTags automatically reindexes files upon saving, and it does not consider any unsaved files when doing so. RTags instead uses the last saved versions of all files.
This issue has been mitigated by the following algorithm:
Attempt to suspend the RTags file watch before saving a file when other unsaved files are present. The suspend attempt may fail because VS Code imposes a time limit on this operation.
If the file was suspended successfully, then resume the file watch after the file has been saved, and manually reindex it.
If the suspend attempt failed, then insert a delay before reindexing the file, so that the automatic reindexing will be triggered first, and then the manual reindexing will override it.
This issue may occur between files that have references to the same symbols, for example a header file and dependent source file.
The core issue is that RTags automatically reindexes files upon saving, and it does not consider any unsaved files when doing so. RTags instead uses the last saved versions of all files.