snippets: Fix `configure snippets` not opening on remote workspaces (#38790)

loczek created

Release Notes:

- Fixed `snippets: configure snippets` action not working on remote
workspaces

Change summary

crates/snippets_ui/src/snippets_ui.rs | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)

Detailed changes

crates/snippets_ui/src/snippets_ui.rs 🔗

@@ -221,15 +221,19 @@ impl PickerDelegate for ScopeSelectorDelegate {
 
                     workspace.update_in(cx, |workspace, window, cx| {
                         workspace
-                            .open_abs_path(
-                                snippets_dir().join(scope_file_name.with_extension()),
-                                OpenOptions {
-                                    visible: Some(OpenVisible::None),
-                                    ..Default::default()
-                                },
-                                window,
-                                cx,
-                            )
+                            .with_local_workspace(window, cx, |workspace, window, cx| {
+                                workspace
+                                    .open_abs_path(
+                                        snippets_dir().join(scope_file_name.with_extension()),
+                                        OpenOptions {
+                                            visible: Some(OpenVisible::None),
+                                            ..Default::default()
+                                        },
+                                        window,
+                                        cx,
+                                    )
+                                    .detach();
+                            })
                             .detach();
                     })
                 })