@@ -43,78 +43,75 @@ pub fn ScanPathConfigure(AppState:&std::sync::Arc<ApplicationState>) -> Result<V
4343 // Atom J3: kernel / minimal profiles set LAND_SKIP_BUILTIN_EXTENSIONS=true
4444 // to ship without any bundled extensions. The user-extensions path
4545 // (`~/.land/extensions`) still scans so VSIX-installed extensions work.
46- let SkipBuiltins = matches ! (
47- std:: env:: var( "LAND_SKIP_BUILTIN_EXTENSIONS" ) . as_deref( ) ,
48- Ok ( "1" ) | Ok ( "true" )
49- ) ;
46+ let SkipBuiltins = matches ! ( std:: env:: var( "LAND_SKIP_BUILTIN_EXTENSIONS" ) . as_deref( ) , Ok ( "1" ) | Ok ( "true" ) ) ;
5047
5148 if SkipBuiltins {
5249 dev_log ! (
5350 "extensions" ,
54- "[Extensions] [ScanPaths] LAND_SKIP_BUILTIN_EXTENSIONS=true — skipping all built-in paths, keeping user path"
51+ "[Extensions] [ScanPaths] LAND_SKIP_BUILTIN_EXTENSIONS=true — skipping all built-in paths, keeping user \
52+ path"
5553 ) ;
5654 } else {
5755 dev_log ! ( "extensions" , "[Extensions] [ScanPaths] Adding default scan paths..." ) ;
5856 }
5957
6058 // Resolve paths from executable directory
6159 if !SkipBuiltins {
62- if let Ok ( ExecutableDirectory ) = std:: env:: current_exe ( ) {
63- if let Some ( Parent ) = ExecutableDirectory . parent ( ) {
64- // Standard Tauri bundle path: ../Resources/extensions.
65- // When launched from a `.app`, Parent is `Contents/MacOS/` and
66- // this resolves to `Contents/Resources/extensions`.
67- let ResourcesPath = Parent . join ( "../Resources/extensions" ) ;
68- dev_log ! ( "extensions" , "[Extensions] [ScanPaths] + {}" , ResourcesPath . display( ) ) ;
69- ScanPathsGuard . push ( ResourcesPath ) ;
60+ if let Ok ( ExecutableDirectory ) = std:: env:: current_exe ( ) {
61+ if let Some ( Parent ) = ExecutableDirectory . parent ( ) {
62+ // Standard Tauri bundle path: ../Resources/extensions.
63+ // When launched from a `.app`, Parent is `Contents/MacOS/` and
64+ // this resolves to `Contents/Resources/extensions`.
65+ let ResourcesPath = Parent . join ( "../Resources/extensions" ) ;
66+ dev_log ! ( "extensions" , "[Extensions] [ScanPaths] + {}" , ResourcesPath . display( ) ) ;
67+ ScanPathsGuard . push ( ResourcesPath ) ;
7068
71- // VS Code-style bundle layout: `.app/Contents/Resources/app/extensions`.
72- // Some tooling copies built-ins here; probe both conventions so a
73- // single bundle works regardless of which copy step placed them.
74- let ResourcesAppPath = Parent . join ( "../Resources/app/extensions" ) ;
75- dev_log ! ( "extensions" , "[Extensions] [ScanPaths] + {}" , ResourcesAppPath . display( ) ) ;
76- ScanPathsGuard . push ( ResourcesAppPath ) ;
69+ // VS Code-style bundle layout: `.app/Contents/Resources/app/extensions`.
70+ // Some tooling copies built-ins here; probe both conventions so a
71+ // single bundle works regardless of which copy step placed them.
72+ let ResourcesAppPath = Parent . join ( "../Resources/app/extensions" ) ;
73+ dev_log ! ( "extensions" , "[Extensions] [ScanPaths] + {}" , ResourcesAppPath . display( ) ) ;
74+ ScanPathsGuard . push ( ResourcesAppPath ) ;
7775
78- // Debug/dev path: Target/debug/extensions
79- let LocalPath = Parent . join ( "extensions" ) ;
80- dev_log ! ( "extensions" , "[Extensions] [ScanPaths] + {}" , LocalPath . display( ) ) ;
81- ScanPathsGuard . push ( LocalPath ) ;
76+ // Debug/dev path: Target/debug/extensions
77+ let LocalPath = Parent . join ( "extensions" ) ;
78+ dev_log ! ( "extensions" , "[Extensions] [ScanPaths] + {}" , LocalPath . display( ) ) ;
79+ ScanPathsGuard . push ( LocalPath ) ;
8280
83- // Monorepo-layout fallback paths: resolved relative to
84- // `Element/Mountain/Target/{debug,release}/`, so they only
85- // materialise when the binary runs from inside the repo.
86- // Shipped `.app`s launched from `/Applications/` hit the
87- // `.exists()` guard and silently skip — no need for a
88- // `cfg(debug_assertions)` gate. Keeping these live in release
89- // lets a raw `Target/release/<name>` launch find the same 98
90- // built-in extensions a debug build does.
91- //
92- // Sky Target path: where CopyVSCodeAssets copies built-in
93- // extensions during the Sky build.
94- let SkyTargetPath = Parent . join ( "../../../Sky/Target/Static/Application/extensions" ) ;
95- if SkyTargetPath . exists ( ) {
96- dev_log ! (
97- "extensions" ,
98- "[Extensions] [ScanPaths] + {} (Sky Target, repo-layout)" ,
99- SkyTargetPath . display( )
100- ) ;
101- ScanPathsGuard . push ( SkyTargetPath ) ;
102- }
81+ // Monorepo-layout fallback paths: resolved relative to
82+ // `Element/Mountain/Target/{debug,release}/`, so they only
83+ // materialise when the binary runs from inside the repo.
84+ // Shipped `.app`s launched from `/Applications/` hit the
85+ // `.exists()` guard and silently skip — no need for a
86+ // `cfg(debug_assertions)` gate. Keeping these live in release
87+ // lets a raw `Target/release/<name>` launch find the same 98
88+ // built-in extensions a debug build does.
89+ //
90+ // Sky Target path: where CopyVSCodeAssets copies built-in
91+ // extensions during the Sky build.
92+ let SkyTargetPath = Parent . join ( "../../../Sky/Target/Static/Application/extensions" ) ;
93+ if SkyTargetPath . exists ( ) {
94+ dev_log ! (
95+ "extensions" ,
96+ "[Extensions] [ScanPaths] + {} (Sky Target, repo-layout)" ,
97+ SkyTargetPath . display( )
98+ ) ;
99+ ScanPathsGuard . push ( SkyTargetPath ) ;
100+ }
103101
104- // VS Code dependency path: built-in extensions from the VS
105- // Code source checkout — avoids requiring a copy step.
106- let DependencyPath =
107- Parent . join ( "../../../../Dependency/Microsoft/Dependency/Editor/extensions" ) ;
108- if DependencyPath . exists ( ) {
109- dev_log ! (
110- "extensions ",
111- "[Extensions] [ScanPaths] + {} (VS Code Dependency, repo-layout)" ,
112- DependencyPath . display ( )
113- ) ;
114- ScanPathsGuard . push ( DependencyPath ) ;
102+ // VS Code dependency path: built-in extensions from the VS
103+ // Code source checkout — avoids requiring a copy step.
104+ let DependencyPath = Parent . join ( "../../../../Dependency/Microsoft/Dependency/Editor/extensions" ) ;
105+ if DependencyPath . exists ( ) {
106+ dev_log ! (
107+ "extensions" ,
108+ "[Extensions] [ScanPaths] + {} (VS Code Dependency, repo-layout) ",
109+ DependencyPath . display ( )
110+ ) ;
111+ ScanPathsGuard . push ( DependencyPath ) ;
112+ }
115113 }
116114 }
117- }
118115 } // end !SkipBuiltins
119116
120117 // User-scope paths: always scanned, independent of whether the binary
0 commit comments