This repository has been archived by the owner on Apr 25, 2023. It is now read-only.
bugfix: pick path under project root when possible #28
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
partially fixes #14 (addresses issue in repo reported for, but in theory does not always address issue):
so bazel (and potentially other build systems) will sometimes use what are called "virtual includes", where header files are copied to new folders, and those folders placed on the include path. then when lsif-clang indexes, it sees headers being included from a weird path under the bazel execution root instead of the actual include path, so data from those includes is dropped (and even if it were included, would be useless).
this PR updates the
mergeSymbol
method to prefer paths that do exist under the project root. in the case of the project in the linked issue, this is a complete fix as the header files are individually indexed. if the header files themselves were not entries in the compilation database, they would only ever be seen by lsif-clang as virtual includes and be therefore un-indexable. it's not clear how to resolve this issue in that case.