HomePhabricator

[clangd] Add hot-reload of compile_commands.json and compile_flags.txt

Authored by sammccall on Dec 4 2020, 12:09 AM.

Description

[clangd] Add hot-reload of compile_commands.json and compile_flags.txt

When querying the CDB, we stat the underlying file to check it hasn't changed.
We don't do this every time, but only if we didn't check within 5 seconds.

This behavior only exists for compile_commands.json and compile_flags.txt.
The CDB plugin system doesn't expose enough information to handle others.

Slight behavior change: we now only look for build/compile_commands.json
rather than trying every CDB strategy under build subdirectories.

Differential Revision: https://reviews.llvm.org/D92663