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

...
Автор SHA1 Повідомлення Дата
l0ng-ai ff01f23114 fix(libraries): write only SDKs in angle brackets under External Libraries
Every External Libraries group was shown as < name >, so a Maven or Gradle
project listed hundreds of bracketed dependencies. As in IntelliJ IDEA,
only SDKs (JDK, Python, Ruby, Go, Rust) keep the brackets; dependency
groups such as Maven: g:a:v and Gradle: g:a:v are shown as they are.

Refs #1977
2026-11-11 21:34:28 +08:00
2 змінених файлів з 7 додано та 2 видалено

No files matched your search

+4 -1
Переглянути файл
@@ -34,6 +34,9 @@ const GROUP_ICONS: Record<string, string> = {
gems: "file-ruby",
};
/** SDK groups, which IDEA writes in angle brackets (`< 21 >`); library groups (`Maven: g:a:v`) go without. */
const SDK_KINDS = new Set(["jdk", "python", "ruby", "go", "rust"]);
/** An archive's root (`/jdk/lib/src.zip!`): its entries live below `<archive>!/`. */
const isArchiveRoot = (path: string) => path.endsWith("!");
@@ -91,7 +94,7 @@ export function librariesRoot(groups: readonly LibraryGroup[]): ProjectViewRootC
order: 5,
readOnly: true,
children: groups.map((g) => ({
label: `< ${g.name} >`,
label: SDK_KINDS.has(g.kind) ? `< ${g.name} >` : g.name,
icon: GROUP_ICONS[g.kind] ?? "library",
children: g.roots.map((r) => ({
label: r.name,
+3 -1
Переглянути файл
@@ -64,7 +64,9 @@ describe("External Libraries", () => {
{ name: "Maven: g:a:1", kind: "maven", roots: [{ name: "a-1-sources.jar", path: "/m2/g/a/1/a-1-sources.jar!" }] },
])!;
expect(root.children?.[0]?.children?.map((c) => c.icon)).toEqual(["folder-library", "file-archive"]);
expect(root.children?.[1]).toMatchObject({ label: "< Maven: g:a:1 >", icon: "maven-project" });
// As in IDEA: SDKs in angle brackets, dependencies without.
expect(root.children?.[0]).toMatchObject({ label: "< temurin-21 >" });
expect(root.children?.[1]).toMatchObject({ label: "Maven: g:a:1", icon: "maven-project" });
dispose = setLibraryRoots("test", ["/jdk/lib/src.zip!"]);
expect(isLibraryPath("/jdk/lib/src.zip!/java.base/java/lang/String.java")).toBe(true);
});