Compare commits

..
Author SHA1 Message Date
l0ng-ai 85ab17b710 feat(database): open several query consoles per data source
New › Query Console (tree context menu and the + menu) now creates another console each time, named console, console_1, console_2…, as in DataGrip. Jump to Query Console opens the console directly when there is one and lists them, with New Query Console, when there are several. Tools › Query Console keeps opening the default one.
2026-11-14 22:49:15 +08:00
7 changed files with 4 additions and 49 deletions

No files matched your search

-14
View File
@@ -172,20 +172,6 @@ test("accepting a deleted version removes the file before staging", async ({ pag
]);
});
test("a long side shows only the lines it changed against the base", async ({ page }) => {
// Edits spread over a long file make the default diff give up and mark everything between them.
const base = Array.from({ length: 2000 }, (_, i) => `"node_modules/pkg-${i}": "1.0.${i}",`);
const bump = (at: number) => lines(...base.map((l, i) => (i % 100 === at ? l.replace('"1.0.', '"2.0.') : l)));
await mountMerge(page, [lines(...base), bump(3), bump(50)]);
for (const [name, line] of [
["Your version", 3],
["Their version", 50],
] as const) {
const deleted = page.getByRole("region", { name }).locator(".cm-deletedChunk").first().locator(".cm-deletedLine");
await expect(deleted).toHaveText([base[line]!]);
}
});
test("the result starts as the base and every change waits for a decision", async ({ page }) => {
await mountMerge(page);
await expect(status(page)).toHaveText("3 changes left, 2 conflicts");
-3
View File
@@ -401,9 +401,6 @@ describe("pull request helpers", () => {
"ssh://[email protected]/o/r.git",
"ssh://[email protected]:22/o/r.git",
"git://github.com/o/r",
// GitHub's SSH-over-HTTPS host.
"ssh://[email protected]:443/o/r.git",
"[email protected]:o/r.git",
])
expect(parseGitHubRemote(url), url).toEqual({ owner: "o", name: "r" });
expect(parseGitHubRemote("https://gitlab.com/o/r.git")).toBeNull();
+2 -2
View File
@@ -413,10 +413,10 @@ export function repositoryDisplayName(
return showOwner ? `${repo.owner}/${repo.name}` : repo.name;
}
/** `owner/name` of a github.com remote URL (https, ssh or scp-like; SSH also via ssh.github.com), else null. */
/** `owner/name` of a github.com remote URL (https, ssh or scp-like), else null. */
export function parseGitHubRemote(url: string): GHRepositoryCoordinates | null {
const m =
/^(?:(?:https?:\/\/(?:[^@/]+@)?|git:\/\/)(?:www\.)?|(?:ssh:\/\/(?:[^@/]+@)?|(?:[^@/]+@)?)(?:www\.|ssh\.)?)github\.com(?::\d+(?=\/))?[:/]+([^/]+)\/([^/]+?)(?:\.git)?\/?$/i.exec(
/^(?:https?:\/\/(?:[^@/]+@)?|ssh:\/\/(?:[^@/]+@)?|git:\/\/|(?:[^@/]+@)?)(?:www\.)?github\.com(?::\d+(?=\/))?[:/]+([^/]+)\/([^/]+?)(?:\.git)?\/?$/i.exec(
url.trim(),
);
return m ? { owner: m[1]!, name: m[2]! } : null;
+1 -8
View File
@@ -15,7 +15,6 @@ import { Button, Spinner, T } from "@/ui";
import { editorService, type EditorInput } from "@/workbench/contributions";
import { blameSlot, toggleAnnotations } from "./blame";
import { languageFor, viewerBase } from "./cm";
import { ideaDiffConfig } from "./diffOptions";
import { confirmDialog } from "./dialogs";
import { focusedDiffNavigator, setFocusedDiffNavigator, type DiffNavigator } from "./diffNavigator";
import { syncMergeScroll } from "./mergeScroll";
@@ -93,10 +92,6 @@ const writeAutoApply = (on: boolean) => {
}
};
// Each side against the base is compared line by line, as in the diff viewer. The default diff
// gives up on long files and marks the whole file as one changed block.
const SIDE_DIFF = ideaDiffConfig("none", "words");
export function MergeEditor({ input }: { input: EditorInput }) {
const { path } = input.data as MergeData;
const [state, setState] = useState<{
@@ -181,9 +176,7 @@ export function MergeEditor({ input }: { input: EditorInput }) {
EditorView.updateListener.of((u) => {
if (u.selectionSet) refreshMergeActions(actionHost);
}),
state.base !== null
? unifiedMergeView({ original: state.base, mergeControls: false, gutter: true, diffConfig: SIDE_DIFF })
: [],
state.base !== null ? unifiedMergeView({ original: state.base, mergeControls: false, gutter: true }) : [],
sideControls(which, controls),
mergeStripe(which),
mergeTheme,
@@ -7,8 +7,6 @@ describe("remoteHosting", () => {
["https://github.example.com/o/r", "GitHub", "github"],
["https://gitee.com/o/r.git", "Gitee", "github"],
["[email protected]:o/r.git", "Bitbucket", "bitbucket"],
["[email protected]:team/repo.git", "Bitbucket", "bitbucket"],
["[email protected]:o/r.git", "GitHub", "github"],
["ssh://[email protected]:2222/group/sub/r.git", "GitLab", "gitlab"],
["[email protected]:group/r.git", "git.example.com", "gitlab"],
])("%s → %s", (url, name, kind) => {
@@ -45,10 +43,4 @@ describe("fileWebUrl", () => {
"https://bitbucket.org/o/r/src/main/a.py#lines-5",
);
});
it("opens a Bitbucket Cloud SSH clone on bitbucket.org, not the SSH front host (#3372)", () => {
expect(fileWebUrl("[email protected]:team/repo.git", "main", "a.py", { line: 4 })).toBe(
"https://bitbucket.org/team/repo/src/main/a.py#lines-5",
);
});
});
+1 -6
View File
@@ -7,7 +7,6 @@ import { Chunk } from "@codemirror/merge";
import type { Text } from "@codemirror/state";
import type { EditorView } from "@codemirror/view";
import { bandAt, docOffset, extent, transferY } from "./diffScroll";
import { ideaDiffConfig } from "./diffOptions";
export type MergePane = "ours" | "result" | "theirs";
const PANES: readonly MergePane[] = ["ours", "result", "theirs"];
@@ -33,10 +32,6 @@ export class ScrollEchoes<K> {
}
}
// Lined up by IDEA's line comparison. `Chunk.build` with no config runs an unbounded
// character diff, which takes minutes on a long file such as a lockfile.
const LINES = ideaDiffConfig("none", "lines");
/** Starts scrolling `views` together; returns the function that stops it. */
export function syncMergeScroll(views: Record<MergePane, EditorView>): () => void {
const built = new Map<MergePane, { a: Text; b: Text; chunks: readonly Chunk[] }>();
@@ -45,7 +40,7 @@ export function syncMergeScroll(views: Record<MergePane, EditorView>): () => voi
const b = views.result.state.doc;
const hit = built.get(side);
if (hit && hit.a === a && hit.b === b) return hit.chunks;
const fresh = Chunk.build(a, b, LINES);
const fresh = Chunk.build(a, b);
built.set(side, { a, b, chunks: fresh });
return fresh;
};
-8
View File
@@ -139,13 +139,6 @@ export function stashLabel(message: string): { branch: string | null; text: stri
return { branch: m[1]!, text: m[2]!.trim() || message };
}
/** SSH front hosts that serve the same service as the web host in the value. */
const WEB_HOST_ALIASES: Record<string, string> = {
"ssh.bitbucket.org": "bitbucket.org",
"ssh.github.com": "github.com",
"altssh.gitlab.com": "gitlab.com",
};
/**
* Web page of a git remote URL (`[email protected]:o/r.git`, `ssh://git@host:22/o/r`,
* `https://user@host/o/r.git`), or null for local paths.
@@ -162,7 +155,6 @@ export function remoteWebUrl(url: string): string | null {
if (full) [, host, path] = full as unknown as [string, string, string];
else if (scp) [, host, path] = scp as unknown as [string, string, string];
else return null;
host = WEB_HOST_ALIASES[host.toLowerCase()] ?? host;
return `https://${host}/${path.replace(/^\/+/, "")}`;
}