дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-08 19:02:17 +02:00
Adds knip (pnpm knip, knip.ts covering src, scripts, perf and e2e) and runs it in the CI frontend job. Removes what it reported: the unused codemirror and @types/dompurify dependencies, exports and test hooks used nowhere (AppLogo, Tooltip, barrel re-exports, duplicate default exports of lazily loaded settings pages), the unused iterateAll helper, and the zh entry for a deleted notification. rustfmt (used by lint-staged) is ignored as a toolchain binary. Co-authored-by: jaw52 <[email protected]>
31 рядки
1.0 KiB
TypeScript
31 рядки
1.0 KiB
TypeScript
/**
|
||
* Settings › Debugger › Breakpoints › "Allow placing breakpoints in any file":
|
||
* when off, new line breakpoints go only into files of languages that have a
|
||
* debug adapter (`languages/*.toml` `[debugger]`).
|
||
*/
|
||
import { commands, isTauri } from "@/platform/ipc";
|
||
import { workflowSettings } from "@/platform/workflowSettings";
|
||
|
||
let debuggable: Set<string> | null = null;
|
||
let loading = false;
|
||
|
||
function load() {
|
||
if (debuggable || loading || !isTauri()) return;
|
||
loading = true;
|
||
commands
|
||
.languages()
|
||
.then((langs) => {
|
||
debuggable = new Set(langs.filter((l) => l.debuggable).map((l) => l.id));
|
||
})
|
||
.catch(() => undefined)
|
||
.finally(() => (loading = false));
|
||
}
|
||
|
||
/** Whether a new breakpoint may be placed in a file of `language`. */
|
||
export function canPlaceBreakpoint(language: string): boolean {
|
||
if (workflowSettings().debugger.breakpointsAnyFile) return true;
|
||
load();
|
||
// Until the language list is known, don't block anything.
|
||
return !debuggable || debuggable.has(language);
|
||
}
|