дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-08 19:02:17 +02:00
Workspaces open several local project folders in one IDE session (File › New / Open / Manage Workspace…, or Attach when opening a project, which creates a workspace automatically for a plain project window). Member folders are the Project view roots and take part in indexing, Find in Files, Git, language servers, run configurations and builds; agent tasks choose which member they work in. Window › Merge All Project Windows groups project windows into one window with project tabs (switch, reorder, close, move to a new window), restored on reopen. Closes #241 Closes #198 Closes #286
14 рядки
576 B
TypeScript
14 рядки
576 B
TypeScript
import { projectFolder } from "@/platform/project";
|
|
|
|
/** Prefer the active file's member, then the last task's member, then manifest order. */
|
|
export function defaultTaskProject(
|
|
project: Parameters<typeof projectFolder>[0],
|
|
activePath: string | null,
|
|
last: string | null | undefined,
|
|
): string | null {
|
|
const members = project?.workspace?.projects;
|
|
if (!members?.length) return project?.root ?? null;
|
|
const active = activePath ? projectFolder(project, activePath)?.root : null;
|
|
return active ?? (last && members.includes(last) ? last : (members[0] ?? null));
|
|
}
|