Restore wasm_host.rs to origin/main

Richard Feldman created

Change summary

crates/extension_host/src/wasm_host.rs | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)

Detailed changes

crates/extension_host/src/wasm_host.rs 🔗

@@ -1,11 +1,9 @@
-pub mod llm_provider;
 pub mod wit;
 
 use crate::capability_granter::CapabilityGranter;
 use crate::{ExtensionManifest, ExtensionSettings};
 use anyhow::{Context as _, Result, anyhow, bail};
 use async_trait::async_trait;
-
 use dap::{DebugRequest, StartDebuggingRequestArgumentsRequest};
 use extension::{
     CodeLabel, Command, Completion, ContextServerConfiguration, DebugAdapterBinary,
@@ -66,7 +64,7 @@ pub struct WasmHost {
 
 #[derive(Clone, Debug)]
 pub struct WasmExtension {
-    tx: Arc<UnboundedSender<ExtensionCall>>,
+    tx: UnboundedSender<ExtensionCall>,
     pub manifest: Arc<ExtensionManifest>,
     pub work_dir: Arc<Path>,
     #[allow(unused)]
@@ -76,10 +74,7 @@ pub struct WasmExtension {
 
 impl Drop for WasmExtension {
     fn drop(&mut self) {
-        // Only close the channel when this is the last clone holding the sender
-        if Arc::strong_count(&self.tx) == 1 {
-            self.tx.close_channel();
-        }
+        self.tx.close_channel();
     }
 }
 
@@ -676,7 +671,7 @@ impl WasmHost {
             Ok(WasmExtension {
                 manifest,
                 work_dir,
-                tx: Arc::new(tx),
+                tx,
                 zed_api_version,
                 _task: task,
             })