8888// --------------------------------------------------------------------------------------------
8989
9090use std:: {
91- collections:: HashMap ,
92-
9391 // For Path::extension()
9492 ffi:: OsStr ,
9593
9694 path:: { Path , PathBuf } ,
9795
98- sync:: { Arc , Mutex as StdMutex , MutexGuard } ,
99-
100- // Standard library Duration
101- time:: Duration as StdDuration ,
96+ sync:: { Arc , MutexGuard } ,
10297} ;
10398
10499// Common effect traits and error types from Land_Common
@@ -172,17 +167,14 @@ use Land_Common::{
172167use async_trait:: async_trait;
173168use log:: { debug, error, info, trace, warn} ;
174169// For DTOs used in UiProvider event payloads
175- use serde:: { Deserialize , Serialize } ;
170+ use serde:: Serialize ;
176171use serde_json:: { Map as JsonMap , Value , json} ;
177172// Tauri essentials
178- use tauri:: { AppHandle , Manager , Runtime as TauriRuntime , State , Window , Wry } ;
173+ use tauri:: { AppHandle , Emitter , Manager , State , Wry } ;
179174use tokio:: {
180175 // Tokio's async filesystem operations
181176 fs,
182177
183- // For File::write_all
184- io:: AsyncWriteExt ,
185-
186178 // For UiProvider async request-response with Sky
187179 sync:: oneshot as TokioOneshot ,
188180
@@ -207,14 +199,6 @@ use crate::{
207199 LanguageProviderType as AppStateLanguageProviderType ,
208200
209201 MementoStorageMap ,
210-
211- MergedConfigurationState ,
212-
213- OutputChannelState ,
214-
215- ProviderRegistration ,
216-
217- WorkspaceFolderState ,
218202 } ,
219203
220204 // Access to various handler modules
@@ -862,7 +846,7 @@ impl FsWriter for MountainEnvironment {
862846 // TODO: Emit filesystem_changed event via AppHandle. This is important if this
863847 // write bypasses higher-level document management logic that would
864848 // normally emit such events. Example:
865- // self.app_handle.emit_all ("mountain://filesystem/changed", json!({"uri":
849+ // self.app_handle.emit ("mountain://filesystem/changed", json!({"uri":
866850 // path_to_uri(path), "type": "changed"}));
867851
868852 Ok ( ( ) )
@@ -2317,7 +2301,7 @@ impl UiProvider for MountainEnvironment {
23172301 if use_simple_dialog {
23182302 let window_main = self
23192303 . app_handle
2320- . get_window ( "main" )
2304+ . get_webview_window ( "main" )
23212305 . ok_or_else ( || CommonError :: UiInteraction ( "Main window not found for simple dialog." . to_string ( ) ) ) ?;
23222306
23232307 let title_str = format ! ( "Land Editor - {}" , severity_str. to_uppercase( ) ) ;
@@ -2379,7 +2363,7 @@ impl UiProvider for MountainEnvironment {
23792363 } ;
23802364
23812365 self . app_handle
2382- . emit_all ( "sky://ui/show-message-request" , sky_event_full_payload)
2366+ . emit ( "sky://ui/show-message-request" , sky_event_full_payload)
23832367 . map_err ( |e_emit| {
23842368 CommonError :: UiInteraction ( format ! ( "Failed to emit 'sky://ui/show-message-request' event: {}" , e_emit) )
23852369 } ) ?;
@@ -2467,7 +2451,7 @@ impl UiProvider for MountainEnvironment {
24672451 let event_payload = UiRequestToSkyPayload { request_id : request_id. clone ( ) , payload : options. clone ( ) } ;
24682452
24692453 self . app_handle
2470- . emit_all ( "sky://ui/show-open-dialog-request" , event_payload)
2454+ . emit ( "sky://ui/show-open-dialog-request" , event_payload)
24712455 . map_err ( |e| CommonError :: UiInteraction ( format ! ( "Failed to emit show_open_dialog request: {}" , e) ) ) ?;
24722456
24732457 let result = match tokio_timeout ( TokioDuration :: from_secs ( 300 ) , rx) . await {
@@ -2535,7 +2519,7 @@ impl UiProvider for MountainEnvironment {
25352519 let event_payload = UiRequestToSkyPayload { request_id : request_id. clone ( ) , payload : options. clone ( ) } ;
25362520
25372521 self . app_handle
2538- . emit_all ( "sky://ui/show-save-dialog-request" , event_payload)
2522+ . emit ( "sky://ui/show-save-dialog-request" , event_payload)
25392523 . map_err ( |e| CommonError :: UiInteraction ( format ! ( "Failed to emit show_save_dialog request: {}" , e) ) ) ?;
25402524
25412525 let result = match tokio_timeout ( TokioDuration :: from_secs ( 300 ) , rx) . await {
@@ -2610,7 +2594,7 @@ impl UiProvider for MountainEnvironment {
26102594 let event_payload = UiRequestToSkyPayload { request_id : request_id. clone ( ) , payload : payload_data } ;
26112595
26122596 self . app_handle
2613- . emit_all ( "sky://ui/show-quick-pick-request" , event_payload)
2597+ . emit ( "sky://ui/show-quick-pick-request" , event_payload)
26142598 . map_err ( |e| CommonError :: UiInteraction ( format ! ( "Failed to emit show_quick_pick request: {}" , e) ) ) ?;
26152599
26162600 let result = match tokio_timeout ( TokioDuration :: from_secs ( 300 ) , rx) . await {
@@ -2689,7 +2673,7 @@ impl UiProvider for MountainEnvironment {
26892673 let event_payload = UiRequestToSkyPayload { request_id : request_id. clone ( ) , payload : options. clone ( ) } ;
26902674
26912675 self . app_handle
2692- . emit_all ( "sky://ui/show-input-box-request" , event_payload)
2676+ . emit ( "sky://ui/show-input-box-request" , event_payload)
26932677 . map_err ( |e| CommonError :: UiInteraction ( format ! ( "Failed to emit show_input_box request: {}" , e) ) ) ?;
26942678
26952679 let result = match tokio_timeout ( TokioDuration :: from_secs ( 300 ) , rx) . await {
@@ -3055,7 +3039,7 @@ impl CommandExecutor for MountainEnvironment {
30553039
30563040 let main_window = self
30573041 . app_handle
3058- . get_window ( "main" )
3042+ . get_webview_window ( "main" )
30593043 . ok_or_else ( || CommonError :: UiInteraction ( "Main window not found for command execution" . to_string ( ) ) ) ?;
30603044
30613045 let app_runtime_state = self . app_handle . state :: < Arc < AppRuntime > > ( ) ;
0 commit comments