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_508200 | rust_dataset.txt | 508,200 | 512 | () = restore_wait => None,
};
let Some(request) = request else {
cx.spawn({
let app_state = app_state.clone();
async move |cx| {
handle_cli_connection((requests, responses)... |
rust_dataset_chunk_508201 | rust_dataset.txt | 508,201 | 512 | ::ExistingWindow)
),
})
}
fn of_cli_request(request: &cli::CliRequest, cx: &App) -> Option<Self> {
let cli::CliRequest::Open {
urls,
paths,
diff_paths,
diff_all,
wait,
wsl,
open_behavior,
... |
rust_dataset_chunk_508202 | rust_dataset.txt | 508,202 | 512 | , &paths).await;
let roots = outermost_paths(&paths);
let repositories = PathList::new(&repository_paths(fs, &roots).await);
Self {
paths,
roots,
repositories,
joins_restored_windows,
}
}
async fn opens(&self, fs: &dyn Fs, roots: &... |
rust_dataset_chunk_508203 | rust_dataset.txt | 508,203 | 512 | .paths
.iter()
.any(|path| roots.iter().any(|root| path.starts_with(root)))
});
}
let mut windows_to_restore = Vec::new();
for multi_workspace in multi_workspaces {
windows_to... |
rust_dataset_chunk_508204 | rust_dataset.txt | 508,204 | 512 | cx.update(|cx| window_of_project(project, cx)));
if let Some(window) = window {
window
.update(cx, |_, window, _| window.activate_window())
.log_err();
cx.spawn(async move |_| {
restoring.awa... |
rust_dataset_chunk_508205 | rust_dataset.txt | 508,205 | 512 | String {
if error_count == 1 {
"Failed to restore 1 workspace. Check logs for details.".to_string()
} else {
format!(
"Failed to restore {} workspaces. Check logs for details.",
error_count
)
}
}
fn show_toast_in_active_workspace(message: &str, cx: &mut App)... |
rust_dataset_chunk_508206 | rust_dataset.txt | 508,206 | 512 | })?;
if let Some(task) = panels_task {
task.await.log_err();
}
multi_workspace.update(cx, |multi_workspace, window, cx| {
multi_workspace.workspace().update(cx, |workspace, cx| {
if ... |
rust_dataset_chunk_508207 | rust_dataset.txt | 508,207 | 512 | workspace, cx| {
workspace.project().update(cx, |project, cx| {
project.create_buffer(json, false, cx)
})
})?;
let buffer = buffer_task.await?;
... |
rust_dataset_chunk_508208 | rust_dataset.txt | 508,208 | 512 | (cx.observe_in(&cx.entity(), window, {
let subscription = subscription.clone();
let repo_url = repo_url;
move |_, workspace_entity, window, cx| {
if window.is_window_active() && subscription.take().is_some() {
... |
rust_dataset_chunk_508209 | rust_dataset.txt | 508,209 | 512 | await
})
.detach_and_log_err(cx);
return;
}
let mut task = None;
let dev_container = request.dev_container;
if !request.open_paths.is_empty() || !request.diff_paths.is_empty() {
let app_state = app_state.clone();
let base_open_options = zed::open_options_for_requ... |
rust_dataset_chunk_508210 | rust_dataset.txt | 508,210 | 512 | ,
)
})?)
}
for result in future::join_all(promises).await {
result.notify_workspace_async_err(weak_workspace.clone(), cx);
}
anyhow::Ok(())
})
.await;
if le... |
rust_dataset_chunk_508211 | rust_dataset.txt | 508,211 | 512 | Ok(IdType::New(installation_id))
}
pub(crate) async fn restore_or_create_workspace(
app_state: Arc<AppState>,
cx: &mut AsyncApp,
) -> Result<()> {
let kvp = cx.update(|cx| KeyValueStore::global(cx));
if let Some(multi_workspaces) = restorable_workspaces(cx, &app_state).await {
let mut error_co... |
rust_dataset_chunk_508212 | rust_dataset.txt | 508,212 | 512 | log::error!("All workspace restorations failed. Opening fallback empty workspace.");
cx.update(|cx| {
workspace::open_new(
Default::default(),
app_state.clone(),
cx,
|workspace, _window, ... |
rust_dataset_chunk_508213 | rust_dataset.txt | 508,213 | 512 | State>,
) -> Option<Vec<SessionWorkspace>> {
let (mut restore_behavior, db) = cx.update(|cx| {
(
WorkspaceSettings::get(None, cx).restore_on_startup,
workspace::WorkspaceDb::global(cx),
)
});
let session_handle = app_state.session.clone();
let (last_session_id, l... |
rust_dataset_chunk_508214 | rust_dataset.txt | 508,214 | 512 | _dir_all(path) {
errors.entry(e.kind()).or_insert_with(Vec::new).push(path);
}
errors
})
}
pub(crate) static FORCE_CLI_MODE: LazyLock<bool> = LazyLock::new(|| {
let env_var = std::env::var(FORCE_CLI_MODE_ENV_VAR_NAME).ok().is_some();
unsafe { std::env::remove_var(FORCE_CLI_MODE_... |
rust_dataset_chunk_508215 | rust_dataset.txt | 508,215 | 512 | fill in this field by hand.
#[cfg(target_os = "windows")]
#[arg(long, value_name = "USER@DISTRO")]
wsl: Option<String>,
/// Open the project in a dev container.
///
/// Automatically triggers "Reopen in Dev Container" if a `.devcontainer/`
/// configuration is found in the project director... |
rust_dataset_chunk_508216 | rust_dataset.txt | 508,216 | 512 | 32>,
/// Unix socket path for IPC with the parent Zed process.
#[cfg(target_os = "windows")]
#[arg(long, hide = true)]
etw_socket: Option<PathBuf>,
}
#[derive(Clone, Debug)]
enum IdType {
New(String),
Existing(String),
}
impl ToString for IdType {
fn to_string(&self) -> String {
m... |
rust_dataset_chunk_508217 | rust_dataset.txt | 508,217 | 512 | ui::FontWeight::MEDIUM,
gpui::FontWeight::SEMIBOLD,
gpui::FontWeight::BOLD,
] {
add_variant(&ui_font, weight, gpui::FontStyle::Normal);
}
add_variant(&ui_font, gpui::FontWeight::NORMAL, gpui::FontStyle::Italic);
add_variant(
&buffer_font,
gpui::FontWeight::BOLD,
... |
rust_dataset_chunk_508218 | rust_dataset.txt | 508,218 | 512 | (&theme_registry, &bytes).log_err();
}
cx.update(theme_settings::reload_theme);
anyhow::Ok(())
}
})
.detach_and_log_err(cx);
}
/// Spawns a background task to watch the themes directory for changes.
fn watch_themes(fs: Arc<dyn fs::Fs>, cx: &mut App) {
use std::t... |
rust_dataset_chunk_508219 | rust_dataset.txt | 508,219 | 512 | ext| ext == "scm"));
if has_language_file {
languages.reload();
}
}
})
.detach();
}
fn dump_all_gpui_actions() {
#[derive(Debug, serde::Serialize)]
struct ActionDef {
name: &'static str,
human_name: String,
schema: Option<serde_jso... |
rust_dataset_chunk_508220 | rust_dataset.txt | 508,220 | 512 | ::HashMap;
use itertools::Itertools;
use log::info;
#[derive(Debug, Hash, Eq, PartialEq)]
enum PerfIssue {
Foreground(&'static Location<'static>),
Background(&'static Location<'static>),
Action(&'static str),
}
pub struct Reporter {
monitor_interval: Duration,
forget_after: Duration,
history: ... |
rust_dataset_chunk_508221 | rust_dataset.txt | 508,221 | 512 | est_poll_times
.into_iter()
.filter(|task| task.poll_duration() > self.report_longer_then)
.filter(|task| !self.hold_report(PerfIssue::Foreground(task.location)))
.collect();
self.update_reported(
hangs
.iter()
.map(|tas... |
rust_dataset_chunk_508222 | rust_dataset.txt | 508,222 | 512 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("Actions(s) that ran too long\n")?;
for action in self.0.iter().sorted_by_key(|action| action.runtime()).rev() {
f.write_fmt(format_args!(
"{:<20} - {}",
format!("{:?}", actio... |
rust_dataset_chunk_508223 | rust_dataset.txt | 508,223 | 512 | This should trigger a report in the log",
);
thread::sleep(hang_time + Duration::from_micros(1));
log::warn!("Hang ended");
});
cx.on_action(move |_: &HangBackground, cx| {
cx.background_spawn(async move {
log::warn!(
"Hanging one background executor ... |
rust_dataset_chunk_508224 | rust_dataset.txt | 508,224 | 512 | ::from_millis(200));
loop {
thread::sleep(monitor_interval);
let task_stats = profiler::take_all_stats(TasksIncluded::CompletedAndRunning);
let action_stats = profiler::take_action_stats();
let should_write_trace = log.check_and_report(&task_s... |
rust_dataset_chunk_508225 | rust_dataset.txt | 508,225 | 512 | entry.ok())
.filter(|entry| {
entry
.path()
.extension()
.is_some_and(|ext| ext == "json" || ext == "miniprof")
})
.collect();
const MAX_HANG_TRACES: usize = 3;
if files.len() > MAX_HANG_TRA... |
rust_dataset_chunk_508226 | rust_dataset.txt | 508,226 | 512 | idumps(client).await.warn_on_err();
})
.detach()
}
cx.observe_new(move |project: &mut Project, _, cx| {
projects.borrow_mut().push(cx.weak_entity());
let client = client.clone();
let Some(remote_client) = project.remote_client() else {
return;
};
... |
rust_dataset_chunk_508227 | rust_dataset.txt | 508,227 | 512 | };
let refresh_kind = ProcessRefreshKind::nothing().with_memory();
let mut system = System::new();
let mut last_logged_resident: Option<u64> = None;
let mut last_logged_at = Instant::now();
loop {
let refreshed = system.refresh_processes_specifics(
... |
rust_dataset_chunk_508228 | rust_dataset.txt | 508,228 | 512 | | !workspace_project_ids.contains(&project.entity_id()))
.count();
let mut worktree_store_ids = HashSet::new();
let mut store_count = 0;
let mut aggregate = WorktreeStoreDiagnostics::default();
for project in live_projects {
let worktree_store = project.read(cx).worktree_store();
... |
rust_dataset_chunk_508229 | rust_dataset.txt | 508,229 | 512 | {worktree_slots}, live {live_worktrees}, visible {visible_worktrees}, strong {strong_handles}, dead weak {dead_weak_handles}, loading {loading_worktrees}, entries {total_entries}, visible entries {visible_entries}, largest none",
),
}
}
pub async fn upload_previous_minidumps(client: Arc<Client>) -> anyhow... |
rust_dataset_chunk_508230 | rust_dataset.txt | 508,230 | 512 | .text("sentry[tags][version]", metadata.init.zed_version.clone())
.text("sentry[tags][binary]", metadata.init.binary.clone())
.text("sentry[release]", metadata.init.commit_sha.clone())
.text("platform", "rust");
let mut panic_message = "".to_owned();
if let Some(panic_info) = met... |
rust_dataset_chunk_508231 | rust_dataset.txt | 508,231 | 512 | ::new()
} else {
index.to_string()
};
let name = format!("gpu{num}");
let root = format!("sentry[contexts][{name}]");
form = form
.text(
format!("{root}[Description]"),
"A GPU found on the users system. May or may not be the... |
rust_dataset_chunk_508232 | rust_dataset.txt | 508,232 | 512 | .body(AsyncBody::from(body_bytes))?;
let mut response_text = String::new();
let mut response = client.http_client().send(req).await?;
response
.body_mut()
.read_to_string(&mut response_text)
.await?;
if !response.status().is_success() {
anyhow::bail!("failed to up... |
rust_dataset_chunk_508233 | rust_dataset.txt | 508,233 | 512 | let timing: BuildTiming = match serde_json::from_str(&contents) {
Ok(timing) => timing,
Err(err) => {
log::warn!("Failed to parse build timing file {:?}: {}", path, err);
continue;
}
};
telemetry::event!(
"Build Timing: Ca... |
rust_dataset_chunk_508234 | rust_dataset.txt | 508,234 | 512 |
//! - Captures raw GPUI output without system window chrome
//! - Is fully deterministic - tooltips, animations, etc. work reliably
//!
//! ## Usage
//!
//! Run the visual tests:
//! cargo run -p zed --bin zed-visual-test-runner --features visual-tests
//!
//! Update baseline images (when UI intentionally changes):
... |
rust_dataset_chunk_508235 | rust_dataset.txt | 508,235 | 512 | std::panic::catch_unwind(|| run_visual_tests(project_path, update_baseline));
// Note: We don't delete temp_path here because background worktree tasks may still
// be running. The directory will be cleaned up when the process exits or by the OS.
match test_result {
Ok(Ok(())) => {}
Ok(Er... |
rust_dataset_chunk_508236 | rust_dataset.txt | 508,236 | 512 | : f64 = 0.99;
/// Tooltip show delay - must match TOOLTIP_SHOW_DELAY in gpui/src/elements/div.rs
pub const TOOLTIP_SHOW_DELAY: Duration = Duration::from_millis(500);
}
#[cfg(target_os = "macos")]
use constants::*;
#[cfg(target_os = "macos")]
fn run_visual_tests(project_path: PathBuf, update_baseline: bool) -... |
rust_dataset_chunk_508237 | rust_dataset.txt | 508,237 | 512 | ));
toolbar.update(cx, |toolbar, cx| {
toolbar.add_item(search_bar, window, cx);
});
},
wrap_div_with_search_actions: search::buffer_search::register_pane_search_actions,
});
prompt_store::init(cx);
let prompt_builder = ... |
rust_dataset_chunk_508238 | rust_dataset.txt | 508,238 | 512 | cx,
)
});
let workspace_window: WindowHandle<Workspace> = cx
.update(|cx| {
cx.open_window(
WindowOptions {
window_bounds: Some(WindowBounds::Windowed(bounds)),
focus: false,
show: false,
... |
rust_dataset_chunk_508239 | rust_dataset.txt | 508,239 | 512 | ProjectPanel>(window, cx);
})
.log_err();
cx.run_until_parked();
// Open main.rs in the editor
let open_file_task = workspace_window
.update(&mut cx, |workspace, window, cx| {
let worktree = workspace.project().read(cx).worktrees(cx).next();
if let Some(work... |
rust_dataset_chunk_508240 | rust_dataset.txt | 508,240 | 512 | 1;
}
Err(e) => {
eprintln!("✗ project_panel: FAILED - {}", e);
failed += 1;
}
}
// Run Test 2: Workspace with Editor
println!("\n--- Test 2: workspace_with_editor ---");
// Close project panel for this test
workspace_window
.update(&mut cx, ... |
rust_dataset_chunk_508241 | rust_dataset.txt | 508,241 | 512 | 1;
}
}
// Run Test 4: Error wrapping visual tests
println!("\n--- Test 4: error_message_wrapping ---");
match run_error_wrapping_visual_tests(app_state.clone(), &mut cx, update_baseline) {
Ok(TestResult::Passed) => {
println!("✓ error_message_wrapping: PASSED");
... |
rust_dataset_chunk_508242 | rust_dataset.txt | 508,242 | 512 | Result::Passed) => {
println!("✓ diff_review_button: PASSED");
passed += 1;
}
Ok(TestResult::BaselineUpdated(_)) => {
println!("✓ diff_review_button: Baselines updated");
updated += 1;
}
Err(e) => {
eprintln!("✗ diff_review_butt... |
rust_dataset_chunk_508243 | rust_dataset.txt | 508,243 | 512 | e);
failed += 1;
}
}
// Run Test 10: Settings UI sub-page auto-open visual tests
println!("\n--- Test 10: settings_ui_subpage_auto_open (2 variants) ---");
match run_settings_ui_subpage_visual_tests(app_state.clone(), &mut cx, update_baseline) {
Ok(TestResult::Passed) => {
... |
rust_dataset_chunk_508244 | rust_dataset.txt | 508,244 | 512 | (())
}
}
#[cfg(target_os = "macos")]
enum TestResult {
Passed,
BaselineUpdated(PathBuf),
}
#[cfg(target_os = "macos")]
fn run_visual_test(
test_name: &str,
window: gpui::AnyWindowHandle,
cx: &mut VisualTestAppContext,
update_baseline: bool,
) -> Result<TestResult> {
// Ensure all pendi... |
rust_dataset_chunk_508245 | rust_dataset.txt | 508,245 | 512 | (&diff_path)?;
println!(" Diff image saved to: {}", diff_path.display());
Err(anyhow::anyhow!(
"Image mismatch: {:.2}% match (threshold: {:.2}%)",
comparison.match_percentage * 100.0,
MATCH_THRESHOLD * 100.0
))
}
}
#[cfg(target_os = "macos")]
fn get_bas... |
rust_dataset_chunk_508246 | rust_dataset.txt | 508,246 | 512 | 64]));
} else {
// Bright red for differing pixels
diff_image.put_pixel(x, y, image::Rgba([255, 0, 0, 255]));
}
}
}
let match_percentage = matching_pixels as f64 / total_pixels as f64;
let diff_pixel_count = total_pixels - matching_pixels;
... |
rust_dataset_chunk_508247 | rust_dataset.txt | 508,247 | 512 | self.field2
}
}
"#;
std::fs::write(src_dir.join("main.rs"), main_rs).expect("Failed to write main.rs");
// Create lib.rs
let lib_rs = r#"//! A sample library for visual testing
pub mod utils;
/// A public function in the library
pub fn library_function() -> String {
"Hello from lib".to_st... |
rust_dataset_chunk_508248 | rust_dataset.txt | 508,248 | 512 | Arc<AppState> {
use fs::Fs;
use node_runtime::NodeRuntime;
use session::Session;
use settings::SettingsStore;
if !cx.has_global::<SettingsStore>() {
let settings_store = SettingsStore::test(cx);
cx.set_global(settings_store);
}
// Use the real filesystem instead of FakeFs ... |
rust_dataset_chunk_508249 | rust_dataset.txt | 508,249 | 512 | fs::create_dir_all(&project_path)?;
// Create a simple file with a few lines
let src_dir = project_path.join("src");
std::fs::create_dir_all(&src_dir)?;
let test_content = r#"fn main() {
println!("Hello");
let x = 42;
}
"#;
std::fs::write(src_dir.join("test.rs"), test_content)?;
// Cr... |
rust_dataset_chunk_508250 | rust_dataset.txt | 508,250 | 512 | _task = workspace_window
.update(cx, |workspace, window, cx| {
let worktree = workspace.project().read(cx).worktrees(cx).next();
if let Some(worktree) = worktree {
let worktree_id = worktree.read(cx).id();
let rel_path: std::sync::Arc<util::rel_path::RelPa... |
rust_dataset_chunk_508251 | rust_dataset.txt | 508,251 | 512 | 16)
let gutter_position = point(px(30.0), px(85.0));
let button_position = point(px(10.0), px(75.0)); // Center of the breakpoint button
// Step 1: Initial draw to register mouse listeners
cx.update_window(workspace_window.into(), |_, window, cx| {
window.draw(cx).clear(cx);
})?;
cx.run... |
rust_dataset_chunk_508252 | rust_dataset.txt | 508,252 | 512 | .into(),
button_position,
None,
Modifiers::default(),
);
// Advance clock past TOOLTIP_SHOW_DELAY (500ms)
cx.advance_clock(TOOLTIP_SHOW_DELAY + Duration::from_millis(100));
cx.run_until_parked();
// Draw to render the tooltip
cx.update_window(workspace_window.into(), |_... |
rust_dataset_chunk_508253 | rust_dataset.txt | 508,253 | 512 | . Settings opened with a path that maps to multiple items (no auto-open)
/// 2. Settings opened with a path that maps to a single SubPageLink (auto-opens sub-page)
#[cfg(target_os = "macos")]
fn run_settings_ui_subpage_visual_tests(
app_state: Arc<AppState>,
cx: &mut VisualTestAppContext,
update_baseline: b... |
rust_dataset_chunk_508254 | rust_dataset.txt | 508,254 | 512 | _iter()
.find_map(|window| window.downcast::<SettingsWindow>())
})
.context("Settings window not found")?;
// Refresh and capture screenshot
cx.update_window(settings_window_1.into(), |_, window, _cx| {
window.refresh();
})?;
cx.run_until_parked();
let test1... |
rust_dataset_chunk_508255 | rust_dataset.txt | 508,255 | 512 |
for _ in 0..5 {
cx.advance_clock(Duration::from_millis(100));
cx.run_until_parked();
}
// Return combined result
match (&test1_result, &test2_result) {
(TestResult::Passed, TestResult::Passed) => Ok(TestResult::Passed),
(TestResult::BaselineUpdated(p), _) | (_, TestResu... |
rust_dataset_chunk_508256 | rust_dataset.txt | 508,256 | 512 | "Initial commit"])
.current_dir(&project_path)
.output()?;
// Modify the file to create a diff
let modified_content = r#"import { ScrollArea } from 'components';
import { ButtonAlt, Tooltip } from 'ui';
import { Message, FileEdit } from 'types';
import { AiPaneTabContext } from 'context';
"#;
... |
rust_dataset_chunk_508257 | rust_dataset.txt | 508,257 | 512 | .clone(), window, cx)
})
},
)
})
.context("Failed to open diff review test window")?;
cx.run_until_parked();
// Create and add the ProjectDiff using the public deploy_at method
workspace_window
.update(cx, |workspace, window, cx| {
... |
rust_dataset_chunk_508258 | rust_dataset.txt | 508,258 | 512 | window")?;
cx.run_until_parked();
// Open a regular file (not a diff view)
let open_file_task = regular_window
.update(cx, |workspace, window, cx| {
let worktree = workspace.project().read(cx).worktrees(cx).next();
if let Some(worktree) = worktree {
let wor... |
rust_dataset_chunk_508259 | rust_dataset.txt | 508,259 | 512 | .into(), |_, window, _cx| {
window.refresh();
})?;
cx.run_until_parked();
// Capture Test 4: Regular editor with overlay shown
let test4_result = run_visual_test(
"diff_review_overlay_shown",
regular_window.into(),
cx,
update_baseline,
)?;
// Test 5: Ty... |
rust_dataset_chunk_508260 | rust_dataset.txt | 508,260 | 512 | illis(100));
cx.run_until_parked();
}
// Refresh window
cx.update_window(regular_window.into(), |_, window, _cx| {
window.refresh();
})?;
cx.run_until_parked();
// Capture Test 6: Overlay with one stored comment
let test6_result = run_visual_test(
"diff_review_one_... |
rust_dataset_chunk_508261 | rust_dataset.txt | 508,261 | 512 | the public method
editor.set_diff_review_comments_expanded(false, cx);
});
}
})
.log_err();
// Wait for UI to update
for _ in 0..3 {
cx.advance_clock(Duration::from_millis(100));
cx.run_until_parked();
}
// Refresh window... |
rust_dataset_chunk_508262 | rust_dataset.txt | 508,262 | 512 | TestResult::BaselineUpdated(p.clone()),
});
Ok(result)
}
/// A stub AgentServer for visual testing that returns a pre-programmed connection.
#[derive(Clone)]
#[cfg(target_os = "macos")]
struct StubAgentServer {
connection: StubAgentConnection,
}
#[cfg(target_os = "macos")]
impl StubAgentServer {
... |
rust_dataset_chunk_508263 | rust_dataset.txt | 508,263 | 512 | project::LocalProjectFlags {
init_worktree_trust: false,
..Default::default()
},
cx,
)
});
// Add the test directory as a worktree
let add_worktree_task = project.update(cx, |project, cx| {
project.find_or_create_worktree(&... |
rust_dataset_chunk_508264 | rust_dataset.txt | 508,264 | 512 | if let Ok(agent::ThreadEvent::ToolCallUpdate(acp_thread::ToolCallUpdate::V2(update))) =
event
{
if let Some(content) = update.content.take() {
for content in content {
let acp_v2::ToolCallContent::Content(content) = content else {
... |
rust_dataset_chunk_508265 | rust_dataset.txt | 508,265 | 512 | window, cx| {
(workspace.weak_handle(), window.to_async(cx))
})
.context("Failed to get workspace handle")?;
cx.background_executor.allow_parking();
let panel = cx
.foreground_executor
.block_test(AgentPanel::load(weak_workspace, async_window_cx))
.context("... |
rust_dataset_chunk_508266 | rust_dataset.txt | 508,266 | 512 | .ok_or_else(|| anyhow::anyhow!("Expected a ToolCall entry in thread"))?;
cx.update_window(workspace_window.into(), |_, window, _cx| {
window.refresh();
})?;
cx.run_until_parked();
// Capture the COLLAPSED state
let collapsed_result = run_visual_test(
"agent_thread_with_ima... |
rust_dataset_chunk_508267 | rust_dataset.txt | 508,267 | 512 | will be cleaned up when the process exits.
match (&collapsed_result, &expanded_result) {
(TestResult::Passed, TestResult::Passed) => Ok(TestResult::Passed),
(TestResult::BaselineUpdated(p), _) | (_, TestResult::BaselineUpdated(p)) => {
Ok(TestResult::BaselineUpdated(p.clone()))
... |
rust_dataset_chunk_508268 | rust_dataset.txt | 508,268 | 512 | | {
cx.open_window(
WindowOptions {
window_bounds: Some(WindowBounds::Windowed(bounds)),
focus: false,
show: false,
..Default::default()
},
|window, cx| {
let w... |
rust_dataset_chunk_508269 | rust_dataset.txt | 508,269 | 512 | the tool config page
settings_window_handle
.update(cx, |settings_window, window, cx| {
settings_window.push_dynamic_sub_page(
"Terminal",
"Configure Tool Rules",
None,
true,
settings_ui::pages::render_terminal_tool... |
rust_dataset_chunk_508270 | rust_dataset.txt | 508,270 | 512 | // Clean up - close the settings window
cx.update_window(settings_window, |_, window, _cx| {
window.remove_window();
})
.log_err();
// Close the workspace window
cx.update_window(workspace_window.into(), |_, window, _cx| {
window.remove_window();
})
.log_err();
cx.r... |
rust_dataset_chunk_508271 | rust_dataset.txt | 508,271 | 512 | cx,
)
});
let window_size = size(px(1280.0), px(800.0));
let bounds = Bounds {
origin: point(px(0.0), px(0.0)),
size: window_size,
};
// Open a MultiWorkspace window with both workspaces created at construction time
let multi_workspace_window: WindowHandle<M... |
rust_dataset_chunk_508272 | rust_dataset.txt | 508,272 | 512 | project = workspace2.read(cx).project().clone();
project.update(cx, |project, cx| {
project.find_or_create_worktree(&workspace2_dir, true, cx)
})
})
.context("Failed to start adding worktree 2")?;
cx.background_executor.allow_parking();
cx.foreground_exe... |
rust_dataset_chunk_508273 | rust_dataset.txt | 508,273 | 512 | path_list = util::path_list::PathList::new(&paths);
let (session_id, title, updated_at) = match index {
0 => (
"visual-test-thread-0",
"Refine thread view scrolling behavior",
chrono::TimeZone::with_ymd_and_hms... |
rust_dataset_chunk_508274 | rust_dataset.txt | 508,274 | 512 | ulti_workspace_window.into(), |_, window, _cx| {
window.refresh();
})?;
cx.run_until_parked();
// Capture: sidebar open with active workspaces and recent projects
let test_result = run_visual_test(
"multi_workspace_sidebar_open",
multi_workspace_window.into(),
cx,
... |
rust_dataset_chunk_508275 | rust_dataset.txt | 508,275 | 512 | ().colors().background)
.p_4()
.gap_4()
.child(
Callout::new()
.icon(IconName::Warning)
.severity(Severity::Warning)
.title(long_error_message)
.description(retry_description),
... |
rust_dataset_chunk_508276 | rust_dataset.txt | 508,276 | 512 | .worktrees(vec![ThreadItemWorktreeInfo {
worktree_name: Some("jade-glen".into()),
full_path: "/worktrees/jade-glen/zed".into(),
highlight_positions: Vec::new(),
kind: WorktreeKind::Lin... |
rust_dataset_chunk_508277 | rust_dataset.txt | 508,277 | 512 | IconName::AiClaude)
.timestamp("6d")
.worktrees(vec![ThreadItemWorktreeInfo {
worktree_name: Some("stoic-reed".into()),
full_path: "/worktrees/stoic-reed/zed".into(),
highlight_positions: ... |
rust_dataset_chunk_508278 | rust_dataset.txt | 508,278 | 512 | highlight_positions: Vec::new(),
kind: WorktreeKind::Linked,
branch_name: Some(
"fix-very-long-branch-name-that-should-truncate".into(),
),
}]),
),
)
... |
rust_dataset_chunk_508279 | rust_dataset.txt | 508,279 | 512 | cx.run_until_parked();
}
Ok(test_result)
}
#[cfg(target_os = "macos")]
struct ThreadItemIconDecorationsTestView;
#[cfg(target_os = "macos")]
impl gpui::Render for ThreadItemIconDecorationsTestView {
fn render(
&mut self,
_window: &mut gpui::Window,
cx: &mut gpui::Context<Self>,
... |
rust_dataset_chunk_508280 | rust_dataset.txt | 508,280 | 512 | ThreadItem::new("ti-running", "Generating response...")
.icon(IconName::AiClaude)
.timestamp("1:20 AM")
.status(ui::AgentThreadStatus::Running),
),
)
.child(section_label(
... |
rust_dataset_chunk_508281 | rust_dataset.txt | 508,281 | 512 | = size(px(500.0), px(400.0));
let bounds = Bounds {
origin: point(px(0.0), px(0.0)),
size: window_size,
};
let window = cx
.update(|cx| {
cx.open_window(
WindowOptions {
window_bounds: Some(WindowBounds::Windowed(bounds)),
... |
rust_dataset_chunk_508282 | rust_dataset.txt | 508,282 | 512 | macos")]
fn open_sidebar_test_window(
projects: Vec<Entity<Project>>,
app_state: &Arc<AppState>,
cx: &mut VisualTestAppContext,
) -> Result<WindowHandle<MultiWorkspace>> {
anyhow::ensure!(!projects.is_empty(), "need at least one project");
let window_size = size(px(400.0), px(600.0));
let bound... |
rust_dataset_chunk_508283 | rust_dataset.txt | 508,283 | 512 | , cx| {
mw.register_sidebar(sidebar.clone(), cx);
})
.context("Failed to register sidebar")?;
cx.run_until_parked();
// Open the sidebar
multi_workspace_window
.update(cx, |mw, window, cx| {
mw.toggle_sidebar(window, cx);
})
.context("Failed ... |
rust_dataset_chunk_508284 | rust_dataset.txt | 508,284 | 512 | /foo/zed/ — project2 (single worktree)
// code/bar/zed/ — project3, first worktree
// code/baz/zed/ — project3, second worktree
//
// No two projects share a worktree path, so ProjectGroupBuilder will
// place each in its own group.
let code_zed = canonical_temp.join("code").join("zed"... |
rust_dataset_chunk_508285 | rust_dataset.txt | 508,285 | 512 | _worktree(&foo_zed, &app_state, cx)?;
let project3 = create_project_with_worktree(&bar_zed, &app_state, cx)?;
let add_second_worktree = cx.update(|cx| {
project3.update(cx, |project, cx| {
project.find_or_create_worktree(&baz_zed, true, cx)
})
});
... |
rust_dataset_chunk_508286 | rust_dataset.txt | 508,286 | 512 | .into_iter()
.find_map(|window| window.downcast::<WatcherDebug>())
{
existing
.update(cx, |view, window, cx| {
window.activate_window();
view.focus_handle(cx).focus(window, cx);
})
.log_er... |
rust_dataset_chunk_508287 | rust_dataset.txt | 508,287 | 512 | roots across the app.",
Self::ScanExclusions => EXCLUSION_SCOPE,
}
}
fn empty_message(self) -> &'static str {
match self {
Self::RawEvents => "Waiting for filesystem watcher events…",
Self::WatchRoots => "No watch roots.",
Self::ScanExclusions =>... |
rust_dataset_chunk_508288 | rust_dataset.txt | 508,288 | 512 | 0;
}
let edits = language::text_diff(&previous, &text);
let edited_bytes = edits
.iter()
.map(|(range, text)| range.len() + text.len())
.sum();
let edits = edits.into_iter().map(|(range, text)| {
(
MultiBufferOffset(range.s... |
rust_dataset_chunk_508289 | rust_dataset.txt | 508,289 | 512 | cx| {
loop {
cx.background_executor()
.timer(Duration::from_millis(250))
.await;
if this
.update_in(cx, |this, window, cx| {
this.refresh(cx);
this.compact_editors(win... |
rust_dataset_chunk_508290 | rust_dataset.txt | 508,290 | 512 | , snapshot: &WatchSnapshot, cx: &mut Context<Self>) {
let previous_dropped = self
.snapshot
.as_ref()
.map_or(0, |snapshot| snapshot.dropped_events);
let removed = usize::try_from(snapshot.dropped_events.saturating_sub(previous_dropped))
.unwrap_or(usize::... |
rust_dataset_chunk_508291 | rust_dataset.txt | 508,291 | 512 | ).is_focused(window),
)
});
let editor = create_editor(tab, text, window, cx);
editor.update(cx, |editor, cx| {
editor.change_selections(
editor::SelectionEffects::no_scroll(),
window,
... |
rust_dataset_chunk_508292 | rust_dataset.txt | 508,292 | 512 | _error = match result {
Ok(()) => None,
Err(error) => Some(format!("Save failed: {error:#}").into()),
};
cx.notify();
})
.log_err();
})
.detach();
}
}
impl Focusable for WatcherDebug {
fn focus_handl... |
rust_dataset_chunk_508293 | rust_dataset.txt | 508,293 | 512 | .child(
Button::new("save-watcher-json", "Export as JSON")
.disabled(self.saving || self.recording.is_none())
.on_click(cx.listener(|this, _, _, cx| this.save(cx))),
),
)
}
}
#[cfg(test)]
mod tests {
... |
rust_dataset_chunk_508294 | rust_dataset.txt | 508,294 | 512 | !(format_event(&event).as_ref(), "--:--:--.--- watch_error");
}
#[gpui::test]
fn editors_allow_copying_and_preserve_selections_on_updates(cx: &mut gpui::TestAppContext) {
let app_state = cx.update(AppState::test);
let window = cx.add_window(|window, cx| WatcherDebug::new(app_state, window,... |
rust_dataset_chunk_508295 | rust_dataset.txt | 508,295 | 512 | cx.update(AppState::test);
let window = cx.add_window(|window, cx| WatcherDebug::new(app_state, window, cx));
let snapshot = |dropped_events, paths: &[&str]| WatchSnapshot {
started_at_unix_millis: 0,
captured_at_unix_millis: 0,
capacity: 2,
dropped_event... |
rust_dataset_chunk_508296 | rust_dataset.txt | 508,296 | 512 | atcherTab::RawEvents).downgrade();
view.editor_edit_bytes[WatcherTab::RawEvents as usize] = 64 * 1024;
view.compact_editors(window, cx);
old_editor
})
.unwrap();
visual.run_until_parked();
assert!(old_editor.upgrade().is_none());
... |
rust_dataset_chunk_508297 | rust_dataset.txt | 508,297 | 512 | fs.create_dir(root).await.unwrap();
let (_events, _watcher) = fs.watch(root, Duration::ZERO).await;
cx.update(|cx| {
init(app_state, cx);
cx.dispatch_action(&DebugFilesystemWatching);
});
let window = cx.update(|cx| {
cx.windows()
.int... |
rust_dataset_chunk_508298 | rust_dataset.txt | 508,298 | 512 | WatchRoots => {
assert!(text.contains("Native"));
assert!(text.contains(root.to_str().unwrap()));
}
WatcherTab::ScanExclusions => {
assert!(text.is_empty());
}
... |
rust_dataset_chunk_508299 | rust_dataset.txt | 508,299 | 512 | .find_map(|window| window.downcast::<WatcherDebug>())
.unwrap()
});
window.update(cx, |view, _, cx| view.save(cx)).unwrap();
assert!(cx.did_prompt_for_new_path());
cx.simulate_new_path_selection(|_| None);
cx.run_until_parked();
window
.updat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.