Порівняти коміти

..
Автор SHA1 Повідомлення Дата
l0ng-ai 98b6d6fc48 Merge remote-tracking branch 'origin/main' into HEAD 2026-11-22 21:55:22 +08:00
l0ng-ai cf5b4e39c9 Merge origin/main into integrate/git-idea-parity-main 2026-11-22 21:37:54 +08:00
l0ng-ai a6bc39651f fix(vcs): order the Git Log commit menu by workflow and add commit list shortcuts
- Lead with Copy Revision Number, Create Patch and Cherry-Pick, then checkout and
  comparison, reset and revert, history editing, branches, and navigation.
- Hide one-commit edits and disable the other single-commit actions for a
  multiple selection; offer Squash Commits only for several commits.
- Show icons only for copy, patch, cherry-pick and reset rows.
- Rename Browse to Show Repository at Revision.
- Toggle commit bookmarks from the commit list with F3 / Alt+F3 (F11 / Ctrl+F11
  on Windows) instead of menu rows, and drop Copy Commit Message.
- Bind F2, the New Branch shortcut and Left / Right in the focused commit list.
- Stub file contents in the staged Commit and Push test so the TODO check can
  read them.
2026-11-22 16:09:04 +08:00
l0ng-ai d638440e94 fix(vcs): tighten Git workflow edge cases
- Treat every Git spelling of a true core.autocrlf as converting CRLF on commit.
- Explain a pending saved-changes marker in Smart Checkout and keep the original
  error when rolling back a failed save also fails.
- Leave repositories with unmerged paths out of Stash Silently.
- Report a branch held by a missing worktree in Update Selected.
- Set the executable bit on disk in the binary conflict test so it passes with
  core.fileMode enabled.
- Resolve new clippy lints.
2026-11-22 15:11:43 +08:00
l0ng-ai 73e0b8e3e6 feat(vcs): improve Git workflows
Improve commit and staging, branch and remote operations, merge and rebase,
Git Log and signing, worktrees, stash and shelf, patch application, and clone
settings. Add a one-click stash for tracked changes across Git roots and open a
worktree branch's GitHub review from its context menu.
2026-11-22 14:38:51 +08:00
31 змінених файлів з 60 додано та 541 видалено

No files matched your search

Створено
+4 -4
Переглянути файл
@@ -2361,9 +2361,9 @@ checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b"
[[package]]
name = "form_urlencoded"
version = "1.2.3"
version = "1.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "afa489199eaffb1211795df1c6236ce1ad0d41a6fa45250add73e3b02420f06e"
checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf"
dependencies = [
"percent-encoding",
]
@@ -10827,9 +10827,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
[[package]]
name = "url"
version = "2.5.9"
version = "2.5.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f00cd2407bb42c0ef17be88d4cf020f5cceffd121665bac9b8b9493a369b3b1a"
checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed"
dependencies = [
"form_urlencoded",
"idna",
+2 -15
Переглянути файл
@@ -49,7 +49,7 @@ async fn external_maven_link_persists_reloads_and_unlink_keeps_files() {
assert_eq!(b.pom, canonical);
assert_eq!(dunce::canonicalize(root.join(&b.dir)).unwrap(), sibling);
assert_eq!(host.project("main").unwrap().content_roots(), vec![sibling.clone()]);
assert_eq!(import_roots(&host, |roots| !roots.is_empty()).await, vec![sibling.clone()]);
assert_eq!(host.project("main").unwrap().lsp.jdtls_import_roots(), vec![sibling.clone()]);
let reloaded = ops::build::build_model(&host, "main").await.unwrap();
assert_eq!(
@@ -63,26 +63,13 @@ async fn external_maven_link_persists_reloads_and_unlink_keeps_files() {
let gone = ops::build::build_model(&host, "main").await.unwrap();
assert!(gone.maven.unwrap().projects.iter().all(|p| p.artifact_id != "b"));
assert!(host.project("main").unwrap().content_roots().is_empty());
assert!(import_roots(&host, |roots| roots.is_empty()).await.is_empty());
assert!(host.project("main").unwrap().lsp.jdtls_import_roots().is_empty());
assert_eq!(saved(), Vec::<String>::new());
assert_eq!(std::fs::read_to_string(root.join("pom.xml")).unwrap(), a_pom);
assert_eq!(std::fs::read_to_string(sibling.join("pom.xml")).unwrap(), b_pom);
host.shutdown().await;
}
/// The language server's Maven import roots once `ready` holds: a settings change refreshes them in
/// the background.
async fn import_roots(host: &Host, ready: impl Fn(&[std::path::PathBuf]) -> bool) -> Vec<std::path::PathBuf> {
for _ in 0..200 {
let roots = host.project("main").unwrap().lsp.jdtls_import_roots();
if ready(&roots) {
return roots;
}
tokio::time::sleep(std::time::Duration::from_millis(25)).await;
}
host.project("main").unwrap().lsp.jdtls_import_roots()
}
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn reactor_module_beside_a_trusted_project_is_a_content_root_until_removed() {
let temp = tempfile::tempdir().unwrap();
-83
Переглянути файл
@@ -200,86 +200,3 @@ test("Evaluate keeps a multiline expression and its result visible in a short di
await expect(field).toHaveValue(expression);
await expect(field).toBeFocused();
});
test("Variables keeps evaluation, watches and expression history together in a narrow dock", async ({
workbench: page,
}) => {
await page.setViewportSize({ width: 720, height: 620 });
await stubDesktop(page);
await page.evaluate(async (session) => {
const handlers = window.__ipc.handlers;
handlers.debug_capabilities = () => ({});
handlers.debug_completions = () => [];
handlers.debug_scopes = () => [];
handlers.debug_evaluate_in = () => ({
name: "result",
value: "42",
typeName: "int",
variablesReference: 0,
evaluateName: null,
});
const statePath = "/src/features/debugger/state.ts";
const historyPath = "/src/features/debugger/ui/expressionHistory.ts";
const projectPath = "/src/platform/project.ts";
const servicesPath = "/src/workbench/contributions.ts";
const layoutPath = "/src/workbench/toolwindows/store.ts";
const { adoptSession } = await import(/* @vite-ignore */ statePath);
const { pushHistory } = await import(/* @vite-ignore */ historyPath);
const { useProject } = await import(/* @vite-ignore */ projectPath);
const { toolWindowService } = await import(/* @vite-ignore */ servicesPath);
const { moveToolWindow, setToolWindowSize } = await import(/* @vite-ignore */ layoutPath);
const settings = useProject.getState().settings;
useProject.setState({
settings: { ...settings, editor: { ...settings?.editor, fontFamily: "Consolas", fontSize: 18 } },
});
pushHistory("evaluate", "order.total + tax");
pushHistory("evaluate", "if ready:\n settle()");
adoptSession(session, { name: "Checkout", adapter: "debugpy", status: "paused", selectedFrame: 11 });
moveToolWindow("debug", "right");
setToolWindowSize("right", 285);
toolWindowService().show("debug", true);
}, SESSION);
const debug = page.getByRole("region", { name: "Debug", exact: true });
const variables = debug.getByRole("tab", { name: "Variables", exact: true });
if (await variables.isVisible()) await variables.click();
const field = debug.getByRole("textbox", { name: "Evaluate expression", exact: true });
const historyButton = debug.getByRole("button", { name: "History", exact: true });
const watch = debug.getByRole("button", { name: "Add to Watches", exact: true });
await expect(field).toBeVisible();
await expect(historyButton).toBeVisible();
await expect(field).toHaveAttribute("placeholder", "Evaluate expression");
await expect(field).toHaveCSS("font-family", /^"?Consolas"?,/);
await expect(field).toHaveCSS("font-size", "13px");
expect((await field.boundingBox())!.width).toBeGreaterThan(100);
expect((await watch.boundingBox())!.x).toBeLessThan((await historyButton.boundingBox())!.x);
await historyButton.click();
const menu = page.getByRole("menu", { name: "Expression history", exact: true });
await expect(menu.getByRole("menuitem")).toHaveText(["order.total + tax"]);
const row = (await field.locator("..").boundingBox())!;
const popup = (await menu.locator("..").boundingBox())!;
expect(popup.x).toBeCloseTo(row.x, 0);
expect(popup.width).toBeCloseTo(row.width, 0);
await page.keyboard.press("Escape");
await expect(menu).toBeHidden();
await expect(historyButton).toBeFocused();
await historyButton.press("Enter");
await menu.getByRole("menuitem", { name: "order.total + tax" }).press("Enter");
await expect(field).toBeFocused();
await expect(field).toHaveValue("order.total + tax");
await field.press("Enter");
await expect
.poll(() => ipcCalls(page, "debug_evaluate_in"))
.toContainEqual(expect.objectContaining({ expression: "order.total + tax", context: "repl" }));
await field.fill("order.total");
await watch.click();
await expect(field).toHaveValue("");
await expect
.poll(() => ipcCalls(page, "debug_evaluate_in"))
.toContainEqual(expect.objectContaining({ expression: "order.total", context: "watch" }));
await historyButton.click();
await expect(menu.getByRole("menuitem")).toHaveText(["order.total", "order.total + tax"]);
});
-44
Переглянути файл
@@ -1,44 +0,0 @@
import { expect, test } from "./fixtures";
test("line numbers stay smaller than the code and leave room for a breakpoint", async ({ workbench: page }) => {
await page.evaluate(async () => {
const backendPath = "/src/editor/core/backend.ts";
const servicesPath = "/src/workbench/contributions.ts";
const { docBackend } = await import(/* @vite-ignore */ backendPath);
const { editorService } = await import(/* @vite-ignore */ servicesPath);
const path = "/dev/acme-api/queue.ts";
docBackend().files.set(path, ["const queue = [1, 2, 3];", "queue.push(4);", "console.log(queue);"].join("\n"));
await editorService().openFile(path);
});
const editor = page.locator('.cm-editor[data-language="TypeScript"]');
const content = editor.locator(".cm-content");
const number = editor.locator(".cm-lineNumbers").getByText("2", { exact: true });
await expect(number).toBeVisible();
const size = await content.evaluate((element) => Number.parseFloat(getComputedStyle(element).fontSize));
await expect(number).toHaveCSS("font-size", `${size - 1}px`);
await expect(number).toHaveCSS("padding-inline-start", "4px");
await expect(number).toHaveCSS("padding-inline-end", "4px");
const column = editor.locator(".cm-lineNumbers");
expect((await column.boundingBox())!.width).toBeCloseTo(24, 0);
await number.click();
const markerSize = () => number.evaluate((element) => getComputedStyle(element, "::before").width);
await expect.poll(markerSize).toBe(`${size}px`);
await expect
.poll(() =>
number.evaluate((element) => {
const marker = getComputedStyle(element, "::before");
return element.clientWidth - Number.parseFloat(marker.left) - Number.parseFloat(marker.width) / 2;
}),
)
.toBeCloseTo(4, 0);
await content.press("Alt+Shift+.");
await expect(content).toHaveCSS("font-size", `${size + 1}px`);
await expect(number).toHaveCSS("font-size", `${size}px`);
await expect(number).toHaveCSS(
"line-height",
await content.evaluate((element) => getComputedStyle(element).lineHeight),
);
await expect.poll(markerSize).toBe(`${size + 1}px`);
});
-60
Переглянути файл
@@ -1,66 +1,6 @@
import type { Locator } from "@playwright/test";
import { expect, stubDesktop, test } from "./fixtures";
test("Find Usages places read and write filters with the other actions", async ({ workbench: page }) => {
await stubDesktop(page);
await page.evaluate(async () => {
const modulePath = "/src/features/code-insight/usages.ts";
const { useUsagesPopup } = await import(modulePath);
const path = "/dev/acme-api/src/SettlementService.ts";
const lines = ["const current = settlement;", "settlement = next;"];
window.__ipc.handlers.fs_read_text = () => lines.join("\n");
useUsagesPopup.setState({
open: true,
anchor: { x: 100, y: 150 },
symbol: "settlement",
loading: false,
scope: "project",
groups: [
{
path,
usages: lines.map((text, line) => ({
path,
line,
col: text.indexOf("settlement"),
endCol: text.indexOf("settlement") + "settlement".length,
text,
access: line === 0 ? "read" : "write",
})),
},
],
});
});
const popup = page.getByRole("dialog", { name: "Usages", exact: true });
const read = { name: "Show read accesses", exact: true };
const write = { name: "Show write accesses", exact: true };
const actions = popup.getByRole("button", { name: "Show Preview", exact: true }).locator("..");
await expect(popup.getByRole("option")).toHaveCount(2);
for (const width of [1120, 540]) {
await page.setViewportSize({ width, height: 640 });
expect(await actions.getByRole("toolbar", { name: "Usage access filters", exact: true }).count()).toBe(1);
await expect(actions.getByRole("button", read)).toBeInViewport({ ratio: 1 });
await expect(actions.getByRole("button", write)).toBeInViewport({ ratio: 1 });
}
await actions.getByRole("button", write).click();
await expect(popup.getByRole("option")).toHaveCount(1);
await popup.getByRole("button", { name: /Open in Find Window/ }).click();
const view = page.getByRole("region", { name: "Find Usages", exact: true });
const toolbar = view.getByRole("toolbar", { name: "Usages actions", exact: true });
const readButton = toolbar.getByRole("button", read);
const writeButton = toolbar.getByRole("button", write);
await expect(readButton).toHaveAttribute("aria-pressed", "true");
await expect(writeButton).toHaveAttribute("aria-pressed", "false");
const a = (await readButton.boundingBox())!;
const b = (await writeButton.boundingBox())!;
expect(a.x).toBeCloseTo(b.x, 0);
expect(b.y).toBeGreaterThanOrEqual(a.y + a.height);
await expect(view.locator("mark")).toHaveCount(1);
await writeButton.click();
await expect(view.locator("mark")).toHaveCount(2);
});
async function checkSize(icon: Locator, size = 16) {
const dimensions = await icon.evaluate((node) => {
const style = getComputedStyle(node);
-85
Переглянути файл
@@ -444,88 +444,3 @@ test("the Paths filter replaces the repository filter and can be cleared from ov
await picker.getByRole("button", { name: "OK" }).click();
await expect(firstCommit.getByText("Commit 1", { exact: true })).toBeVisible();
});
test("the Git Log path tree resizes and keeps selected paths reachable in a short window", async ({
workbench: page,
}) => {
await page.setViewportSize({ width: 1000, height: 720 });
const longName = "reconcile-invoices-and-export-the-complete-quarterly-settlement-audit.ts";
await page.evaluate(async (longName) => {
const logPath = "/src/features/vcs/logStore.ts";
const optionsPath = "/src/features/vcs/logOptions.ts";
const { setLogFilters } = await import(/* @vite-ignore */ logPath);
const { setLogOptions } = await import(/* @vite-ignore */ optionsPath);
const root = "/dev/acme-api";
const selected = Array.from({ length: 9 }, (_, i) => `entry-${i + 1}.ts`);
const entry = (name: string, kind: "dir" | "file") => ({
name,
path: `${root}/${name}`,
kind,
size: 0,
mtimeMs: 0,
});
window.__ipc.handlers.fs_read_dir = ({ path }) =>
path === root
? [entry("src", "dir"), entry(longName, "file"), ...selected.map((name) => entry(name, "file"))]
: [];
setLogOptions({ showBranches: false, showDetails: false });
setLogFilters({ paths: selected.map((name) => `${root}/${name}`) });
}, longName);
const toolbar = page.getByRole("toolbar", { name: "Log filters" });
const openTree = async () => {
await toolbar.getByRole("button", { name: "More Filters" }).click();
await page.getByRole("menuitem", { name: /^Paths:/ }).click();
await page.getByRole("menuitem", { name: "Select in Tree…" }).click();
};
await openTree();
const dialog = page.getByRole("dialog", { name: "Filter by Paths" });
const tree = dialog.getByRole("tree", { name: "Files and folders" });
const resize = dialog.locator('[class*="_resizeGrip_"]');
await expect(tree).toBeVisible();
await expect(resize).toBeVisible();
await tree.getByRole("treeitem", { name: "acme-api", exact: true }).locator("[data-tree-toggle]").click();
const folder = tree.getByRole("checkbox", { name: "src", exact: true });
const file = tree.getByRole("checkbox", { name: longName, exact: true });
await expect(folder.locator("xpath=ancestor::label").locator("svg")).toHaveCount(1);
const title = file.locator("xpath=ancestor::label").getByTitle(longName);
await expect(title).toHaveCSS("font-size", "13px");
await expect(title).toHaveCSS("text-overflow", "ellipsis");
const originalTreeHeight = (await tree.boundingBox())!.height;
const grip = (await resize.boundingBox())!;
const x = grip.x + grip.width / 2;
const y = grip.y + grip.height / 2;
await page.mouse.move(x, y);
await page.mouse.down();
await page.mouse.move(x + 30, y + 65, { steps: 5 });
await page.mouse.up();
await expect.poll(async () => (await tree.boundingBox())!.height).toBeGreaterThan(originalTreeHeight + 40);
await dialog.getByRole("button", { name: "Cancel" }).click();
await page.setViewportSize({ width: 420, height: 325 });
await openTree();
await tree.getByRole("treeitem", { name: "acme-api", exact: true }).locator("[data-tree-toggle]").click();
const selected = dialog.getByRole("group", { name: "Selected paths" });
await expect(selected).toBeVisible();
await expect.poll(() => selected.evaluate((node) => node.scrollHeight - node.clientHeight)).toBeGreaterThan(1);
await expect
.poll(() => dialog.locator("[data-dialog-body]").evaluate((node) => node.scrollHeight - node.clientHeight))
.toBeLessThanOrEqual(1);
await expect.poll(() => title.evaluate((node) => node.scrollWidth - node.clientWidth)).toBeGreaterThan(1);
const removed = selected.getByRole("checkbox", { name: "acme-api/entry-9.ts", exact: true });
await removed.click();
await expect(removed).toHaveCount(0);
await file.check();
await expect(selected.getByRole("checkbox", { name: `acme-api/${longName}`, exact: true })).toBeChecked();
await expect(dialog.getByRole("button", { name: "OK" })).toBeInViewport({ ratio: 1 });
await dialog.getByRole("button", { name: "OK" }).click();
await expect(dialog).toBeHidden();
const applied = await page.evaluate(async () => {
const path = "/src/features/vcs/logStore.ts";
const { useGitLog } = await import(/* @vite-ignore */ path);
return useGitLog.getState().filters.paths;
});
expect(applied).toContain(`/dev/acme-api/${longName}`);
expect(applied).not.toContain("/dev/acme-api/entry-9.ts");
});
-2
Переглянути файл
@@ -89,8 +89,6 @@ test("Sticky Lines follows editor text, line numbers and the viewport below Find
expect(pinnedGutter!.width).toBeCloseTo(liveGutter!.width, 0);
expect(await codeStart(text)).toBeCloseTo(liveX, 0);
await expect(sticky).toHaveCSS("font-size", "16px");
await expect(sticky.locator(".cm-openidea-stickyNumber").first()).toHaveCSS("font-size", "15px");
await expect(editor.locator(".cm-lineNumbers .cm-gutterElement").first()).toHaveCSS("font-size", "15px");
await expect(sticky).toHaveCSS("tab-size", await content.evaluate((element) => getComputedStyle(element).tabSize));
await scroller.evaluate((element) => {
element.scrollLeft = 32;
+2 -2
Переглянути файл
@@ -26,12 +26,12 @@ describe("the Language smoke workflow", () => {
const { files, problems } = await smokeInputs(repo, workflow);
expect(problems).toEqual([]);
expect(describeUnselected(await unselected(workflow, [...files.keys()]), files)).toBe("");
}, 20000);
});
it("runs every language when a crate the smoke runs changes", async () => {
const crates = rustSmokeInputs(repo);
expect(describeUnselected(await unselected(workflow, [...crates.keys()]), crates)).toBe("");
}, 20000);
});
});
const dirs: string[] = [];
+1
Переглянути файл
@@ -41,6 +41,7 @@ import { rootOfPath } from "@/platform/projectRoots";
import { isVirtualUri } from "@/platform/virtualDocs";
import { cornerInset } from "@/editor/core/cm/cornerInset";
export { iconAreaSource, mapLineStart, type IconAreaSource } from "@/editor/core/cm/iconArea";
export { disambiguateTitles } from "@/editor/core/model/tabTitles";
export {
invalidateNavigationProviders,
navigationEpoch,
+2 -3
Переглянути файл
@@ -255,9 +255,8 @@ export const openideaTheme = EditorView.theme({
userSelect: "none",
},
".cm-lineNumbers .cm-gutterElement, .cm-openidea-stickyNumber": {
minWidth: "calc(max(16px, var(--openidea-editor-font-size, var(--fs-code))) + var(--space-2))",
paddingInline: "var(--space-1)",
fontSize: "max(1px, calc(var(--openidea-editor-font-size, var(--fs-code)) - 1px))",
minWidth: "32px",
padding: "0 8px 0 10px",
textAlign: "right",
fontVariantNumeric: "tabular-nums",
},
+2 -4
Переглянути файл
@@ -2,8 +2,6 @@
display: flex;
align-items: center;
gap: var(--space-0-5);
flex: none;
}
.vertical {
flex-direction: column;
padding: 3px 6px;
flex-shrink: 0;
}
+2 -9
Переглянути файл
@@ -1,6 +1,4 @@
import { create } from "zustand";
import clsx from "clsx";
import { useTx } from "@/platform/i18n";
import { IconButton } from "@/ui";
import type { Usage } from "./usages";
import styles from "./UsageAccessFilter.module.css";
@@ -47,16 +45,11 @@ export function filterUsageAccess(items: readonly Usage[], options: UsageAccessO
export const supportsUsageAccess = (items: readonly Usage[]) => items.some((u) => u.access && u.access !== "unknown");
export function UsageAccessFilter({ items, vertical }: { items: readonly Usage[]; vertical?: boolean }) {
const tx = useTx();
export function UsageAccessFilter({ items }: { items: readonly Usage[] }) {
const options = useUsageAccessOptions();
if (!supportsUsageAccess(items)) return null;
return (
<div
className={clsx(styles.toolbar, vertical && styles.vertical)}
role={vertical ? "group" : "toolbar"}
aria-label={tx("Usage access filters")}
>
<div className={styles.toolbar} role="toolbar" aria-label="Usage access filters">
<IconButton
icon="show-read-access"
size="small"
+2 -3
Переглянути файл
@@ -8,8 +8,7 @@ import { create } from "zustand";
import clsx from "clsx";
import { EditorState, StateEffect, StateField } from "@codemirror/state";
import { Decoration, EditorView } from "@codemirror/view";
import { codePreviewExtensions } from "@/editor/api";
import { disambiguateTitles } from "@/editor/core/model/tabTitles";
import { codePreviewExtensions, disambiguateTitles } from "@/editor/api";
import { basename } from "@/platform/project";
import { shortcutLabel } from "@/platform/keymap";
import { Icon, IconButton, List, Popup, Select, Spinner, fileIconName, listNavigate } from "@/ui";
@@ -176,7 +175,6 @@ function UsagesPopupInner() {
</span>
</span>
<div className={styles.actions}>
<UsageAccessFilter items={all} />
{scope && (
<Select<UsageScope>
variant="ghost"
@@ -214,6 +212,7 @@ function UsagesPopupInner() {
</button>
</div>
</div>
<UsageAccessFilter items={all} />
{note && (
<div className={styles.note} data-testid="usages-note">
{note}
+1 -3
Переглянути файл
@@ -17,11 +17,8 @@
gap: var(--space-0-5);
padding: 4px 0;
border-right: 1px solid var(--border);
overflow-y: auto;
scrollbar-width: none;
}
.toolbarSep {
flex: none;
width: 16px;
height: 1px;
margin: 3px 0;
@@ -69,6 +66,7 @@
flex: 1;
min-height: 0;
}
.body > [role="toolbar"],
.body > .summary {
flex: 0 0 auto;
}
+1 -1
Переглянути файл
@@ -284,11 +284,11 @@ export function UsagesView() {
<IconButton icon="arrow-up" action="navigate.prevOccurrence" size="small" iconSize={16} />
<IconButton icon="arrow-down" action="navigate.nextOccurrence" size="small" iconSize={16} />
<span className={styles.toolbarSep} />
<UsageAccessFilter items={allUsages} vertical />
<IconButton icon="expand-all" title="Expand All" size="small" iconSize={16} onClick={() => setAll(false)} />
<IconButton icon="collapse-all" title="Collapse All" size="small" iconSize={16} onClick={() => setAll(true)} />
</div>
<div className={styles.body} onKeyDown={onKeyDown}>
<UsageAccessFilter items={allUsages} />
{!search.loading && !search.error && search.scope === "project" && (
<div className={styles.summary}>
<T>Usages in Project Files</T>
+1 -1
Переглянути файл
@@ -53,7 +53,7 @@ it("shows a plain count for unclassified searches after a Java access mode was s
});
const view = render(<UsagesView />);
expect(screen.getByText("2 results")).toBeInTheDocument();
expect(screen.queryByRole("group", { name: "Usage access filters" })).toBeNull();
expect(screen.queryByRole("toolbar", { name: "Usage access filters" })).toBeNull();
view.unmount();
useUsageAccessOptions.setState({ read: true, write: true });
useUsages.setState({ tabs: [], active: null });
+1 -1
Переглянути файл
@@ -293,7 +293,7 @@ describe("debug tool window", () => {
expect(screen.getByRole("tab", { name: "Threads & Variables" })).toBeTruthy();
expect(screen.getByRole("tab", { name: "Console" })).toBeTruthy();
expect(screen.getByRole("option", { selected: true })).toHaveTextContent("main:12, main.py");
expect(screen.getByRole("textbox", { name: "Evaluate expression" })).toBeTruthy();
expect(screen.getByPlaceholderText("Evaluate expression (↩) or add a watch (⇧⌘↩)")).toBeTruthy();
expect(await screen.findByText("{int}")).toBeTruthy();
expect(screen.getByText("'hi'")).toBeTruthy();
// A multi-line rendering stays on its row.
+5 -3
Переглянути файл
@@ -1,4 +1,7 @@
/* The marker replaces the number and shares its trailing edge. */
/*
* Line-number gutter element class; the marker is a pseudo-element that, like
* IDEA, replaces the number (centred on the element's content box).
*/
.bp {
position: relative;
color: transparent !important;
@@ -7,9 +10,8 @@
.bp::before {
content: "";
position: absolute;
left: calc(100% - var(--space-1) - 0.5em);
left: calc(50% + 1px);
top: 50%;
font-size: var(--openidea-editor-font-size, var(--fs-code));
width: 1em;
height: 1em;
transform: translate(-50%, -50%);
+2 -16
Переглянути файл
@@ -210,28 +210,14 @@
}
.evalField {
min-height: var(--h-field);
height: 30px;
flex: none;
display: flex;
align-items: center;
gap: var(--space-1);
padding: var(--space-0-5) var(--space-1) var(--space-0-5) var(--space-2);
background: var(--bg-input);
padding: 0 4px 0 12px;
border-bottom: 1px solid var(--border);
}
.evalField:focus-within {
box-shadow: inset 0 -1px var(--focus-ring);
}
.evalField > button {
flex: none;
}
.evalField .evalInput {
padding: 0;
}
.evalHistory {
padding-block: var(--space-1);
overflow-x: hidden;
}
.repl {
height: 28px;
+10 -81
Переглянути файл
@@ -3,10 +3,6 @@ import { writeClipboardText } from "@/platform/clipboard";
import { useEffect, useLayoutEffect, useMemo, useRef, useState, type KeyboardEvent, type ReactNode } from "react";
import clsx from "clsx";
import { executeAction } from "@/platform/actions";
import { editorPrefs } from "@/platform/editorSettings";
import { monoFontFamily } from "@/platform/fonts";
import { isImeKey } from "@/platform/ime";
import { formatBinding, hostBinding } from "@/platform/keymap";
import { basename, useProject } from "@/platform/project";
import { call, commands, isTauri, type Scope, type Variable } from "@/platform/ipc";
import {
@@ -15,8 +11,6 @@ import {
IconButton,
Kbd,
Menu,
MenuList,
Popup,
Select,
SplitGroup,
SplitHandle,
@@ -60,7 +54,6 @@ import { MemoryView } from "../memory/MemoryView";
import { DebugConsole } from "./DebugConsole";
import { VariablesView, type VarRoot } from "./VariablesView";
import { useExpressionCompletion } from "./ExpressionCompletion";
import { pushHistory, readHistory } from "./expressionHistory";
import { sortVariables } from "../values";
import { workflowSettings } from "@/platform/workflowSettings";
import { useToolWindowShown } from "@/workbench/contributions";
@@ -562,12 +555,9 @@ function VariablesPane({ session }: { session: DebugSession }) {
const watches = useDebug((s) => s.watches);
const stopSeq = useDebug((s) => s.stopSeq);
const variablesEpoch = useDebug((s) => s.variablesEpoch);
const settings = useProject((s) => s.settings);
const [expression, setExpression] = useState("");
const evalField = useRef<HTMLInputElement>(null);
const evalRow = useRef<HTMLDivElement>(null);
const completion = useExpressionCompletion(evalField, expression, setExpression, session);
const [history, setHistory] = useState<{ sessionId: number; stopSeq: number; entries: string[] } | null>(null);
const [lastEval, setLastEval] = useState<EvalRow | null>(null);
const [scopeData, setScopeData] = useState<{ frame: number | null; scopes: Scope[]; locals: Variable[] }>({
frame: null,
@@ -580,8 +570,6 @@ function VariablesPane({ session }: { session: DebugSession }) {
rows: [],
});
const frame = session.status === "paused" ? session.selectedFrame : null;
const historyOpen = frame != null && history?.sessionId === session.id && history.stopSeq === stopSeq;
const editor = settings?.editor;
const live = liveWatchesApply(session);
// A hidden tool window stays mounted: its watches must not go on running in the page.
const liveWatches = useLiveWatches(session, watches, useToolWindowShown());
@@ -688,7 +676,6 @@ function VariablesPane({ session }: { session: DebugSession }) {
const run = async () => {
const e = expression.trim();
if (!e) return;
pushHistory("evaluate", e);
try {
setLastEval({
expression: e,
@@ -700,32 +687,12 @@ function VariablesPane({ session }: { session: DebugSession }) {
}
};
const addExpressionWatch = () => {
const e = expression.trim();
if (!e) return;
pushHistory("evaluate", e);
addWatch(e);
setExpression("");
};
const recall = (text: string) => {
setExpression(text);
requestAnimationFrame(() => {
evalField.current?.focus();
evalField.current?.setSelectionRange(text.length, text.length);
});
};
return (
<div className={styles.variables}>
<div ref={evalRow} className={styles.evalField}>
<div className={styles.evalField}>
<input
ref={evalField}
className={styles.evalInput}
style={{
fontFamily: monoFontFamily(editor?.fontFamily, editorPrefs(settings).fallbackFont, "var(--font-mono)"),
fontSize: editor?.fontSize ? `min(var(--fs-ui), ${editor.fontSize}px)` : undefined,
}}
value={expression}
onChange={(e) => {
setExpression(e.target.value);
@@ -733,16 +700,17 @@ function VariablesPane({ session }: { session: DebugSession }) {
}}
onBlur={completion.close}
onKeyDown={(e) => {
if (isImeKey(e.nativeEvent) || completion.onKeyDown(e)) return;
if (completion.onKeyDown(e)) return;
if (e.key === "Enter" && (e.metaKey || e.ctrlKey) && e.shiftKey) {
e.preventDefault();
addExpressionWatch();
addWatch(expression);
setExpression("");
} else if (e.key === "Enter") {
e.preventDefault();
void run();
}
}}
placeholder={tx("Evaluate expression")}
placeholder={frame != null ? "Evaluate expression (↩) or add a watch (⇧⌘↩)" : "Evaluate expression"}
aria-label={tx("Evaluate expression")}
spellCheck={false}
autoComplete="off"
@@ -752,55 +720,16 @@ function VariablesPane({ session }: { session: DebugSession }) {
<IconButton
icon="plus"
title="Add to Watches"
shortcut={formatBinding(hostBinding("Meta+Shift+Enter"))}
shortcut="⇧⌘↩"
size="small"
iconSize={16}
disabled={!expression.trim()}
onClick={addExpressionWatch}
/>
<IconButton
icon="chevron-down"
title="History"
size="small"
aria-haspopup="menu"
aria-expanded={historyOpen}
disabled={frame == null}
onClick={() =>
setHistory(
historyOpen
? null
: {
sessionId: session.id,
stopSeq,
entries: readHistory("evaluate")
.filter((entry) => !/[\r\n]/.test(entry))
.slice(0, 20),
},
)
}
onClick={() => {
addWatch(expression);
setExpression("");
}}
/>
</div>
<Popup
open={historyOpen}
onClose={() => setHistory(null)}
anchor={evalRow}
placement="bottom-start"
matchWidth
role="presentation"
autoFocus={false}
className={styles.evalHistory}
>
<MenuList
aria-label={tx("Expression history")}
iconColumn={false}
onDone={() => setHistory(null)}
items={
history?.entries.length
? history.entries.map((entry) => ({ label: entry, verbatim: true, run: () => recall(entry) }))
: [{ label: "No history", disabled: true }]
}
/>
</Popup>
{frame == null && !watches.length && !lastEval ? (
<div className={styles.note}>
{session.status === "terminated"
-70
Переглянути файл
@@ -1,70 +0,0 @@
.chooser > [data-dialog-body] {
display: flex;
overflow: hidden;
}
.content {
display: flex;
flex: 1;
flex-direction: column;
min-width: 0;
min-height: 0;
gap: var(--space-2);
padding: var(--space-2) var(--space-4) 0;
font-size: var(--fs-ui);
}
.tree {
flex: 1;
min-height: 0;
border: 1px solid var(--border);
border-radius: var(--radius-small);
background: var(--bg-input);
overflow: hidden;
}
.choice {
flex: 1;
min-width: 0;
}
.entry {
display: flex;
align-items: center;
gap: var(--space-1);
min-width: 0;
}
.entry svg {
flex: none;
}
.path {
display: block;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.selected {
display: flex;
flex-direction: column;
flex: 0 1 auto;
min-height: 0;
max-height: min(96px, 33%);
padding-inline: var(--space-2);
overflow: auto;
}
.selected .choice {
flex: none;
min-height: var(--h-list-row);
}
.error {
max-height: 25%;
overflow: auto;
overflow-wrap: anywhere;
color: var(--danger);
}
+14 -49
Переглянути файл
@@ -1,5 +1,5 @@
import { useState } from "react";
import { Checkbox, Dialog, Icon, SearchField, Tree, fileIconName } from "@/ui";
import { Checkbox, Dialog, SearchField, Tree } from "@/ui";
import { projectFs } from "@/features/project-tree/fs";
import { openDialog } from "./dialogs";
import { dirName, relTo, stripSlash } from "./model";
@@ -7,7 +7,6 @@ import { repoName, repoOf } from "./store";
import { call, commands } from "@/platform/ipc";
import { tx } from "@/platform/i18n";
import { ipcPath, isSameOrInside } from "@/platform/paths";
import styles from "./PathFilterDialog.module.css";
interface PathNode {
path: string;
@@ -168,21 +167,15 @@ function PathFilterDialog({
<Dialog
open
title="Filter by Paths"
className={styles.chooser}
width={432}
initialSize={{ w: 432, h: 392 }}
resizable="both"
minWidth={300}
minHeight={220}
width={560}
onClose={() => onDone(null)}
buttons={[
{ label: "OK", role: "default", onClick: () => onDone([...checked]) },
{ label: "Cancel", role: "cancel" },
]}
>
<div className={styles.content}>
<div style={{ height: 320 }}>
<Tree<PathNode>
className={styles.tree}
roots={nodes}
getKey={(n) => n.path}
getLabel={(n) => n.name}
@@ -190,49 +183,21 @@ function PathFilterDialog({
isExpandable={(n) => n.directory}
loadChildren={load}
renderNode={(n) => (
<Checkbox
className={styles.choice}
label={
<span className={styles.entry}>
<Icon name={n.directory ? "folder" : fileIconName(n.name, n.path)} size={16} />
<span className={styles.path} title={n.name}>
{n.name}
</span>
</span>
}
checked={checked.has(n.path)}
onChange={(on) => toggle(n.path, on)}
/>
<Checkbox label={n.name} checked={checked.has(n.path)} onChange={(on) => toggle(n.path, on)} />
)}
aria-label="Files and folders"
/>
{checked.size > 0 && (
<div className={styles.selected} role="group" aria-label={tx("Selected paths")}>
{[...checked].map((path) => {
const root = roots.includes(path) ? path : repoOf(path, roots);
const label = root ? (path === root ? repoName(root) : `${repoName(root)}/${relTo(root, path)}`) : path;
return (
<Checkbox
key={path}
className={styles.choice}
label={
<span className={styles.path} title={label}>
{label}
</span>
}
checked
onChange={(on) => toggle(path, on)}
/>
);
})}
</div>
)}
{error && (
<div className={styles.error} role="alert">
{error}
</div>
)}
</div>
{checked.size > 0 && (
<div style={{ maxHeight: 100, overflow: "auto" }} aria-label="Selected paths">
{[...checked].map((path) => {
const root = roots.includes(path) ? path : repoOf(path, roots);
const label = root ? (path === root ? repoName(root) : `${repoName(root)}/${relTo(root, path)}`) : path;
return <Checkbox key={path} label={label} checked onChange={(on) => toggle(path, on)} />;
})}
</div>
)}
{error && <div role="alert">{error}</div>}
</Dialog>
);
}
-2
Переглянути файл
@@ -837,7 +837,6 @@
"Unknown error": "Unknown error",
"Retry Loading Conversation": "Retry Loading Conversation",
"No conversation history": "No conversation history",
"No history": "No history",
"Loading the conversation timed out. Try again.": "Loading the conversation timed out. Try again.",
"Couldn't load the conversation: {0}": "Couldn't load the conversation: {0}",
"Astro Language Server": "Astro Language Server",
@@ -1578,7 +1577,6 @@
"Read the project's resolved Maven and Gradle dependencies": "Read the project's resolved Maven and Gradle dependencies",
"Resolved Dependencies": "Resolved Dependencies",
"Usages of {symbol}": "Usages of {symbol}",
"Usage access filters": "Usage access filters",
"Read the clipboard's text and images when you run one of its commands": "Read the clipboard's text and images when you run one of its commands",
"Output: {channel}": "Output: {channel}",
"You can close this tab.": "You can close this tab.",
+1
Переглянути файл
@@ -782,6 +782,7 @@
"Evaluate": "Evaluar",
"Evaluate Expression…": "Evaluar expresión…",
"Evaluate expression": "Evaluar expresión",
"Evaluate expression (↩) or add a watch (⇧⌘↩)": "Evaluar expresión (↩) o agregar una expresión de inspección (⇧⌘↩)",
"Evaluate in the debug console": "Evaluar en la consola de depuración",
"Evaluation result": "Resultado de la evaluación",
"Everything is up to date": "Todo está actualizado",
+1
Переглянути файл
@@ -719,6 +719,7 @@
"Evaluate": "Évaluer",
"Evaluate Expression…": "Évaluer l'expression…",
"Evaluate expression": "Évaluer l'expression",
"Evaluate expression (↩) or add a watch (⇧⌘↩)": "Évaluer l'expression (↩) ou ajouter une expression surveillée (⇧⌘↩)",
"Evaluate in the debug console": "Évaluer dans la console de débogage",
"Evaluation result": "Résultat de l'évaluation",
"Everything is up to date": "Tout est à jour",
+1
Переглянути файл
@@ -818,6 +818,7 @@
"Evaluate": "평가",
"Evaluate Expression…": "표현식 평가…",
"Evaluate expression": "표현식 평가",
"Evaluate expression (↩) or add a watch (⇧⌘↩)": "표현식 평가(↩) 또는 watch 추가(⇧⌘↩)",
"Evaluate in the debug console": "디버그 콘솔에서 평가",
"Evaluation result": "평가 결과",
"Everything is up to date": "모두 최신 상태입니다",
+1
Переглянути файл
@@ -774,6 +774,7 @@
"Evaluate": "Oblicz/Ewaluuj",
"Evaluate Expression…": "Oblicz wyrażenie…",
"Evaluate expression": "Oblicz wyrażenie",
"Evaluate expression (↩) or add a watch (⇧⌘↩)": "Oblicz wyrażenie (↩) lub dodaj do obserwowanych (⇧⌘↩)",
"Evaluate in the debug console": "Oblicz w konsoli debugowania",
"Evaluation result": "Wynik obliczenia",
"Everything is up to date": "Wszystko jest aktualne",
+1
Переглянути файл
@@ -774,6 +774,7 @@
"Evaluate": "Avaliar",
"Evaluate Expression…": "Avaliar expressão…",
"Evaluate expression": "Avaliar expressão",
"Evaluate expression (↩) or add a watch (⇧⌘↩)": "Avaliar expressão (↩) ou adicionar inspeção (⇧⌘↩)",
"Evaluate in the debug console": "Avaliar no console de depuração",
"Evaluation result": "Resultado da avaliação",
"Everything is up to date": "Tudo está atualizado",
+1
Переглянути файл
@@ -3570,6 +3570,7 @@
"Evaluate": "Değerlendir",
"Evaluate Expression…": "İfadeyi Değerlendir…",
"Evaluate expression": "İfadeyi değerlendir",
"Evaluate expression (↩) or add a watch (⇧⌘↩)": "İfadeyi değerlendir (↩) veya izleme ekle (⇧⌘↩)",
"Evaluate in the debug console": "Hata ayıklama konsolunda değerlendir",
"Evaluation result": "Değerlendirme sonucu",
"Everything is up to date": "Her şey güncel",
+1
Переглянути файл
@@ -1438,6 +1438,7 @@
"Evaluate": "計算",
"Evaluate Expression…": "計算表示式…",
"Evaluate expression": "計算表示式",
"Evaluate expression (↩) or add a watch (⇧⌘↩)": "計算表示式 (↩) 或新增監視 (⇧⌘↩)",
"Evaluate in the debug console": "在偵錯主控台中計算",
"Evaluation result": "計算結果",
"Everything is up to date": "一切都是最新的",
+1
Переглянути файл
@@ -1777,6 +1777,7 @@
"Evaluate": "计算",
"Evaluate Expression…": "计算表达式…",
"Evaluate expression": "计算表达式",
"Evaluate expression (↩) or add a watch (⇧⌘↩)": "计算表达式 (↩) 或添加监视 (⇧⌘↩)",
"Evaluate in the debug console": "在调试控制台中计算",
"Evaluation result": "计算结果",
"Everything is up to date": "一切都是最新的",