Commit Graph

3 Commits

Author SHA1 Message Date
Ben Langmuir
e57337dca8 [index] Avoid querying main files for a non-file URL
IndexStoreDB expects a file path, so exit early if we have something
else.
2020-02-06 13:16:08 -08:00
Ben Langmuir
89f29cb864 [buildsystem] Introduce BuildSystemManager that handles main-file lookup
The build system manager will integrate with the indexer to provide
header to main file mappings, including keeping those mappings
up-to-date as `#include`s are added and removed. This allows us to
provide accurate compiler arguments for a header based on a real
translation unit. When there are no main files found, we continue to
fallback to asking the build system.

The build system manager also gives us a place to put a client-side
setting cache, since multiple headers may map to a single main file.

For now, the BuildSystemManager is only used by tests. A subsequent
commit will wire it up to the index and server.
2020-02-05 21:53:52 -08:00
Ben Langmuir
25e3574bc3 Add MainFilesProvider and MainFilesDelegate for index
Introduce types for looking up and receiving notifications about changes
to main file mappings (e.g. header.h -> foo.cpp) in terms of documents.
For now this is only exercised in the test, but the goal is to use this
to correctly lookup main files for headers during build system queries.
2020-02-05 21:53:52 -08:00