fix(cpp): explain missing clang-tidy checks with Apple's clangd (#770)

Apple's clangd (/usr/bin/clangd, Xcode and CommandLineTools toolchains) is built without clang-tidy, so on a Mac without a managed clangd the checks from .clang-tidy never appear. When a clangd server for C, C++, Objective-C or Objective-C++ resolves to Apple's binary and the project has a .clang-tidy, show one warning per session with Install (managed LLVM clangd, which already takes precedence once installed) and Language Servers… actions. Fixes #692.
Цей коміт міститься в:
l0ng-ai authored and GitHub committed 2026-11-02 11:14:27 +08:00
1 джерело ff97d7724c
коміт e2f8e8d5bc
11 files changed
+331 -5

No files matched your search

+28
Переглянути файл
@@ -56,3 +56,31 @@ export function installMissingServerPrompts(): () => void {
void promptInstall(e.name).catch(() => {});
});
}
/** A system server that lacks a capability can be replaced by the managed tool. */
export function installServerWarningPrompts(): () => void {
const prompted = new Set<string>();
return onIdeEvent("languageServerWarning", (e) => {
const key = `lsp-warning-${e.name}-${e.installTool}`;
if (prompted.has(key)) return;
prompted.add(key);
void (async () => {
if (!useTools.getState().loaded) await refreshTools();
const tool = toolByName(e.installTool);
notifications().notify({
group: "lsp",
level: "warning",
title: e.name,
body: tx(e.message),
key,
sticky: true,
actions: [
...(tool?.canInstall
? [{ label: "Install", run: () => void installTool(e.installTool, { notificationKey: key }) }]
: []),
{ label: "Language Servers…", run: () => void executeAction("file.settings", SETTINGS_PAGE_ID) },
],
});
})();
});
}