feat(project-tree): add "Add as Library…" for JARs and library directories (#7077)

Right-clicking a .jar or a folder of jars (such as WEB-INF/lib) in the Project view, or running it from Find Action, opens a Create Library dialog (name, scope, classes) that appends the library to projectStructure.libraries. Collapsed folders are probed briefly before the menu opens. Registered library folders get the library icon and an Open Library Settings entry instead of a duplicate add, External Libraries refreshes when jars inside them are added or removed, and manifest-free Java projects with libraries show the project JDK there.

Library class entries (jar globs, root-relative paths) are parsed once in platform/languageSettings for both the action and the refresh.

Closes #7051

Co-authored-by: RuyimgByCN <[email protected]>
Цей коміт міститься в:
RuyimgByCN authored and GitHub committed 2026-12-01 01:24:16 +08:00
1 джерело a0c0b69b4a
коміт 11e520dedb
23 files changed
+1079 -21

No files matched your search

+64
Переглянути файл
@@ -0,0 +1,64 @@
.form {
display: flex;
flex-direction: column;
gap: var(--space-3);
padding: var(--space-3) var(--space-4);
}
.fields {
display: grid;
grid-template-columns: fit-content(36%) minmax(0, 1fr);
align-items: start;
gap: var(--space-2) var(--space-3);
}
.label {
display: flex;
align-items: center;
min-height: var(--h-field);
color: var(--fg);
font-size: var(--fs-ui);
}
.control {
display: flex;
flex-direction: column;
gap: var(--space-1);
min-width: 0;
}
.pathList {
display: flex;
flex-direction: column;
gap: var(--space-1);
max-height: 120px;
overflow: auto;
padding: var(--space-1-5) var(--space-2);
border: 1px solid var(--border);
border-radius: var(--radius-small);
background: var(--bg-field);
font-family: var(--font-mono);
font-size: var(--fs-small);
color: var(--fg-muted);
}
.pathItem {
display: flex;
align-items: center;
gap: var(--space-1-5);
min-width: 0;
}
.pathItem > svg {
flex: none;
}
.pathText {
min-width: 0;
overflow-wrap: anywhere;
}
.error {
color: var(--danger);
font-size: var(--fs-small);
}