Disable repl in non-local projects (#20397)

Release Notes:

- Disable REPL buttons and actions for remote projects and collaboration
(only the host should have access).
This commit is contained in:
Kyle Kelley 2024-11-08 06:29:07 -08:00 committed by GitHub
parent 187356ab9b
commit 09675d43b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 0 deletions

View file

@ -43,6 +43,16 @@ impl QuickActionBar {
let editor = self.active_editor()?;
let is_local_project = editor
.read(cx)
.workspace()
.map(|workspace| workspace.read(cx).project().read(cx).is_local())
.unwrap_or(false);
if !is_local_project {
return None;
}
let has_nonempty_selection = {
editor.update(cx, |this, cx| {
this.selections

View file

@ -61,6 +61,15 @@ pub fn init(cx: &mut AppContext) {
return;
}
let is_local_project = editor
.workspace()
.map(|workspace| workspace.read(cx).project().read(cx).is_local())
.unwrap_or(false);
if !is_local_project {
return;
}
let editor_handle = cx.view().downgrade();
editor