Will be used for updating the dynamic index on updates to the open files.
Currently we collect only information coming from the preamble
AST. This has a bunch of limitations:
- Dynamic index misses important information from the body of the file, e.g. locations of definitions.
- XRefs cannot be collected at all, since we can only obtain full information for the current file (preamble is parsed with skipped function bodies, therefore not reliable).
This patch only adds the new callback, actually updating the index
will be added in a follow-up patch.
I think Ctx should be a pointer which gives us a way (passing a nullptr) to clean up the FileIndex, the same as ParsedAST below.
And I discover that we don't cleanup dynamic index when a file is being closed, is it expected or a bug?