id stringlengths 20 30 | source stringclasses 1
value | chunk_index int64 0 520k | token_count int32 154 512 | content stringlengths 185 57.5k |
|---|---|---|---|---|
rust_dataset_chunk_508400 | rust_dataset.txt | 508,400 | 512 | language_selector::ActiveBufferLanguage::new(workspace));
let active_toolchain_language =
cx.new(|cx| toolchain_selector::ActiveToolchain::new(workspace, window, cx));
let vim_mode_indicator = cx.new(|cx| vim::ModeIndicator::new(window, cx));
let pending_keystrokes_indicator =
... |
rust_dataset_chunk_508401 | rust_dataset.txt | 508,401 | 512 | (vim_mode_indicator, window, cx);
status_bar.add_right_item(pending_keystrokes_indicator, window, cx);
});
let panels_task = initialize_panels(window, cx);
workspace.set_panels_task(panels_task);
register_actions(app_state.clone(), workspace, window, cx);
if !worksp... |
rust_dataset_chunk_508402 | rust_dataset.txt | 508,402 | 512 | }
})
.detach()
}
}
fn show_software_emulation_warning_if_needed(
specs: gpui::GpuSpecs,
window: &mut Window,
cx: &mut Context<Workspace>,
) {
if specs.is_software_emulated && std::env::var("ZED_ALLOW_EMULATED_GPU").is_err() {
let (graphics_api, docs_url, open_url) = if cfg!... |
rust_dataset_chunk_508403 | rust_dataset.txt | 508,403 | 512 | ::Result<Entity<impl workspace::Panel>>> + 'static,
workspace_handle: WeakEntity<Workspace>,
mut cx: gpui::AsyncWindowContext,
) {
if let Some(panel) = panel_task.await.context("failed to load panel").log_err()
{
workspace_handle
... |
rust_dataset_chunk_508404 | rust_dataset.txt | 508,404 | 512 | workspace.remove_panel::<P>(&existing_panel, window, cx);
Task::ready(Ok(()))
}
_ => Task::ready(Ok(())),
}
}
fn ensure_agent_panel_for_workspace(
workspace: &mut Workspace,
source_workspace: Option<WeakEntity<Workspace>>,
window: &mut Window,
cx: &mut Context<Workspace... |
rust_dataset_chunk_508405 | rust_dataset.txt | 508,405 | 512 | Arc<AppState>,
workspace: &mut Workspace,
_: &mut Window,
cx: &mut Context<Workspace>,
) {
workspace
.register_action(|_, _: &OpenDocs, _, cx| cx.open_url(DOCS_URL))
.register_action(|_, _: &OpenStatusPage, _, cx| cx.open_url(STATUS_URL))
.register_action(|_, _: &GetMerch, _, cx... |
rust_dataset_chunk_508406 | rust_dataset.txt | 508,406 | 512 | clone();
cx.spawn_in(window, async move |workspace, cx| {
let language = language.await.log_err();
let buffer = project
.update(cx, |project, cx| {
project.create_buffer(language, true, cx)
... |
rust_dataset_chunk_508407 | rust_dataset.txt | 508,407 | 512 | ZedUrl, _, cx| {
OpenListener::global(cx).open(RawOpenRequest {
urls: vec![String::from(&*action.url)],
..Default::default()
})
})
.register_action(|workspace, _: &OpenUrlPrompt, window, cx| {
workspace.toggle_modal(window, cx, |window,... |
rust_dataset_chunk_508408 | rust_dataset.txt | 508,408 | 512 | action: &zed_actions::OpenRemote, window, cx| {
if !action.from_existing_connection {
cx.propagate();
return;
}
// You need existing remote connection to open it this way
if workspace.project().read(cx).is_local() {
return;... |
rust_dataset_chunk_508409 | rust_dataset.txt | 508,409 | 512 | cx| {
let ui_font_size = ThemeSettings::get_global(cx).ui_font_size(cx) - px(1.0);
let _ = settings
.theme
.ui_font_size
.insert(f32::from(theme_settings::clamp_font_size(ui_font_size)).i... |
rust_dataset_chunk_508410 | rust_dataset.txt | 508,410 | 512 | {
settings.theme.buffer_font_size = None;
});
} else {
theme_settings::reset_buffer_font_size(cx);
}
}
})
.register_action({
let fs = app_state.fs.clone();
move |_, action... |
rust_dataset_chunk_508411 | rust_dataset.txt | 508,411 | 512 | ab_ui::collab_panel::ToggleFocus,
window: &mut Window,
cx: &mut Context<Workspace>| {
workspace.toggle_panel_focus::<collab_ui::collab_panel::CollabPanel>(window, cx);
},
)
.register_action(
|workspace: &mut Workspace,
_: &te... |
rust_dataset_chunk_508412 | rust_dataset.txt | 508,412 | 512 | update_in(cx, |workspace, window, cx| {
workspace.open_path(
buffer
.read(cx)
.project_path(cx)
.expect("Settings file must have a location"),
... |
rust_dataset_chunk_508413 | rust_dataset.txt | 508,413 | 512 | | {
search::BufferSearchBar::new(
Some(workspace.project().read(cx).languages().clone()),
window,
cx,
)
});
toolbar.add_item(buffer_search_bar.clone(), window, cx);
let quick_action_bar =
... |
rust_dataset_chunk_508414 | rust_dataset.txt | 508,414 | 512 | .add_item(branch_diff_toolbar, window, cx);
let solo_diff_git_toolbar = cx.new(SoloDiffGitToolbar::new);
toolbar.add_item(solo_diff_git_toolbar, window, cx);
let commit_view_toolbar = cx.new(|_| CommitViewToolbar::new());
toolbar.add_item(commit_view_toolbar, window, cx);... |
rust_dataset_chunk_508415 | rust_dataset.txt | 508,415 | 512 | filter(|commit| !commit.is_empty())
.map(SharedString::from);
Self {
focus_handle: cx.focus_handle(),
ok_entry: NavigableEntry::focusable(cx),
copy_entry: NavigableEntry::focusable(cx),
app_icon: about_window_icon(release_chann... |
rust_dataset_chunk_508416 | rust_dataset.txt | 508,416 | 512 | ("Version")
.color(Color::Muted)
.size(LabelSize::XSmall),
)
.child(Label::new(self.full_version.clone()).size(LabelSize::Small)),
)
.child(
... |
rust_dataset_chunk_508417 | rust_dataset.txt | 508,417 | 512 | 300.),
};
let display_id = cx.active_display().map(|display| display.id());
cx.open_window(
WindowOptions {
titlebar: Some(TitlebarOptions {
title: Some("About Zed".into()),
appears_transparent: true,
traffic_light_position: Some(point(px(... |
rust_dataset_chunk_508418 | rust_dataset.txt | 508,418 | 512 | to quit?",
None,
&["Quit", "Cancel"],
cx,
)
})
.log_err();
if let Some(answer) = answer {
WAITING_QUIT_CONFIRMATION.store(true, atomic::Ordering::Release);
... |
rust_dataset_chunk_508419 | rust_dataset.txt | 508,419 | 512 | path \
{}: {e:#}",
paths::log_file().display()
),
cx,
)
})
... |
rust_dataset_chunk_508420 | rust_dataset.txt | 508,420 | 512 | into());
let showed_parse_error = match error {
Some(error) => {
if let Some(InvalidSettingsError::LocalSettings { .. }) =
error.downcast_ref::<InvalidSettingsError>()
{
false
// Local settings errors are displayed by the projects
... |
rust_dataset_chunk_508421 | rust_dataset.txt | 508,421 | 512 | {
(result, "debug scenarios", |window, cx| {
window.dispatch_action(OpenDebugTasks.boxed_clone(), cx)
})
}
_ => return,
};
let id = NotificationId::Named(format!("invalid-global-{file_kind}-file").in... |
rust_dataset_chunk_508422 | rust_dataset.txt | 508,422 | 512 | Appearance::Light => gpui::WindowAppearance::Light,
theme::Appearance::Dark => gpui::WindowAppearance::Dark,
}),
};
cx.set_window_appearance(appearance);
};
apply(cx);
cx.observe_global::<SettingsStore>(apply).detach();
}
#[derive(Copy, Clone, Debug, settings::Re... |
rust_dataset_chunk_508423 | rust_dataset.txt | 508,423 | 512 | |settings_file, result, cx| {
let is_user = matches!(settings_file, SettingsFile::User);
let migrating_in_memory =
matches!(&result.migration_status, MigrationStatus::Succeeded);
notify_settings_errors(result, is_user, cx);
if let Some(notifier) = Migrati... |
rust_dataset_chunk_508424 | rust_dataset.txt | 508,424 | 512 | _layout().id().to_string();
cx.on_keyboard_layout_change(move |cx| {
let next_layout_id = cx.keyboard_layout().id();
if next_layout_id != current_layout_id {
current_layout_id = next_layout_id.to_string();
keyboard_layout_tx.unbounded_send(()).ok();
... |
rust_dataset_chunk_508425 | rust_dataset.txt | 508,425 | 512 | {
reload_keymaps(cx, key_bindings);
}
show_keymap_file_load_error(notification_id.clone(), error_message, cx);
}
KeymapFileLoadResult::JsonParseFailure { error } => {
show_keymap_... |
rust_dataset_chunk_508426 | rust_dataset.txt | 508,426 | 512 | _all("notification-cache"))
.child(div().text_ui(cx).child(MarkdownElement::new(
markdown.clone(),
MarkdownStyle::themed(MarkdownFont::Editor, window, cx),
)))
.into_any()
})
.primary_mess... |
rust_dataset_chunk_508427 | rust_dataset.txt | 508,427 | 512 | ,
)
.unwrap(),
);
}
/// Namespaces of actions that are part of an AI feature. When the user opts out
/// of AI via the `disable_ai` setting, bindings to these actions are dropped so
/// that lower-precedence editor defaults (e.g. `editor::NewlineBelow` for
/// `ctrl-enter`) can fire instead of bein... |
rust_dataset_chunk_508428 | rust_dataset.txt | 508,428 | 512 | bool,
window: &mut Window,
cx: &mut Context<Workspace>,
) -> Task<anyhow::Result<()>> {
let app_state = workspace.app_state().clone();
let Some(ssh_client) = workspace.project().read(cx).remote_client() else {
return Task::ready(Err(anyhow::anyhow!("Not an ssh project")));
};
let connec... |
rust_dataset_chunk_508429 | rust_dataset.txt | 508,429 | 512 | _WORKTREE is the original repository's working directory.
"label": "Set up new worktree",
"command": "echo \"Setting up $ZED_WORKTREE_ROOT — edit this command\"",
"cwd": "$ZED_WORKTREE_ROOT",
"hooks": ["create_worktree"]
}"#;
let Some(open_task) = open_local_file(
workspace,
local... |
rust_dataset_chunk_508430 | rust_dataset.txt | 508,430 | 512 | , async move |workspace, cx| {
// Check if the file actually exists on disk (even if it's excluded from worktree)
let file_exists = {
let full_path = worktree.read_with(cx, |tree, _| {
tree.abs_path().join(settings_relative_path.as_std_path())
... |
rust_dataset_chunk_508431 | rust_dataset.txt | 508,431 | 512 | static, str>,
title: &'static str,
language: &'static str,
window: &mut Window,
cx: &mut Context<Workspace>,
) {
let existing = workspace.items_of_type::<Editor>(cx).find(|editor| {
editor.read_with(cx, |editor, cx| {
editor.read_only(cx)
&& editor.title(cx).as_re... |
rust_dataset_chunk_508432 | rust_dataset.txt | 508,432 | 512 |
.update_in(cx, |workspace, window, cx| {
workspace.with_local_or_wsl_workspace(window, cx, move |workspace, window, cx| {
let project = workspace.project().clone();
cx.spawn_in(window, async move |workspace, cx| {
let config_d... |
rust_dataset_chunk_508433 | rust_dataset.txt | 508,433 | 512 |
.read(cx)
.path_to_extension_theme(&theme_name.0)
})
.flatten()
.map(LoadTarget::Theme),
theme_registry
.get_icon_theme(&icon_theme_name.0)
.is_err()
.then(|| {
extension_store
... |
rust_dataset_chunk_508434 | rust_dataset.txt | 508,434 | 512 | ;
use collections::HashSet;
use editor::{
DisplayPoint, Editor, MultiBufferOffset, SelectionEffects, display_map::DisplayRow,
};
use extension::ExtensionHostProxy;
use fs::FakeFs;
use gpui::{
Action, AnyWindowHandle, App, AssetSource, BorrowAppContext, Modifiers, OwnedMenuItem,
... |
rust_dataset_chunk_508435 | rust_dataset.txt | 508,435 | 512 | init_test(cx);
set_file_scan_depth(cx, 1);
let fs = app_state.fs.as_fake();
fs.insert_tree(
path!("/root"),
json!({
"junk": {
"a": {
"b": {
"deep.txt": ""
}
... |
rust_dataset_chunk_508436 | rust_dataset.txt | 508,436 | 512 | !("/root"),
json!({
"a": {
},
}),
)
.await;
cx.update(|cx| {
open_paths(
&[PathBuf::from(path!("/root/a/new"))],
app_state.clone(),
workspace::OpenOptions:... |
rust_dataset_chunk_508437 | rust_dataset.txt | 508,437 | 512 | ("/project"))],
app_state,
OpenOptions::default(),
&mut async_cx,
)
.await
.expect("opening the initial remote project should succeed");
executor.run_until_parked();
assert_eq!(cx.update(|cx| cx.windows().len()), 1);
let window = cx.up... |
rust_dataset_chunk_508438 | rust_dataset.txt | 508,438 | 512 | {
store.update_user_settings(cx, |settings| {
settings.workspace.use_system_path_prompts = Some(true);
settings.workspace.default_open_behavior = Some(DefaultOpenBehavior::NewWindow);
});
});
assert_eq!(cx.windows().len(), 0);
cx.update(|c... |
rust_dataset_chunk_508439 | rust_dataset.txt | 508,439 | 512 | multi_workspace_1 = cx
.read(|cx| cx.windows()[0].downcast::<MultiWorkspace>())
.unwrap();
cx.run_until_parked();
multi_workspace_1
.update(cx, |multi_workspace, window, cx| {
multi_workspace.workspace().update(cx, |workspace, cx| {
... |
rust_dataset_chunk_508440 | rust_dataset.txt | 508,440 | 512 | .insert_tree(
path!("/root"),
json!({"a": "hey", "b": "", "dir": {"c": "f"}}),
)
.await;
cx.update(|cx| {
open_paths(
&[PathBuf::from(path!("/root/dir"))],
app_state.clone(),
workspac... |
rust_dataset_chunk_508441 | rust_dataset.txt | 508,441 | 512 | ::from(path!("/root/dir1/a"))],
app_state.clone(),
workspace::OpenOptions::default(),
cx,
)
})
.await
.unwrap();
assert_eq!(cx.update(|cx| cx.windows().len()), 1);
cx.update(|cx| {
open_paths(
... |
rust_dataset_chunk_508442 | rust_dataset.txt | 508,442 | 512 | .get_or_insert_default()
.restore_unsaved_buffers = Some(false)
});
});
});
app_state
.fs
.as_fake()
.insert_tree(path!("/root"), json!({"a": "hey"}))
.await;
cx.update(|cx| {
open_... |
rust_dataset_chunk_508443 | rust_dataset.txt | 508,443 | 512 | .unwrap();
assert!(window_is_edited(window, cx));
let weak = editor.downgrade();
// Closing the item restores the window's edited state.
let close = window
.update(cx, |_, window, cx| {
pane.update(cx, |pane, cx| {
drop(editor)... |
rust_dataset_chunk_508444 | rust_dataset.txt | 508,444 | 512 | arked();
assert_eq!(cx.update(|cx| cx.windows().len()), 1);
// The window is successfully closed after the user dismisses the prompt.
cx.simulate_prompt_answer("Don't Save");
executor.run_until_parked();
assert_eq!(cx.update(|cx| cx.windows().len()), 0);
}
#[ignore = "T... |
rust_dataset_chunk_508445 | rust_dataset.txt | 508,445 | 512 | .unwrap();
cx.run_until_parked();
assert!(window_is_edited(window, cx));
// Advance the clock to make sure the workspace is serialized
cx.executor().advance_clock(Duration::from_secs(1));
// When closing the window, no prompt shows up and the window is closed.
// buff... |
rust_dataset_chunk_508446 | rust_dataset.txt | 508,446 | 512 |
.unwrap();
cx.run_until_parked();
let multi_workspace = cx
.update(|cx| cx.windows().first().unwrap().downcast::<MultiWorkspace>())
.unwrap();
let editor = multi_workspace
.update(cx, |multi_workspace, _, cx| {
multi_workspace.worksp... |
rust_dataset_chunk_508447 | rust_dataset.txt | 508,447 | 512 | .workspace().read(cx);
let expected_items =
usize::from(on_new_window == settings::OnNewWindow::EmptyTab);
assert_eq!(workspace.items(cx).count(), expected_items);
assert_eq!(workspace.active_pane().read(cx).items_len(), expected_items)... |
rust_dataset_chunk_508448 | rust_dataset.txt | 508,448 | 512 | _tab"],
None,
false,
),
(readme, vec!["markdown"], Some("markdown/readme.md"), true),
(
readme,
vec!["extensionless"],
Some("extensionless/Readme"),
true,
),
(readm... |
rust_dataset_chunk_508449 | rust_dataset.txt | 508,449 | 512 | server_cx.update(|cx| {
release_channel::init(Version::new(0, 0, 0), cx);
HeadlessProject::init(cx);
});
let remote_fs = FakeFs::new(server_cx.executor());
for (name, explicit_file, expected_file) in [
("directory", None, Some("README.md")),
("exp... |
rust_dataset_chunk_508450 | rust_dataset.txt | 508,450 | 512 | arked();
}
}
#[gpui::test]
async fn test_open_paths_readme_after_restoration(cx: &mut TestAppContext) {
let app_state = init_test(cx);
for restore_item in [false, true] {
set_on_new_window(Some(settings::OnNewWindow::Launchpad), cx);
let root = Path::new(path... |
rust_dataset_chunk_508451 | rust_dataset.txt | 508,451 | 512 | let root = Path::new(path!("/root"));
let result =
open_test_workspace_paths(vec![root.join("existing")], app_state.clone(), cx).await;
assert_workspace_item_paths(&result.workspace, &[], cx);
result
.window
.update(cx, |_, window, cx| {
... |
rust_dataset_chunk_508452 | rust_dataset.txt | 508,452 | 512 | as_ref()], cx).await;
project.update(cx, |project, _cx| project.languages().add(markdown_lang()));
let window = cx.add_window(|window, cx| MultiWorkspace::test_new(project, window, cx));
let workspace = window
.read_with(cx, |mw, _| mw.workspace().clone())
.unwrap();
... |
rust_dataset_chunk_508453 | rust_dataset.txt | 508,453 | 512 | );
assert_eq!(pane.items_len(), 2);
});
// Split the pane with the first entry, then open the second entry again.
window
.update(cx, |_, window, cx| {
workspace.update(cx, |w, cx| {
w.split_and_clone(w.active_pane().clone()... |
rust_dataset_chunk_508454 | rust_dataset.txt | 508,454 | 512 | "d.txt": ""
}),
)
.await;
cx.update(|cx| {
open_paths(
&[PathBuf::from(path!("/dir1/"))],
app_state,
workspace::OpenOptions::default(),
cx,
)
})
.a... |
rust_dataset_chunk_508455 | rust_dataset.txt | 508,455 | 512 | );
assert_eq!(
workspace
.active_pane()
.read(cx)
.active_item()
.unwrap()
.act_as::<Editor>(cx)
.unwrap()
.read(cx)
.title(cx),
... |
rust_dataset_chunk_508456 | rust_dataset.txt | 508,456 | 512 | (
workspace,
Path::new(path!("/dir3")),
rel_path("c.txt"),
cx,
);
let worktree_roots = workspace
.worktrees(cx)
.map(|w| w.read(cx).as_local().unwrap().abs_path().as_ref())
.collect::<... |
rust_dataset_chunk_508457 | rust_dataset.txt | 508,457 | 512 | .txt"), path!("/dir3")]
.into_iter()
.map(Path::new)
.collect(),
);
assert_eq!(
workspace
.active_pane()
.read(cx)
.active_item()
.unwrap()... |
rust_dataset_chunk_508458 | rust_dataset.txt | 508,458 | 512 | ")),
PathBuf::from(path!("/root/excluded_dir/ignored_subdir")),
];
let workspace::OpenResult {
window: opened_workspace,
opened_items: new_items,
..
} = cx
.update(|cx| {
workspace::open_paths(
&paths... |
rust_dataset_chunk_508459 | rust_dataset.txt | 508,459 | 512 | being present in the worktrees, buffers for excluded files are opened and added to the pane"
);
});
}
#[gpui::test]
async fn test_save_conflicting_item(cx: &mut TestAppContext) {
let app_state = init_test(cx);
app_state
.fs
.as_fake()
... |
rust_dataset_chunk_508460 | rust_dataset.txt | 508,460 | 512 | Overwrite");
save_task.await.unwrap();
window
.update(cx, |_, _, cx| {
editor.update(cx, |editor, cx| {
assert!(!editor.is_dirty(cx));
assert!(!editor.has_conflict(cx));
});
})
.unwrap();
}
... |
rust_dataset_chunk_508461 | rust_dataset.txt | 508,461 | 512 | (|parent_dir| {
assert_eq!(parent_dir, Path::new(path!("/root")));
Some(parent_dir.join("the-new-name.rs"))
});
cx.read(|cx| {
assert!(editor.is_dirty(cx));
assert_eq!(editor.read(cx).title(cx), "hi");
});
// When the save completes, the b... |
rust_dataset_chunk_508462 | rust_dataset.txt | 508,462 | 512 | | {
workspace.update(cx, |workspace, cx| {
workspace.open_path(
(worktree.read(cx).id(), rel_path("the-new-name.rs")),
None,
true,
window,
cx,
)... |
rust_dataset_chunk_508463 | rust_dataset.txt | 508,463 | 512 | _item(SaveIntent::Save, window, cx)
})
})
.unwrap();
cx.background_executor.run_until_parked();
cx.simulate_new_path_selection(|_| Some(PathBuf::from("/root/the-new-name.rs")));
save_task.await.unwrap();
// The buffer is not dirty anymore and the l... |
rust_dataset_chunk_508464 | rust_dataset.txt | 508,464 | 512 | unwrap().downcast::<Editor>().unwrap();
assert_eq!(editor.read(cx).active_project_path(cx), Some(file1.clone()));
let buffer = editor.update(cx, |editor, cx| {
editor.insert("dirt", window, cx);
editor.buffer().downgrade()
});
... |
rust_dataset_chunk_508465 | rust_dataset.txt | 508,465 | 512 | , cx));
let workspace = window
.read_with(cx, |mw, _| mw.workspace().clone())
.unwrap();
let cx = &mut VisualTestContext::from_window(*window, cx);
let mouse_position = point(px(250.), px(250.));
let event_modifiers = {
#[cfg(target_os = "macos")]
... |
rust_dataset_chunk_508466 | rust_dataset.txt | 508,466 | 512 | });
let increased_font_size =
cx.update(|_, cx| ThemeSettings::get_global(cx).buffer_font_size(cx).as_f32());
assert!(
increased_font_size > initial_font_size,
"Editor buffer font-size should have increased from scroll-zoom"
);
cx.update(|window, c... |
rust_dataset_chunk_508467 | rust_dataset.txt | 508,467 | 512 | 3\n".repeat(20),
},
}),
)
.await;
let project = Project::test(app_state.fs.clone(), [path!("/root").as_ref()], cx).await;
project.update(cx, |project, _cx| project.languages().add(markdown_lang()));
let window =
cx.add_wind... |
rust_dataset_chunk_508468 | rust_dataset.txt | 508,468 | 512 | 0)
..DisplayPoint::new(DisplayRow(12), 0)])
});
editor.newline(&Default::default(), window, cx);
editor.newline(&Default::default(), window, cx);
editor.move_down(&Default::default(), window, cx);
... |
rust_dataset_chunk_508469 | rust_dataset.txt | 508,469 | 512 | 0.)
);
// Go back one more time and ensure we don't navigate past the first item in the history.
workspace
.update_in(cx, |w, window, cx| {
w.go_back(w.active_pane().downgrade(), window, cx)
})
.await
.unwrap();
assert_eq!... |
rust_dataset_chunk_508470 | rust_dataset.txt | 508,470 | 512 | 12.5)
);
workspace
.update_in(cx, |w, window, cx| {
w.go_back(w.active_pane().downgrade(), window, cx)
})
.await
.unwrap();
assert_eq!(
active_location(&workspace, cx),
(file3.clone(), DisplayPoint::new(Disp... |
rust_dataset_chunk_508471 | rust_dataset.txt | 508,471 | 512 | Effects::no_scroll(), window, cx, |s| {
s.select_display_ranges([DisplayPoint::new(DisplayRow(3), 0)
..DisplayPoint::new(DisplayRow(3), 0)])
});
});
});
workspace.update_in(cx, |_, window, cx| {
... |
rust_dataset_chunk_508472 | rust_dataset.txt | 508,472 | 512 | Path, DisplayPoint, f64) {
workspace.update(cx, |workspace, cx| {
let item = workspace.active_item(cx).unwrap();
let editor = item.downcast::<Editor>().unwrap();
editor.update(cx, |editor_ref, cx| {
let selections = editor_ref
... |
rust_dataset_chunk_508473 | rust_dataset.txt | 508,473 | 512 | unwrap()
.item_id();
let file3_item_id = workspace
.update_in(cx, |w, window, cx| {
w.open_path(file3.clone(), None, true, window, cx)
})
.await
.unwrap()
.item_id();
let file4_item_id = workspace
.update... |
rust_dataset_chunk_508474 | rust_dataset.txt | 508,474 | 512 | (cx, Workspace::reopen_closed_item)
.await
.unwrap();
assert_eq!(active_path(&workspace, cx), Some(file2.clone()));
workspace
.update_in(cx, Workspace::reopen_closed_item)
.await
.unwrap();
assert_eq!(active_path(&workspace, cx), Some(... |
rust_dataset_chunk_508475 | rust_dataset.txt | 508,475 | 512 | `.
fn emacs_bindings_for(keystroke: &str, context: &str, cx: &mut TestAppContext) -> Vec<String> {
cx.update(|cx| {
let mut bindings = settings::KeymapFile::load_asset_allow_partial_failure(
"keymaps/default-linux.json",
cx,
)
.unwrap();
... |
rust_dataset_chunk_508476 | rust_dataset.txt | 508,476 | 512 | "ctrl-p should not fall through to file_finder::Toggle, got {ctrl_p:?}"
);
}
/// The unbind above only targets `workspace::NewFile` / `file_finder::Toggle`, so the narrower
/// `ctrl-n` and `ctrl-p` bindings still win where they apply.
#[gpui::test]
fn test_emacs_cursor_keys_kee... |
rust_dataset_chunk_508477 | rust_dataset.txt | 508,477 | 512 | Default::default(),
)
.await
.unwrap();
executor.run_until_parked();
cx.update(|cx| {
let (keymap_rx, keymap_watcher) = watch_config_file(
&executor,
app_state.fs.clone(),
PathBuf::from("/keym... |
rust_dataset_chunk_508478 | rust_dataset.txt | 508,478 | 512 | _state
.fs
.save(
paths::settings_file(),
&r#"{"base_keymap": "VSCode"}"#.into(),
Default::default(),
)
.await
.unwrap();
executor.run_until_parked();
window
.update(cx, |_, _, cx| {... |
rust_dataset_chunk_508479 | rust_dataset.txt | 508,479 | 512 | atcher) = watch_config_file(
&executor,
app_state.fs.clone(),
PathBuf::from("/keymap.json"),
);
watch_settings_files(app_state.fs.clone(), cx);
handle_keymap_file_changes(keymap_rx, keymap_watcher, cx);
});
cx.backgrou... |
rust_dataset_chunk_508480 | rust_dataset.txt | 508,480 | 512 |
.iter()
.filter_map(|action_name| {
let namespace = action_name
.split("::")
.collect::<Vec<_>>()
.into_iter()
.rev()
.skip(1)
... |
rust_dataset_chunk_508481 | rust_dataset.txt | 508,481 | 512 | ippets",
"stash_picker",
"svg",
"syntax_tree_view",
"tab_switcher",
"tabular_data",
"task",
"terminal",
"terminal_panel",
"text_finder",
"theme",
... |
rust_dataset_chunk_508482 | rust_dataset.txt | 508,482 | 512 | ();
let active_editor = multi_workspace
.update(cx, |multi_workspace, _, cx| {
multi_workspace
.workspace()
.update(cx, |workspace, cx| workspace.active_item_as::<Editor>(cx))
})
.unwrap();
assert!(
a... |
rust_dataset_chunk_508483 | rust_dataset.txt | 508,483 | 512 | (cx: &mut TestAppContext) {
let fs = fs::FakeFs::new(cx.background_executor.clone());
env_logger::builder().is_test(true).try_init().ok();
let settings = cx.update(SettingsStore::test);
cx.set_global(settings);
let languages = LanguageRegistry::test(cx.executor());
let la... |
rust_dataset_chunk_508484 | rust_dataset.txt | 508,484 | 512 | init(cx);
editor::init(cx);
collab_ui::init(&app_state, cx);
git_ui::init(cx);
project_panel::init(cx);
outline_panel::init(cx);
terminal_view::init(cx);
let credentials_provider = zed_credentials_provider::global(cx);
copil... |
rust_dataset_chunk_508485 | rust_dataset.txt | 508,485 | 512 | str, &dyn Action)>,
line: u32,
) {
let available_actions = cx
.update(|cx| window.update(cx, |_, window, cx| window.available_actions(cx)))
.unwrap();
for (key, action) in actions {
let bindings = cx
.update(|cx| window.update(cx, |_, wind... |
rust_dataset_chunk_508486 | rust_dataset.txt | 508,486 | 512 | assert!(
original_settings_str.contains("UNIQUEVALUE"),
"Test setup failed - settings file doesn't contain our marker"
);
// 3. Add .zed to file scan exclusions in user settings
cx.update_global::<SettingsStore, _>(|store, cx| {
store.update_user_sett... |
rust_dataset_chunk_508487 | rust_dataset.txt | 508,487 | 512 | new_content;
eprintln!("New settings content: {}", new_content_str);
// The bug causes the settings to be overwritten with empty settings
// So if the unique value is no longer present, the bug has been reproduced
let bug_exists = !new_content_str.contains("UNIQUEVALUE");
eprin... |
rust_dataset_chunk_508488 | rust_dataset.txt | 508,488 | 512 | notification_id = NotificationId::Named("invalid-global-tasks-file".into());
let shown_notifications = workspace.read_with(cx, |workspace, _| {
workspace
.notification_ids()
.into_iter()
.filter(|id| *id == notification_id)
.count()
... |
rust_dataset_chunk_508489 | rust_dataset.txt | 508,489 | 512 | map.bindings().find(|b| is_ai_keybinding(b)) {
panic!(
"expected no AI-namespaced bindings after disabling AI, but found `{}`",
binding.action().name()
);
}
});
// User-defined bindings to AI actions should also be filt... |
rust_dataset_chunk_508490 | rust_dataset.txt | 508,490 | 512 | window.activate_window();
});
cx.update(|cx| {
let open_options = OpenOptions {
wait: true,
..Default::default()
};
workspace::open_paths(&paths, app_state.clone(), open_options, cx)
})
... |
rust_dataset_chunk_508491 | rust_dataset.txt | 508,491 | 512 |
let project3 = Project::test(app_state.fs.clone(), [path!("/dir3").as_ref()], cx).await;
let workspace3 = window
.update(cx, |multi_workspace, window, cx| {
multi_workspace.test_add_workspace(project3.clone(), window, cx)
})
.unwrap();
let wo... |
rust_dataset_chunk_508492 | rust_dataset.txt | 508,492 | 512 | file in /dir2 - should switch to workspace 2
cx.update(|cx| {
open_paths(
&[PathBuf::from(path!("/dir2/b.txt"))],
app_state.clone(),
OpenOptions::default(),
cx,
)
})
.await
.unwrap();
cx.run... |
rust_dataset_chunk_508493 | rust_dataset.txt | 508,493 | 512 | item");
assert_eq!(active_item.tab_content_text(0, cx), "a.txt");
})
.unwrap();
assert_eq!(cx.windows().len(), 1, "Should still have only 1 window");
}
#[gpui::test]
async fn test_open_paths_in_gitignored_dir_opens_new_workspace(cx: &mut TestAppContext) {
... |
rust_dataset_chunk_508494 | rust_dataset.txt | 508,494 | 512 | ::<Vec<_>>(),
);
}
}
roots
})
.collect::<Vec<_>>()
});
assert!(
workspace_roots.contains(&vec![PathBuf::from(path!(
"/project/.checkouts/worktrees/foo"
... |
rust_dataset_chunk_508495 | rust_dataset.txt | 508,495 | 512 | , cx);
})
.unwrap();
// === Setup Window 2 with one workspace ===
let project3 = Project::test(app_state.fs.clone(), [path!("/dir3").as_ref()], cx).await;
let window2 = cx.add_window({
let project = project3.clone();
|window, cx| MultiWorkspace::t... |
rust_dataset_chunk_508496 | rust_dataset.txt | 508,496 | 512 | = window1
.update(cx, |_, window, cx| {
workspace1_1.update(cx, |workspace, cx| {
workspace.active_pane().update(cx, |pane, cx| {
pane.close_active_item(&Default::default(), window, cx)
})
})
})
... |
rust_dataset_chunk_508497 | rust_dataset.txt | 508,497 | 512 | _parked();
assert_eq!(
cx.windows().len(),
2,
"Case 2: Windows should still exist after cancelling quit"
);
// Clean up Case 2: Close the dirty item without saving
let close_task = window1
.update(cx, |_, window, cx| {
wor... |
rust_dataset_chunk_508498 | rust_dataset.txt | 508,498 | 512 | it to show dirty item)
assert_eq!(
cx.update(|cx| window2.is_active(cx)),
Some(true),
"Case 3: window2 should be activated when it has dirty item"
);
assert!(
cx.has_pending_prompt(),
"Case 3: Should prompt to save dirty item in non-a... |
rust_dataset_chunk_508499 | rust_dataset.txt | 508,499 | 512 | .update(cx, |multi_workspace, window, cx| {
multi_workspace.activate(workspace2.clone(), None, window, cx);
multi_workspace.activate(workspace1.clone(), None, window, cx);
})
.unwrap();
cx.run_until_parked();
let worktree2_id = project... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.