ClangToolsUtils: Add isVFSOverlaySupported()

Remove ClangToolRunner::supportsVFSOverlay().
Move check for modified document and vfsOverlay into
runner creator method, as it's called in the same cycle just
before the runner is about to be started.

Change-Id: I7a5df71bfa73c350862e4c7f9eae49773b6206b7
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Jarek Kobus
2023-01-11 20:15:33 +01:00
parent 5dec97ea41
commit 64b9728a68
6 changed files with 31 additions and 42 deletions

View File

@@ -200,6 +200,19 @@ FilePath toolFallbackExecutable(ClangToolType tool)
return findValidExecutable({toolShippedExecutable(tool), fallback});
}
bool isVFSOverlaySupported(const FilePath &executable)
{
static QMap<FilePath, bool> vfsCapabilities;
auto it = vfsCapabilities.find(executable);
if (it == vfsCapabilities.end()) {
QtcProcess p;
p.setCommand({executable, {"--help"}});
p.runBlocking();
it = vfsCapabilities.insert(executable, p.allOutput().contains("vfsoverlay"));
}
return it.value();
}
static void addBuiltinConfigs(ClangDiagnosticConfigsModel &model)
{
model.appendOrUpdate(builtinConfig());