From cc877ed9f795f0727879ec0a7293aabd681b3141 Mon Sep 17 00:00:00 2001 From: l0ng-ai Date: Sun, 6 Dec 2026 00:07:09 +0800 Subject: [PATCH] fix(settings): import Gradle settings from JetBrains settings (#8265) Import JetBrains Settings now also reads the Gradle settings for new projects (options/gradle.default.xml): a local distribution and its home, Build and run using, and the Gradle JVM when it names an imported JDK that exists here; plus the Gradle user home from options/gradle.settings.xml. Defaults (wrapper, project JDK) are not written. --- crates/ide-workspace/src/settings.rs | 15 +++++-- .../app/__tests__/jetbrainsSettings.test.ts | 40 +++++++++++++++++++ src/features/app/jetbrainsSettings.tsx | 24 +++++++++++ 3 files changed, 76 insertions(+), 3 deletions(-) diff --git a/crates/ide-workspace/src/settings.rs b/crates/ide-workspace/src/settings.rs index 777584e3e1..b447b128c8 100644 --- a/crates/ide-workspace/src/settings.rs +++ b/crates/ide-workspace/src/settings.rs @@ -578,7 +578,7 @@ pub struct JetBrainsSettings { } const JETBRAINS_MARKER: &str = "IntelliJ IDEA Global Settings"; -const JETBRAINS_OPTIONS: [&str; 11] = [ +const JETBRAINS_OPTIONS: [&str; 13] = [ "options/editor-font.xml", "options/terminal-font.xml", "options/colors.scheme.xml", @@ -589,12 +589,19 @@ const JETBRAINS_OPTIONS: [&str; 11] = [ "options/mac/keymap.xml", "options/windows/keymap.xml", "options/linux/keymap.xml", - // JDKs, and the default project's Maven settings. + // JDKs, and the build tool settings for new projects. "options/jdk.table.xml", "options/project.default.xml", + "options/gradle.default.xml", + "options/gradle.settings.xml", ]; /// Options files whose paths use `$USER_HOME$`, replaced by this machine's home folder when read. -const JETBRAINS_HOME_PATHS: [&str; 2] = ["options/jdk.table.xml", "options/project.default.xml"]; +const JETBRAINS_HOME_PATHS: [&str; 4] = [ + "options/jdk.table.xml", + "options/project.default.xml", + "options/gradle.default.xml", + "options/gradle.settings.xml", +]; /// Folders whose files are all read: (folder, extension). const JETBRAINS_READ_DIRS: [(&str, &str); 5] = [ ("colors/", ".icls"), @@ -1528,11 +1535,13 @@ mod tests { r#"