diff --git a/src/features/settings/model/staging.ts b/src/features/settings/model/staging.ts
index 5f1326c92..546910a82 100644
--- a/src/features/settings/model/staging.ts
+++ b/src/features/settings/model/staging.ts
@@ -57,6 +57,11 @@ export interface SettingsDialogState {
open: boolean;
projectStructureOpen: boolean;
projectStructureSection: ProjectStructureSection;
+ /**
+ * Project-relative path (`/`-separated, `""` for the project folder) Modules should select
+ * the module of, set by Open Module Settings; null keeps the page's own selection.
+ */
+ projectStructureModule: string | null;
pageId: string;
/** What the page should select when opened as `page#focus` (an inspection id). */
focus: string | null;
@@ -94,6 +99,7 @@ export const useSettingsDialog = create
(() => ({
open: false,
projectStructureOpen: false,
projectStructureSection: "project",
+ projectStructureModule: null,
pageId: DEFAULT_PAGE,
focus: null,
query: "",
@@ -146,9 +152,10 @@ export function openSettings(pageId?: string, opts: { newProjects?: boolean; glo
if (!opts.globalBase) void loadGlobalBase();
}
-export function openProjectStructure(section?: string) {
+export function openProjectStructure(section?: string, module: string | null = null) {
if (useSettingsDialog.getState().projectStructureOpen) {
if (section) selectProjectStructureSection(parseProjectStructureSection(section));
+ if (module !== null) useSettingsDialog.setState({ projectStructureModule: module });
return;
}
const base = validateSettings(useProject.getState().settings);
@@ -156,6 +163,7 @@ export function openProjectStructure(section?: string) {
open: false,
projectStructureOpen: true,
projectStructureSection: parseProjectStructureSection(section),
+ projectStructureModule: module,
base,
globalBase: base,
newProjects: false,
@@ -169,9 +177,26 @@ export function openProjectStructure(section?: string) {
void loadGlobalBase();
}
+/**
+ * IDEA's Open Module Settings: Project Structure › Modules showing the module that holds
+ * `path` (absolute, inside the project); without one, the page's own selection.
+ */
+export function openModuleSettings(path?: string) {
+ const root = useProject.getState().project?.root;
+ let rel: string | null = null;
+ if (path && root) {
+ const norm = (p: string) => p.replace(/\\/g, "/").replace(/\/+$/, "");
+ const [r, p] = [norm(root), norm(path)];
+ if (p === r) rel = "";
+ else if (p.startsWith(`${r}/`)) rel = p.slice(r.length + 1);
+ }
+ openProjectStructure("modules", rel);
+}
+
export function closeProjectStructure() {
useSettingsDialog.setState({
projectStructureOpen: false,
+ projectStructureModule: null,
staged: {},
stagedSecrets: {},
stagedExternal: {},
diff --git a/src/platform/locales/text/en.json b/src/platform/locales/text/en.json
index f7eae891b..50765460d 100644
--- a/src/platform/locales/text/en.json
+++ b/src/platform/locales/text/en.json
@@ -1435,7 +1435,7 @@
"Platform Settings": "Platform Settings",
"Project Structure sections": "Project Structure sections",
"Custom test output paths are not supported yet. Maven and Gradle manage their own test output.": "Custom test output paths are not supported yet. Maven and Gradle manage their own test output.",
- "Custom artifact packaging is not supported yet. Build and deploy artifacts defined by Maven or Gradle.": "Custom artifact packaging is not supported yet. Build and deploy artifacts defined by Maven or Gradle.",
+ "This project is built by Maven or Gradle: build and deploy the artifacts they define.": "This project is built by Maven or Gradle: build and deploy the artifacts they define.",
"Add Module Overrides…": "Add Module Overrides…",
"Import Module from Existing Sources": "Import Module from Existing Sources",
"Module overrides only apply to a directory inside the opened project. To import an existing module from outside it, use Import Module from Existing Sources.": "Module overrides only apply to a directory inside the opened project. To import an existing module from outside it, use Import Module from Existing Sources.",
diff --git a/src/platform/locales/text/es.json b/src/platform/locales/text/es.json
index 517a6b44c..260815cbc 100644
--- a/src/platform/locales/text/es.json
+++ b/src/platform/locales/text/es.json
@@ -6217,5 +6217,6 @@
"Cross-file code insight for {container} needs buildServer.json. Generate it with {tool}?": "La asistencia de código entre archivos para {container} necesita buildServer.json. ¿Generarlo con {tool}?",
"Cross-file code insight for {container} needs a Build Server Protocol config. Install xcode-build-server (brew install xcode-build-server) to generate one.": "La asistencia de código entre archivos para {container} necesita una configuración de Build Server Protocol. Instala xcode-build-server (brew install xcode-build-server) para generarla.",
"Check Again": "Comprobar de nuevo",
- "Running {tool}…": "Ejecutando {tool}…"
+ "Running {tool}…": "Ejecutando {tool}…",
+ "Open Module Settings": "Abrir configuración del módulo"
}
diff --git a/src/platform/locales/text/fr.json b/src/platform/locales/text/fr.json
index d289540ea..a3e264919 100644
--- a/src/platform/locales/text/fr.json
+++ b/src/platform/locales/text/fr.json
@@ -5862,5 +5862,6 @@
"Cross-file code insight for {container} needs buildServer.json. Generate it with {tool}?": "L’assistance au code entre fichiers pour {container} nécessite buildServer.json. Le générer avec {tool} ?",
"Cross-file code insight for {container} needs a Build Server Protocol config. Install xcode-build-server (brew install xcode-build-server) to generate one.": "L’assistance au code entre fichiers pour {container} nécessite une configuration Build Server Protocol. Installez xcode-build-server (brew install xcode-build-server) pour en générer une.",
"Check Again": "Vérifier à nouveau",
- "Running {tool}…": "Exécution de {tool}…"
+ "Running {tool}…": "Exécution de {tool}…",
+ "Open Module Settings": "Ouvrir les paramètres du module"
}
diff --git a/src/platform/locales/text/ko.json b/src/platform/locales/text/ko.json
index 35fe0dc20..d9b2c7c49 100644
--- a/src/platform/locales/text/ko.json
+++ b/src/platform/locales/text/ko.json
@@ -6327,5 +6327,6 @@
"Cross-file code insight for {container} needs buildServer.json. Generate it with {tool}?": "{container}의 파일 간 코드 인사이트에는 buildServer.json이 필요합니다. {tool}(으)로 생성할까요?",
"Cross-file code insight for {container} needs a Build Server Protocol config. Install xcode-build-server (brew install xcode-build-server) to generate one.": "{container}의 파일 간 코드 인사이트에는 Build Server Protocol 설정이 필요합니다. xcode-build-server(brew install xcode-build-server)를 설치하면 생성할 수 있습니다.",
"Check Again": "다시 확인",
- "Running {tool}…": "{tool} 실행 중…"
+ "Running {tool}…": "{tool} 실행 중…",
+ "Open Module Settings": "모듈 설정 열기"
}
diff --git a/src/platform/locales/text/pl.json b/src/platform/locales/text/pl.json
index 69c700b99..4391bea24 100644
--- a/src/platform/locales/text/pl.json
+++ b/src/platform/locales/text/pl.json
@@ -6025,5 +6025,6 @@
"Cross-file code insight for {container} needs buildServer.json. Generate it with {tool}?": "Analiza kodu między plikami dla {container} wymaga buildServer.json. Wygenerować go za pomocą {tool}?",
"Cross-file code insight for {container} needs a Build Server Protocol config. Install xcode-build-server (brew install xcode-build-server) to generate one.": "Analiza kodu między plikami dla {container} wymaga konfiguracji Build Server Protocol. Zainstaluj xcode-build-server (brew install xcode-build-server), aby ją wygenerować.",
"Check Again": "Sprawdź ponownie",
- "Running {tool}…": "Uruchamianie {tool}…"
+ "Running {tool}…": "Uruchamianie {tool}…",
+ "Open Module Settings": "Otwórz ustawienia modułu"
}
diff --git a/src/platform/locales/text/pt.json b/src/platform/locales/text/pt.json
index b613a7f63..789520ae9 100644
--- a/src/platform/locales/text/pt.json
+++ b/src/platform/locales/text/pt.json
@@ -6040,5 +6040,6 @@
"Cross-file code insight for {container} needs buildServer.json. Generate it with {tool}?": "A inteligência de código entre arquivos para {container} precisa de buildServer.json. Gerá-lo com {tool}?",
"Cross-file code insight for {container} needs a Build Server Protocol config. Install xcode-build-server (brew install xcode-build-server) to generate one.": "A inteligência de código entre arquivos para {container} precisa de uma configuração do Build Server Protocol. Instale o xcode-build-server (brew install xcode-build-server) para gerá-la.",
"Check Again": "Verificar novamente",
- "Running {tool}…": "Executando {tool}…"
+ "Running {tool}…": "Executando {tool}…",
+ "Open Module Settings": "Abrir configurações do módulo"
}
diff --git a/src/platform/locales/text/ru.json b/src/platform/locales/text/ru.json
index fb49ee7ae..89618d239 100644
--- a/src/platform/locales/text/ru.json
+++ b/src/platform/locales/text/ru.json
@@ -7860,7 +7860,7 @@
"Cannot copy the value": "Не удается скопировать значение",
"The check could not run: {reason}": "Не удалось выполнить проверку: {reason}",
"Custom test output paths are not supported yet. Maven and Gradle manage their own test output.": "Пользовательские пути вывода тестов пока не поддерживаются. Maven и Gradle сами управляют выводом тестов.",
- "Custom artifact packaging is not supported yet. Build and deploy artifacts defined by Maven or Gradle.": "Пользовательская упаковка артефактов пока не поддерживается. Собирайте и развертывайте артефакты, определенные в Maven или Gradle.",
+ "This project is built by Maven or Gradle: build and deploy the artifacts they define.": "Этот проект собирается Maven или Gradle: собирайте и развертывайте определенные в них артефакты.",
"Add Module Overrides…": "Добавить переопределения модуля…",
"Module overrides only apply to a directory inside the opened project. To import an existing module from outside it, use Import Module from Existing Sources.": "Переопределения модуля применимы только к каталогу внутри открытого проекта. Чтобы импортировать существующий модуль извне, используйте «Импорт модуля из существующих исходников».",
"Directory for production classes, relative to the project root and inside this module.": "Каталог для рабочих классов (production) относительно корня проекта и внутри этого модуля.",
@@ -10255,5 +10255,6 @@
"Cross-file code insight for {container} needs buildServer.json. Generate it with {tool}?": "Для межфайловой поддержки кода в {container} нужен buildServer.json. Создать его с помощью {tool}?",
"Cross-file code insight for {container} needs a Build Server Protocol config. Install xcode-build-server (brew install xcode-build-server) to generate one.": "Для межфайловой поддержки кода в {container} нужна конфигурация Build Server Protocol. Установите xcode-build-server (brew install xcode-build-server), чтобы создать её.",
"Check Again": "Проверить снова",
- "Running {tool}…": "Выполняется {tool}…"
+ "Running {tool}…": "Выполняется {tool}…",
+ "Open Module Settings": "Открыть настройки модуля"
}
diff --git a/src/platform/locales/text/tr.json b/src/platform/locales/text/tr.json
index a6b02b045..3a81b26e5 100644
--- a/src/platform/locales/text/tr.json
+++ b/src/platform/locales/text/tr.json
@@ -774,7 +774,7 @@
"Platform Settings": "Platform Ayarları",
"Project Structure sections": "Proje Yapısı bölümleri",
"Custom test output paths are not supported yet. Maven and Gradle manage their own test output.": "Özel test çıktı yolları henüz desteklenmiyor. Maven ve Gradle kendi test çıktılarını yönetir.",
- "Custom artifact packaging is not supported yet. Build and deploy artifacts defined by Maven or Gradle.": "Özel çıktı paketi oluşturma henüz desteklenmiyor. Maven veya Gradle tarafından tanımlanan çıktı paketlerini derleyip dağıtın.",
+ "This project is built by Maven or Gradle: build and deploy the artifacts they define.": "Bu proje Maven veya Gradle ile derleniyor: onların tanımladığı çıktı paketlerini derleyip dağıtın.",
"Add Module Overrides…": "Modül Geçersiz Kılmaları Ekle…",
"Import Module from Existing Sources": "Mevcut Kaynaklardan Modül İçe Aktar",
"Module overrides only apply to a directory inside the opened project. To import an existing module from outside it, use Import Module from Existing Sources.": "Modül geçersiz kılmaları yalnızca açık projenin içindeki dizinlere uygulanır. Proje dışındaki mevcut modülleri içe aktarmak için Mevcut Kaynaklardan Modül İçe Aktar seçeneğini kullanın.",
@@ -8879,5 +8879,6 @@
"Cross-file code insight for {container} needs buildServer.json. Generate it with {tool}?": "{container} için dosyalar arası kod zekâsı buildServer.json gerektirir. {tool} ile oluşturulsun mu?",
"Cross-file code insight for {container} needs a Build Server Protocol config. Install xcode-build-server (brew install xcode-build-server) to generate one.": "{container} için dosyalar arası kod zekâsı bir Build Server Protocol yapılandırması gerektirir. Oluşturmak için xcode-build-server'ı yükleyin (brew install xcode-build-server).",
"Check Again": "Yeniden Denetle",
- "Running {tool}…": "{tool} çalıştırılıyor…"
+ "Running {tool}…": "{tool} çalıştırılıyor…",
+ "Open Module Settings": "Modül Ayarlarını Aç"
}
diff --git a/src/platform/locales/text/zh-TW.json b/src/platform/locales/text/zh-TW.json
index 4b66606c2..b7473a22e 100644
--- a/src/platform/locales/text/zh-TW.json
+++ b/src/platform/locales/text/zh-TW.json
@@ -7369,7 +7369,7 @@
"Cannot copy the value": "無法複製該值",
"The check could not run: {reason}": "檢查無法執行:{reason}",
"Custom test output paths are not supported yet. Maven and Gradle manage their own test output.": "暫不支援自訂測試輸出路徑。測試輸出由 Maven 和 Gradle 管理。",
- "Custom artifact packaging is not supported yet. Build and deploy artifacts defined by Maven or Gradle.": "暫不支援自訂製品打包。請建置和部署 Maven 或 Gradle 定義的製品。",
+ "This project is built by Maven or Gradle: build and deploy the artifacts they define.": "此專案由 Maven 或 Gradle 建置:請建置和部署它們定義的構件。",
"Add Module Overrides…": "新增模組覆蓋設定…",
"Module overrides only apply to a directory inside the opened project. To import an existing module from outside it, use Import Module from Existing Sources.": "模組覆蓋設定只適用於目前開啟專案內的目錄。要從外部匯入已有模組,請使用「匯入已有模組」。",
"Directory for production classes, relative to the project root and inside this module.": "生產類別檔案目錄,相對於專案根目錄,且必須位於目前模組內。",
@@ -9511,5 +9511,6 @@
"Cross-file code insight for {container} needs buildServer.json. Generate it with {tool}?": "{container} 的跨檔案程式碼智慧需要 buildServer.json。要用 {tool} 產生嗎?",
"Cross-file code insight for {container} needs a Build Server Protocol config. Install xcode-build-server (brew install xcode-build-server) to generate one.": "{container} 的跨檔案程式碼智慧需要 Build Server Protocol 設定。安裝 xcode-build-server(brew install xcode-build-server)即可產生。",
"Check Again": "重新檢查",
- "Running {tool}…": "正在執行 {tool}…"
+ "Running {tool}…": "正在執行 {tool}…",
+ "Open Module Settings": "開啟模組設定"
}
diff --git a/src/platform/locales/text/zh.json b/src/platform/locales/text/zh.json
index abcf08dbb..c6c9b2d3d 100644
--- a/src/platform/locales/text/zh.json
+++ b/src/platform/locales/text/zh.json
@@ -8259,7 +8259,7 @@
"Cannot copy the value": "无法复制该值",
"The check could not run: {reason}": "检查无法运行:{reason}",
"Custom test output paths are not supported yet. Maven and Gradle manage their own test output.": "暂不支持自定义测试输出路径。测试输出由 Maven 和 Gradle 管理。",
- "Custom artifact packaging is not supported yet. Build and deploy artifacts defined by Maven or Gradle.": "暂不支持自定义制品打包。请构建和部署 Maven 或 Gradle 定义的制品。",
+ "This project is built by Maven or Gradle: build and deploy the artifacts they define.": "此项目由 Maven 或 Gradle 构建:请构建和部署它们定义的构件。",
"Add Module Overrides…": "添加模块覆盖设置…",
"Module overrides only apply to a directory inside the opened project. To import an existing module from outside it, use Import Module from Existing Sources.": "模块覆盖设置只适用于当前打开项目内的目录。要从外部导入已有模块,请使用「导入已有模块」。",
"Directory for production classes, relative to the project root and inside this module.": "生产类文件目录,相对于项目根目录,且必须位于当前模块内。",
@@ -11370,5 +11370,6 @@
"Storage options": "存储选项",
"Access method": "访问方法",
"Partitioning": "分区",
- "fillfactor=70, autovacuum_enabled=false": "fillfactor=70, autovacuum_enabled=false"
+ "fillfactor=70, autovacuum_enabled=false": "fillfactor=70, autovacuum_enabled=false",
+ "Open Module Settings": "打开模块设置"
}
diff --git a/src/ui/expui/general/projectStructure.svg b/src/ui/expui/general/projectStructure.svg
new file mode 100644
index 000000000..a5f8ec4a1
--- /dev/null
+++ b/src/ui/expui/general/projectStructure.svg
@@ -0,0 +1,6 @@
+
+
diff --git a/src/ui/expui/general/projectStructure_dark.svg b/src/ui/expui/general/projectStructure_dark.svg
new file mode 100644
index 000000000..e54355ed6
--- /dev/null
+++ b/src/ui/expui/general/projectStructure_dark.svg
@@ -0,0 +1,6 @@
+
+
diff --git a/src/ui/icons.tsx b/src/ui/icons.tsx
index b89bf04ba..d3504ca04 100644
--- a/src/ui/icons.tsx
+++ b/src/ui/icons.tsx
@@ -345,6 +345,7 @@ const ICONS = {
refresh: "general/refresh",
quote: "openidea/general/quote",
settings: "general/settings",
+ "project-structure": "general/projectStructure",
help: "openidea/general/help",
"page-first": "openidea/general/pageFirst",
"page-last": "openidea/general/pageLast",
diff --git a/src/workbench/TitleBar.test.tsx b/src/workbench/TitleBar.test.tsx
index 3dbc1d699..513801460 100644
--- a/src/workbench/TitleBar.test.tsx
+++ b/src/workbench/TitleBar.test.tsx
@@ -21,11 +21,12 @@ afterEach(() => {
});
describe("title bar gear menu", () => {
- it("lists Run Anything, Settings, Plugins, quick switches, toolbar customization and Check for Updates", () => {
+ it("lists Run Anything, Project Structure, Settings, Plugins, quick switches, toolbar customization and Check for Updates", () => {
const items = gearMenuItems("dark", "intellij-macos", ["Mine"]);
expect(items.map((i) => ("action" in i ? i.action : "label" in i ? i.label : i.kind))).toEqual([
"runAnything.show",
"separator",
+ "file.projectStructure",
"file.settings",
"plugins.settings",
"separator",
@@ -38,13 +39,13 @@ describe("title bar gear menu", () => {
"app.checkForUpdates",
]);
type Sub = { submenu: Array<{ label?: string; checked?: boolean; action?: string }> };
- const theme = (items[5] as Sub).submenu;
+ const theme = (items[6] as Sub).submenu;
expect(theme.filter((i) => i.checked).map((i) => i.label)).toEqual(["Islands Dark"]);
- const keymap = (items[6] as Sub).submenu;
+ const keymap = (items[7] as Sub).submenu;
expect(keymap.map((i) => i.label)).toContain("Mine");
expect(keymap.filter((i) => i.checked).map((i) => i.label)).toEqual(["macOS"]);
// View Mode only switches the existing modes.
- expect((items[7] as Sub).submenu.map((i) => i.action)).toEqual([
+ expect((items[8] as Sub).submenu.map((i) => i.action)).toEqual([
"editor.toggleZen",
"view.toggleZenMode",
"window.toggleFullScreen",
diff --git a/src/workbench/TitleBar.tsx b/src/workbench/TitleBar.tsx
index 39be91730..1aca91454 100644
--- a/src/workbench/TitleBar.tsx
+++ b/src/workbench/TitleBar.tsx
@@ -171,8 +171,8 @@ export function customizeToolbarItems(
}
/**
- * IDEA's main toolbar gear: Run Anything, Settings, Plugins, quick switches, toolbar customization, updates.
- * With `preview`, a theme under the pointer shows as in Quick Switch.
+ * IDEA's main toolbar gear: Run Anything, Project Structure, Settings, Plugins, quick switches,
+ * toolbar customization, updates. With `preview`, a theme under the pointer shows as in Quick Switch.
*/
export function gearMenuItems(
themeId: string,
@@ -185,6 +185,7 @@ export function gearMenuItems(
return [
{ kind: "action", action: "runAnything.show" },
{ kind: "separator" },
+ { kind: "action", action: "file.projectStructure" },
{ kind: "action", action: "file.settings" },
{ kind: "action", action: "plugins.settings" },
{ kind: "separator" },