[all-commits] [llvm/llvm-project] 989931: [clangd] Add hot-reload of compile_commands.json a...

Sam McCall via All-commits all-commits at lists.llvm.org
Fri Dec 18 02:22:28 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 98993193e9037345ad13720a62974064a5f3d953
      https://github.com/llvm/llvm-project/commit/98993193e9037345ad13720a62974064a5f3d953
  Author: Sam McCall <sam.mccall at gmail.com>
  Date:   2020-12-18 (Fri, 18 Dec 2020)

  Changed paths:
    M clang-tools-extra/clangd/ClangdLSPServer.cpp
    M clang-tools-extra/clangd/GlobalCompilationDatabase.cpp
    M clang-tools-extra/clangd/GlobalCompilationDatabase.h
    M clang-tools-extra/clangd/tool/Check.cpp
    M clang-tools-extra/clangd/unittests/GlobalCompilationDatabaseTests.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list