Skip to content

Commit 054e429

Browse files
1 parent 43b39ff commit 054e429

46 files changed

Lines changed: 9576 additions & 12734 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Source/Air/AirServiceProvider.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ use uuid::Uuid;
7070

7171
#[allow(unused_imports)]
7272
use super::{
73+
AirClient::DEFAULT_AIR_SERVER_ADDRESS,
7374
AirClient::{
7475
AirClient,
7576
AirMetrics,
@@ -83,7 +84,6 @@ use super::{
8384
ResourceUsage,
8485
UpdateInfo,
8586
},
86-
AirClient::DEFAULT_AIR_SERVER_ADDRESS,
8787
};
8888
use crate::dev_log;
8989

Source/ApplicationState/DTO/TerminalStateDTO.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,7 @@ impl std::fmt::Debug for TerminalStateDTO {
225225
.field("CurrentWorkingDirectory", &self.CurrentWorkingDirectory)
226226
.field("EnvironmentVariables", &self.EnvironmentVariables)
227227
.field("IsPTY", &self.IsPTY)
228-
.field(
229-
"PTYInputTransmitter",
230-
&self.PTYInputTransmitter.as_ref().map(|_| "<channel>"),
231-
)
228+
.field("PTYInputTransmitter", &self.PTYInputTransmitter.as_ref().map(|_| "<channel>"))
232229
.field("ReaderTaskHandle", &self.ReaderTaskHandle.as_ref().map(|_| "<task>"))
233230
.field("ProcessWaitHandle", &self.ProcessWaitHandle.as_ref().map(|_| "<task>"))
234231
.field("PTYMaster", &self.PTYMaster.as_ref().map(|_| "<master-pty>"))

Source/ApplicationState/State/FeatureState/LifecyclePhase/LifecyclePhaseState.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,7 @@ impl LifecyclePhaseState {
4343
/// long-running services (extension discovery, telemetry, heavy
4444
/// providers) until the editor is fully restored. Mirrors VS Code's
4545
/// `ILifecycleService.onDidChangePhase` signal.
46-
pub fn AdvanceAndBroadcast<R:tauri::Runtime>(
47-
&self,
48-
NewPhase:Phase,
49-
ApplicationHandle:&tauri::AppHandle<R>,
50-
) {
46+
pub fn AdvanceAndBroadcast<R:tauri::Runtime>(&self, NewPhase:Phase, ApplicationHandle:&tauri::AppHandle<R>) {
5147
use tauri::Emitter;
5248
let Previous = self.GetPhase();
5349
if NewPhase <= Previous {

Source/ApplicationState/State/WorkspaceState/WorkspaceDelta.rs

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,7 @@ fn FolderToWire(Folder:&WorkspaceFolderStateDTO) -> serde_json::Value {
3939
/// the caller, so a failed notification should not roll the mutation back. The
4040
/// log tag `[LandFix:WsDelta]` keeps the event grep-able in dev logs and is
4141
/// deliberately consistent with `[LandFix:WsNs]` on the Cocoon side.
42-
pub async fn DispatchDeltaWorkspaceFolders(
43-
Added:Vec<WorkspaceFolderStateDTO>,
44-
Removed:Vec<WorkspaceFolderStateDTO>,
45-
) {
42+
pub async fn DispatchDeltaWorkspaceFolders(Added:Vec<WorkspaceFolderStateDTO>, Removed:Vec<WorkspaceFolderStateDTO>) {
4643
if Added.is_empty() && Removed.is_empty() {
4744
return;
4845
}
@@ -63,12 +60,8 @@ pub async fn DispatchDeltaWorkspaceFolders(
6360
"removed": RemovedWire,
6461
});
6562

66-
if let Err(Error) = Client::SendNotification(
67-
"cocoon-main".to_string(),
68-
"$deltaWorkspaceFolders".to_string(),
69-
Payload,
70-
)
71-
.await
63+
if let Err(Error) =
64+
Client::SendNotification("cocoon-main".to_string(), "$deltaWorkspaceFolders".to_string(), Payload).await
7265
{
7366
dev_log!(
7467
"workspaces",
@@ -99,8 +92,7 @@ pub fn UpdateWorkspaceFoldersAndNotify(
9992
} else {
10093
dev_log!(
10194
"workspaces",
102-
"warn: [LandFix:WsDelta] No tokio runtime available — delta dropped ({} added, {} \
103-
removed)",
95+
"warn: [LandFix:WsDelta] No tokio runtime available — delta dropped ({} added, {} removed)",
10496
Added.len(),
10597
Removed.len()
10698
);
@@ -160,11 +152,16 @@ fn PersistRecentlyOpened(Added:&[WorkspaceFolderStateDTO]) {
160152
if Added.is_empty() {
161153
return;
162154
}
163-
let Home = std::env::var("HOME").or_else(|_| std::env::var("USERPROFILE")).unwrap_or_default();
155+
let Home = std::env::var("HOME")
156+
.or_else(|_| std::env::var("USERPROFILE"))
157+
.unwrap_or_default();
164158
if Home.is_empty() {
165159
return;
166160
}
167-
let Path = std::path::PathBuf::from(Home).join(".land").join("workspaces").join("RecentlyOpened.json");
161+
let Path = std::path::PathBuf::from(Home)
162+
.join(".land")
163+
.join("workspaces")
164+
.join("RecentlyOpened.json");
168165
let mut Current:serde_json::Map<String, serde_json::Value> = std::fs::read_to_string(&Path)
169166
.ok()
170167
.and_then(|Contents| serde_json::from_str::<serde_json::Value>(&Contents).ok())

Source/ApplicationState/State/WorkspaceState/WorkspaceState.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -151,20 +151,15 @@ impl State {
151151
match self.WorkspaceFolders.lock() {
152152
Ok(mut guard) => {
153153
let Old = guard.clone();
154-
let OldUris:std::collections::HashSet<String> =
155-
Old.iter().map(|F| F.URI.to_string()).collect();
156-
let NewUris:std::collections::HashSet<String> =
157-
folders.iter().map(|F| F.URI.to_string()).collect();
154+
let OldUris:std::collections::HashSet<String> = Old.iter().map(|F| F.URI.to_string()).collect();
155+
let NewUris:std::collections::HashSet<String> = folders.iter().map(|F| F.URI.to_string()).collect();
158156
let Added:Vec<WorkspaceFolderStateDTO> = folders
159157
.iter()
160158
.filter(|F| !OldUris.contains(&F.URI.to_string()))
161159
.cloned()
162160
.collect();
163-
let Removed:Vec<WorkspaceFolderStateDTO> = Old
164-
.iter()
165-
.filter(|F| !NewUris.contains(&F.URI.to_string()))
166-
.cloned()
167-
.collect();
161+
let Removed:Vec<WorkspaceFolderStateDTO> =
162+
Old.iter().filter(|F| !NewUris.contains(&F.URI.to_string())).cloned().collect();
168163
*guard = folders;
169164
dev_log!(
170165
"workspaces",

Source/Binary/Extension/ExtensionPopulate.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
//!
33
//! Scans and populates extensions from configured scan paths.
44
5-
use crate::{
6-
ApplicationState::ApplicationState,
7-
dev_log,
8-
};
5+
use crate::{ApplicationState::ApplicationState, dev_log};
96

107
/// Scans and populates extensions from the configured scan paths.
118
///
@@ -33,7 +30,12 @@ pub async fn ExtensionPopulate(
3330
ApplicationHandle:tauri::AppHandle,
3431
AppState:&std::sync::Arc<ApplicationState>,
3532
) -> Result<(), String> {
36-
match crate::ApplicationState::Internal::ExtensionScanner::ScanAndPopulateExtensions::ScanAndPopulateExtensions(ApplicationHandle.clone(), &AppState.Extension).await {
33+
match crate::ApplicationState::Internal::ExtensionScanner::ScanAndPopulateExtensions::ScanAndPopulateExtensions(
34+
ApplicationHandle.clone(),
35+
&AppState.Extension,
36+
)
37+
.await
38+
{
3739
Ok(()) => {
3840
dev_log!(
3941
"extensions",

Source/Binary/Extension/ScanPathConfigure.rs

Lines changed: 52 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Source/Binary/IPC/WorkspaceFolderCommand.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,7 @@ pub struct WorkspaceFolderPayload {
5252

5353
impl From<&WorkspaceFolderStateDTO> for WorkspaceFolderPayload {
5454
fn from(Dto:&WorkspaceFolderStateDTO) -> Self {
55-
Self {
56-
Uri:Dto.URI.to_string(),
57-
Name:Dto.Name.clone(),
58-
Index:Dto.Index,
59-
}
55+
Self { Uri:Dto.URI.to_string(), Name:Dto.Name.clone(), Index:Dto.Index }
6056
}
6157
}
6258

Source/Binary/Initialize/CliParse.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,7 @@ pub fn ParseWorkspaceFolders() -> Vec<PathBuf> {
123123
.into_iter()
124124
.filter_map(|Path| {
125125
if !Path.is_dir() {
126-
eprintln!(
127-
"[LandFix:WsInit] Skipping non-directory workspace folder: {}",
128-
Path.display()
129-
);
126+
eprintln!("[LandFix:WsInit] Skipping non-directory workspace folder: {}", Path.display());
130127
return None;
131128
}
132129
Path.canonicalize().ok().or(Some(Path))

Source/Binary/Main/AppLifecycle.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,7 @@ pub fn AppLifecycleSetup(
285285
Parsed = serde_json::json!({});
286286
}
287287
if let Some(Obj) = Parsed.as_object_mut() {
288-
Obj.insert(
289-
"security.workspace.trust.enabled".to_string(),
290-
serde_json::Value::Bool(false),
291-
);
288+
Obj.insert("security.workspace.trust.enabled".to_string(), serde_json::Value::Bool(false));
292289
}
293290
if let Ok(Serialized) = serde_json::to_string_pretty(&Parsed) {
294291
let _ = std::fs::write(&SettingsPath, Serialized);
@@ -409,10 +406,7 @@ pub fn AppLifecycleSetup(
409406
// server + Cocoon sidecar + extension scan have all finished. Wind's
410407
// `TauriChannel("lifecycle").listen("onDidChangePhase")` subscribers
411408
// fire so long-running services can start pulling.
412-
AppStateForSetup
413-
.Feature
414-
.Lifecycle
415-
.AdvanceAndBroadcast(2, &PostSetupAppHandle);
409+
AppStateForSetup.Feature.Lifecycle.AdvanceAndBroadcast(2, &PostSetupAppHandle);
416410

417411
// Schedule a background transition to Restored (3), then Eventually
418412
// (4). Sky/Wind are the authoritative signal — they call
@@ -439,8 +433,8 @@ pub fn AppLifecycleSetup(
439433
if LifecycleStateClone.GetPhase() < 3 {
440434
dev_log!(
441435
"lifecycle",
442-
"[Lifecycle] [Fallback] Sky did not advance to Restored within 8s; Mountain \
443-
auto-advancing (current phase={})",
436+
"[Lifecycle] [Fallback] Sky did not advance to Restored within 8s; Mountain auto-advancing \
437+
(current phase={})",
444438
LifecycleStateClone.GetPhase()
445439
);
446440
LifecycleStateClone.AdvanceAndBroadcast(3, &AppHandleForPhase);
@@ -449,8 +443,8 @@ pub fn AppLifecycleSetup(
449443
if LifecycleStateClone.GetPhase() < 4 {
450444
dev_log!(
451445
"lifecycle",
452-
"[Lifecycle] [Fallback] Sky did not advance to Eventually within 23s total; \
453-
Mountain auto-advancing (current phase={})",
446+
"[Lifecycle] [Fallback] Sky did not advance to Eventually within 23s total; Mountain \
447+
auto-advancing (current phase={})",
454448
LifecycleStateClone.GetPhase()
455449
);
456450
LifecycleStateClone.AdvanceAndBroadcast(4, &AppHandleForPhase);

0 commit comments

Comments
 (0)