mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-08 08:52:12 +00:00
Project & files - Project view modes (Project Files / Open Files / All Changed Files / Scratches); External Libraries for Python, JDK (src.zip), Node, Cargo, Go, Maven/Gradle jars; read-only jar/zip browsing - ⌘N New popup with type search and more file kinds; New Project, Rename Project, Reload All from Disk, Export/Import Settings, Power Save Mode - File type associations, extra content roots and exclude patterns (indexed and watched without reopening the project) Editor & navigation - Find bar: search scope (comments/strings), Preserve Case, Exclude, multiline, history; Find in Files: Module scope, custom pattern scopes, multiline - Search Everywhere filters, Assign Shortcut, settings results; named bookmark lists, file/folder bookmarks; Structure filters and Show Inherited; Recent Locations timestamps and breadcrumbs; Code Vision author - Completion options, editor tab placement/layout, inline completion (LSP 3.18) - Spell checking (Typo inspection, ide-spell) and Inspections settings with custom profiles; Code Style schemes, formatter markers, Do not format Run, VCS, services, database - Typed run configurations (Shell, Program, npm, Gradle, Maven, Docker, Compound), Modify options, Before launch, env dialog, Current File, Emulate terminal (PTY) - Git log graph/view options, Go to Hash/Branch/Tag, date filter keeps the graph; Pull/Merge/Rebase dialogs, Manage Remotes, Worktrees - Generic Services host (Docker connections/registries, run sessions); TODO scope/changes tabs with changelists; Coverage report import - Data sources: wire-compatible vendors, URL import, SSL certs, Options, Schemas and Advanced tabs, color and comment Workbench - Run Anything, Customize Main Toolbar, named tool window layouts, menu completeness, Code Cleanup, macros, "Don't Show Again", editor banners - Chinese translations for the new UI Claude-Session: https://claude.ai/code/session_01SaPPsVPuk6ZTNsoUCNCbMv
77 lines
2.4 KiB
TypeScript
77 lines
2.4 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import type { RunConfig } from "@/platform/ipc";
|
|
import { runServiceItems, sessionStatus } from "./services";
|
|
import type { RunSession } from "./store";
|
|
|
|
const config = (id: string, kind: string): RunConfig => ({
|
|
id,
|
|
name: id,
|
|
kind,
|
|
command: kind,
|
|
args: [],
|
|
cwd: null,
|
|
env: {},
|
|
detected: true,
|
|
isTest: false,
|
|
debugAdapter: null,
|
|
});
|
|
|
|
const session = (
|
|
id: string,
|
|
c: RunConfig,
|
|
status: RunSession["status"],
|
|
startedAt: number,
|
|
extra: Partial<RunSession> = {},
|
|
): RunSession => ({
|
|
id,
|
|
config: c,
|
|
runId: null,
|
|
status,
|
|
exitCode: null,
|
|
startedAt,
|
|
endedAt: null,
|
|
stdinClosed: false,
|
|
...extra,
|
|
});
|
|
|
|
describe("run configurations in Services", () => {
|
|
const build = config("build", "cargo");
|
|
const test = config("test", "cargo");
|
|
const dev = config("dev", "npm");
|
|
const scratch = config("context:file", "python");
|
|
|
|
it("lists added types fully and other types only with their runs", () => {
|
|
const sessions = [
|
|
session("s1", dev, "finished", 1),
|
|
session("s2", dev, "running", 2),
|
|
session("s3", scratch, "failed", 3, { exitCode: 2 }),
|
|
];
|
|
const items = runServiceItems([build, test, dev], sessions, ["cargo"]);
|
|
expect(items.map((i) => [i.key, i.label, i.detail])).toEqual([
|
|
["run:type:cargo", "Cargo", undefined],
|
|
["run:type:npm", "npm", "1 running"],
|
|
["run:type:python", "Python", undefined],
|
|
]);
|
|
expect(items[0]!.children!.map((c) => [c.key, c.detail, c.dim])).toEqual([
|
|
["run:config:build", undefined, true],
|
|
["run:config:test", undefined, true],
|
|
]);
|
|
// The newest session of a configuration decides its state.
|
|
expect(items[1]!.children!.map((c) => [c.label, c.detail, c.dim, c.icon])).toEqual([
|
|
["dev", "Running", false, "run"],
|
|
]);
|
|
expect(items[2]!.children!.map((c) => [c.key, c.detail])).toEqual([["run:config:context:file", "Failed (exit 2)"]]);
|
|
});
|
|
|
|
it("has no groups without added types or sessions", () => {
|
|
expect(runServiceItems([build], [], [])).toEqual([]);
|
|
});
|
|
|
|
it("describes session states", () => {
|
|
expect(sessionStatus(undefined)).toBeUndefined();
|
|
expect(sessionStatus(session("a", build, "starting", 0))).toBe("Starting");
|
|
expect(sessionStatus(session("a", build, "failed", 0, { stopped: true }))).toBe("Stopped");
|
|
expect(sessionStatus(session("a", build, "finished", 0))).toBe("Finished");
|
|
});
|
|
});
|