Skip to content

Commit dd6cfb0

Browse files
refactor(Mountain): Align module paths and refine workspace search
- Updated ApplicationState to use concrete `Wry` runtime type for command handlers instead of trait objects, improving type safety and aligning with Tauri best practices - Corrected import paths for DTOs (`MarkerDataDTO`, `WorkSpaceEditDTO`) to match finalized module structure after Common crate reorganization - Fixed workspace file search logic by properly handling `IncludeMatcher` as Option in WorkSpaceProvider, preventing potential panics during workspace scans - Removed obsolete TODO comment after completing path refactoring in ApplicationState These changes strengthen Mountain's implementation of the `Common` crate abstractions (WorkSpaceProvider, DiagnosticManager) and ensure consistency with the finalized architecture. The workspace search fix specifically enhances the 'Opening Files' workflow reliability.
1 parent 78afce5 commit dd6cfb0

3 files changed

Lines changed: 8 additions & 11 deletions

File tree

Source/ApplicationState/ApplicationState.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use std::{
1616
};
1717

1818
use log::{error, info, warn};
19-
use tauri::{Manager, Runtime};
19+
use tauri::{Manager, Wry};
2020

2121
use super::{
2222
DTO::{
@@ -35,7 +35,7 @@ use super::{
3535
},
3636
Internal,
3737
};
38-
use crate::Environment::CommandProvider::CommandHandler; // TODO: Fix this path after refactor
38+
use crate::Environment::CommandProvider::CommandHandler;
3939

4040
/// The central, shared, thread-safe state for the entire Mountain application.
4141
///
@@ -58,7 +58,7 @@ pub struct ApplicationState {
5858
pub WorkSpaceMementoPath:Arc<StandardMutex<Option<PathBuf>>>,
5959

6060
// --- Extension & Provider Management ---
61-
pub CommandRegistry:Arc<StandardMutex<HashMap<String, CommandHandler<dyn Runtime>>>>,
61+
pub CommandRegistry:Arc<StandardMutex<HashMap<String, CommandHandler<Wry>>>>,
6262
pub LanguageProviders:Arc<StandardMutex<HashMap<u32, ProviderRegistrationDTO>>>,
6363
pub NextProviderHandle:Arc<AtomicU32>,
6464
pub ScannedExtensions:Arc<StandardMutex<HashMap<String, ExtensionDescriptionStateDTO>>>,

Source/Environment/DiagnosticProvider.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,14 @@
55
//! including storing diagnostics from various sources and notifying the UI of
66
//! changes.
77
8-
use Common::{
9-
Diagnostic::DiagnosticManager::DiagnosticManager,
10-
Error::CommonError::CommonError,
11-
LanguageFeature::DTO::MarkerDataDTO,
12-
};
8+
use Common::{Diagnostic::DiagnosticManager::DiagnosticManager, Error::CommonError::CommonError};
139
use async_trait::async_trait;
1410
use log::{debug, error, info};
1511
use serde_json::{Value, json};
1612
use tauri::Emitter;
1713

1814
use super::{MountainEnvironment::MountainEnvironment, Utility};
15+
use crate::ApplicationState::DTO::MarkerDataDTO::MarkerDataDTO;
1916

2017
#[async_trait]
2118
impl DiagnosticManager for MountainEnvironment {

Source/Environment/WorkSpaceProvider.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
use std::path::PathBuf;
99

1010
use Common::{
11+
DTO::WorkSpaceEditDTO::WorkSpaceEditDTO,
1112
Error::CommonError::CommonError,
12-
LanguageFeature::DTO::WorkSpaceEditDTO,
13-
WorkSpace::{WorkSpaceEditApplier, WorkSpaceProvider},
13+
WorkSpace::{WorkSpaceEditApplier::WorkSpaceEditApplier, WorkSpaceProvider::WorkSpaceProvider},
1414
};
1515
use async_trait::async_trait;
1616
use globset::{Glob, GlobMatcher};
@@ -132,7 +132,7 @@ impl WorkSpaceProvider for MountainEnvironment {
132132
if Path.is_dir() {
133133
continue;
134134
}
135-
if IncludeMatcher.is_match(Path) {
135+
if IncludeMatcher?.is_match(Path) {
136136
if let Some(ref Exclude) = ExcludeMatcher {
137137
if Exclude.is_match(Path) {
138138
continue;

0 commit comments

Comments
 (0)