[clangd] Fail more gracefully if QueryDriverDatabase cannot determine file type
authorNathan Ridge <zeratul976@hotmail.com>
Mon, 29 Aug 2022 08:24:24 +0000 (04:24 -0400)
committerNathan Ridge <zeratul976@hotmail.com>
Mon, 29 Aug 2022 16:59:05 +0000 (12:59 -0400)
commit9af0a142e43625cb8478b83692510a5abd39f808
tree643338eefc1356f4e931ff538e75f47d1ff3b479
parent86b22d312053f38c7ea94af49dd0e93c660ffec8
[clangd] Fail more gracefully if QueryDriverDatabase cannot determine file type

Currently, QueryDriverDatabase returns an empty compile command
if it could not determine the file type.

This failure mode is unnecessarily destructive; it's better to
just return the incoming compiler command, which is still more
likely to be useful than an empty command.

Differential Revision: https://reviews.llvm.org/D132833
clang-tools-extra/clangd/QueryDriverDatabase.cpp