fix rebase add feature flag

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2025-04-01 12:34:42 -07:00
parent 198e7c4bd2
commit d122d7a224
2 changed files with 11 additions and 26 deletions

View File

@ -401,22 +401,14 @@ impl ExecutorContext {
} }
#[cfg(target_arch = "wasm32")] #[cfg(target_arch = "wasm32")]
pub async fn new( pub fn new(engine: Arc<Box<dyn EngineManager>>, fs: Arc<FileManager>, settings: ExecutorSettings) -> Self {
engine_manager: crate::engine::conn_wasm::EngineCommandManager, ExecutorContext {
fs_manager: crate::fs::wasm::FileSystemManager, engine,
settings: ExecutorSettings, fs,
) -> Result<Self, String> {
Ok(ExecutorContext {
engine: Arc::new(Box::new(
crate::engine::conn_wasm::EngineConnection::new(engine_manager)
.await
.map_err(|e| format!("{:?}", e))?,
)),
fs: Arc::new(FileManager::new(fs_manager)),
stdlib: Arc::new(StdLib::new()), stdlib: Arc::new(StdLib::new()),
settings, settings,
context_type: ContextType::Live, context_type: ContextType::Live,
}) }
} }
#[cfg(not(target_arch = "wasm32"))] #[cfg(not(target_arch = "wasm32"))]
@ -433,21 +425,14 @@ impl ExecutorContext {
} }
#[cfg(target_arch = "wasm32")] #[cfg(target_arch = "wasm32")]
pub async fn new_mock( pub fn new_mock(engine: Arc<Box<dyn EngineManager>>, fs: Arc<FileManager>, settings: ExecutorSettings) -> Self {
fs_manager: crate::fs::wasm::FileSystemManager, ExecutorContext {
settings: ExecutorSettings, engine,
) -> Result<Self, String> { fs,
Ok(ExecutorContext {
engine: Arc::new(Box::new(
crate::engine::conn_mock::EngineConnection::new()
.await
.map_err(|e| format!("{:?}", e))?,
)),
fs: Arc::new(FileManager::new(fs_manager)),
stdlib: Arc::new(StdLib::new()), stdlib: Arc::new(StdLib::new()),
settings, settings,
context_type: ContextType::Mock, context_type: ContextType::Mock,
}) }
} }
#[cfg(not(target_arch = "wasm32"))] #[cfg(not(target_arch = "wasm32"))]

View File

@ -24,7 +24,7 @@ kcl-lib = { path = "../kcl-lib" }
kittycad = { workspace = true } kittycad = { workspace = true }
kittycad-modeling-cmds = { workspace = true } kittycad-modeling-cmds = { workspace = true }
serde_json = { workspace = true } serde_json = { workspace = true }
tokio = { workspace = true, features = ["sync"] } tokio = { workspace = true, features = ["sync", "rt"] }
toml = "0.8.19" toml = "0.8.19"
tower-lsp = { workspace = true, features = ["runtime-agnostic"] } tower-lsp = { workspace = true, features = ["runtime-agnostic"] }
uuid = { workspace = true, features = ["v4", "js", "serde"] } uuid = { workspace = true, features = ["v4", "js", "serde"] }