[clangd] Fix clang tidy provider when multiple config files exist in directory tree
authorNathan James <n.james93@hotmail.co.uk>
Fri, 12 Feb 2021 16:55:44 +0000 (16:55 +0000)
committerNathan James <n.james93@hotmail.co.uk>
Fri, 12 Feb 2021 16:55:46 +0000 (16:55 +0000)
commitba3ea9c60f0f259f0ccc47e47daf8253a5885531
tree5f959c0886ae37563e1035c9142913ea9bb5510f
parentfb4d8fe807016fed221263d9a406e3856c8dfa4c
[clangd] Fix clang tidy provider when multiple config files exist in directory tree

Currently Clang tidy provider searches from the root directory up to the target directory, this is the opposite of how clang-tidy searches for config files.
The result of this is .clang-tidy files are ignored in any subdirectory of a directory containing a .clang-tidy file.

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D96204
clang-tools-extra/clangd/TidyProvider.cpp
clang-tools-extra/clangd/unittests/CMakeLists.txt
clang-tools-extra/clangd/unittests/TidyProviderTests.cpp [new file with mode: 0644]