Файли
openidea/src/features/project-tree/folderKind.ts
T
RuyimgByCN 2622c9d778 feat(vcs): use Project-tree folder, module and attached-member file icons in Commit (#5816)
The Commit changes tree showed every directory with a plain folder icon and resolved file icons against the main project only. Directory rows now get the Project view's icons (source, test, resources, package, excluded, output, module, .github) from a folder presentation shared by both trees, and files of an attached workspace member resolve their test and Spring icons against that member's roots. Repository rows keep their folder icon and grey branch text.

The shared JVM package check keeps the Gradle sync and Eclipse .classpath source-set markers, so those folders keep their package icon in the Project tree.

Co-authored-by: RuyimgByCN <[email protected]>
2026-11-25 16:26:38 +08:00

23 рядки
877 B
TypeScript

/** Folder icon kind in the project view, from the effective roots. */
import type { RootFolder } from "@/platform/languageSettings";
import type { BuildPresentation } from "@/platform/projectPresentation";
import type { FolderKind } from "@/ui";
import { directoryFolderKind, outputFolderKind } from "@/ui/folderPresentation";
import type { ProjectNode } from "./model";
export { outputFolderKind };
/**
* Project Structure marks and roots detected from build files. Like IDEA, only
* excluded folders get the excluded icon; git-ignored ones keep the plain one.
*/
export function folderKind(
node: Pick<ProjectNode, "path" | "excluded">,
roots: readonly RootFolder[],
root: string | null,
build?: BuildPresentation,
detected: readonly RootFolder[] = [],
): FolderKind {
return directoryFolderKind(node.path, roots, root, build, detected, !!node.excluded);
}