дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-04 09:11:10 +02:00
Settings › Build, Execution, Deployment › Debugger › C/C++ gets GDB executable and LLDB DAP executable (empty: find them on PATH as before; relative paths resolve against the project), as CLion lets a toolchain use a custom GDB. The GDB version check reads the chosen binary and names it when it is older than 14. Fixes #7174
58 рядки
1.5 KiB
TypeScript
58 рядки
1.5 KiB
TypeScript
import { useId } from "react";
|
|
import { choosePath } from "@/platform/choosePath";
|
|
import { useTx } from "@/platform/i18n";
|
|
import { IconButton, Input } from "@/ui";
|
|
import { Row } from "../components/Form";
|
|
import { useSetting } from "../components/context";
|
|
import styles from "./Sdk.module.css";
|
|
|
|
interface PathFieldProps {
|
|
k: string;
|
|
placeholder: string;
|
|
title: string;
|
|
id?: string;
|
|
"aria-label"?: string;
|
|
/** Browse for a file instead of a directory. */
|
|
file?: boolean;
|
|
}
|
|
|
|
export function PathField({ k, placeholder, title, id, file, ...aria }: PathFieldProps) {
|
|
const [value, set] = useSetting<string>(k);
|
|
const tx = useTx();
|
|
return (
|
|
<span className={styles.pathRow}>
|
|
<Input
|
|
id={id}
|
|
mono
|
|
className={styles.pathInput}
|
|
value={value}
|
|
placeholder={placeholder}
|
|
onChange={(e) => set(e.target.value.trim())}
|
|
aria-label={aria["aria-label"]}
|
|
/>
|
|
<IconButton
|
|
icon="folder-open"
|
|
size="small"
|
|
title="Browse…"
|
|
onClick={async () => {
|
|
const p = await choosePath({ directory: !file, title: tx(title), defaultPath: value || undefined });
|
|
if (p) set(p);
|
|
}}
|
|
/>
|
|
</span>
|
|
);
|
|
}
|
|
|
|
export function PathInput({
|
|
label,
|
|
hint,
|
|
...field
|
|
}: Omit<PathFieldProps, "id" | "aria-label"> & { label: string; hint?: string }) {
|
|
const id = useId();
|
|
return (
|
|
<Row label={label} htmlFor={id} hint={hint}>
|
|
<PathField {...field} id={id} />
|
|
</Row>
|
|
);
|
|
}
|