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_508300 | rust_dataset.txt | 508,300 | 512 | ui::{App, Menu, MenuItem, OsAction};
use project::DisableAiSettings;
use release_channel::ReleaseChannel;
use settings::Settings;
use terminal_view::terminal_panel;
use zed_actions::{Quit, assistant, debug_panel, dev, git_panel, project_panel};
pub fn app_menus(cx: &mut App) -> Vec<Menu> {
let mut view_items = vec... |
rust_dataset_chunk_508301 | rust_dataset.txt | 508,301 | 512 | .push(MenuItem::action(
"Toggle GPUI Inspector",
dev::ToggleInspector,
));
view_items.push(MenuItem::separator());
}
vec![
Menu {
name: "Zed".into(),
disabled: false,
items: vec![
MenuItem::action("About Zed", z... |
rust_dataset_chunk_508302 | rust_dataset.txt | 508,302 | 512 | workspace::NewWindow),
MenuItem::separator(),
#[cfg(not(target_os = "macos"))]
MenuItem::action("Open File...", workspace::OpenFiles),
MenuItem::action(
if cfg!(not(target_os = "macos")) {
"Open Folder..."
... |
rust_dataset_chunk_508303 | rust_dataset.txt | 508,303 | 512 | ::SelectAll,
),
MenuItem::action("Expand Selection", editor::actions::SelectLargerSyntaxNode),
MenuItem::action("Shrink Selection", editor::actions::SelectSmallerSyntaxNode),
MenuItem::action("Select Next Sibling", editor::actions::SelectNextSyntaxNode),
... |
rust_dataset_chunk_508304 | rust_dataset.txt | 508,304 | 512 | GoToDeclaration::default(),
),
MenuItem::action(
"Go to Type Definition",
editor::actions::GoToTypeDefinition::default(),
),
MenuItem::action(
"Find All References",
editor::ac... |
rust_dataset_chunk_508305 | rust_dataset.txt | 508,305 | 512 | Show Welcome", onboarding::ShowWelcome),
MenuItem::separator(),
MenuItem::action("File Bug Report...", zed_actions::feedback::FileBugReport),
MenuItem::action("Request Feature...", zed_actions::feedback::RequestFeature),
MenuItem::action("Email Us...", zed... |
rust_dataset_chunk_508306 | rust_dataset.txt | 508,306 | 512 | _handle = editor_handle.clone();
let editors = editors.clone();
move |_, _| {
editors.borrow_mut().remove(&editor_handle);
}
})
.detach();
editors
.borrow_mut()
.insert(editor_handle,... |
rust_dataset_chunk_508307 | rust_dataset.txt | 508,307 | 512 | Config::Codestral),
EditPredictionProvider::Ollama | EditPredictionProvider::OpenAiCompatibleApi => {
let custom_settings = if provider == EditPredictionProvider::Ollama {
settings.ollama.as_ref()?
} else {
settings.open_ai_compatible_api.as_ref()?
... |
rust_dataset_chunk_508308 | rust_dataset.txt | 508,308 | 512 | provider_config: Option<EditPredictionProviderConfig>,
trigger: EditPredictionRequestTrigger,
client: &Arc<Client>,
user_store: Entity<UserStore>,
cx: &mut App,
) {
if provider_config == Some(EditPredictionProviderConfig::Codestral) {
load_codestral_api_key(cx).detach();
}
for (e... |
rust_dataset_chunk_508309 | rust_dataset.txt | 508,309 | 512 | ProviderConfig::Zed(model)) => {
let ep_store = edit_prediction::EditPredictionStore::global(client, &user_store, cx);
if let Some(organization_configuration) =
user_store.read(cx).current_organization_configuration()
{
if !organization_configuration.... |
rust_dataset_chunk_508310 | rust_dataset.txt | 508,310 | 512 | });
});
let config = cx.update(|cx| edit_prediction_provider_config_for_settings(cx));
assert!(
matches!(
config,
Some(EditPredictionProviderConfig::Zed(
EditPredictionModel::SweepPrompt,
))
),
... |
rust_dataset_chunk_508311 | rust_dataset.txt | 508,311 | 512 | , cx);
language_model::init(cx);
client::RefreshLlmTokenListener::register(
app_state.client.clone(),
app_state.user_store.clone(),
cx,
);
editor::init(cx);
app_state
});
// Override the default ... |
rust_dataset_chunk_508312 | rust_dataset.txt | 508,312 | 512 | estral), but due to the bug it uses the
// stale init-time value (None) and clears the provider.
cx.update(|cx| {
app_state.user_store.update(cx, |_, cx| {
cx.emit(client::user::Event::PrivateUserInfoUpdated);
});
});
cx.run_until_parked();
... |
rust_dataset_chunk_508313 | rust_dataset.txt | 508,313 | 512 | *release_channel::RELEASE_CHANNEL {
ReleaseChannel::Dev => 43737,
ReleaseChannel::Preview => 43737 + USER_BLOCK,
ReleaseChannel::Stable => 43737 + (2 * USER_BLOCK),
ReleaseChannel::Nightly => 43737 + (3 * USER_BLOCK),
};
let uid = getuid().as_raw();
// Ensure that the user I... |
rust_dataset_chunk_508314 | rust_dataset.txt | 508,314 | 512 | ay(true);
_ = stream.set_read_timeout(Some(SEND_TIMEOUT));
_ = stream.write_all(instance_handshake().as_bytes());
}
})
.unwrap();
IsOnlyInstance::Yes
}
fn check_got_handshake() -> bool {
match TcpStream::connect_timeout(&address(), CONNECT_TIMEOUT) {... |
rust_dataset_chunk_508315 | rust_dataset.txt | 508,315 | 512 | : &mut App) {
cx.set_global(GlobalMigrationNotification(notifier));
}
}
struct GlobalMigrationNotification(Entity<MigrationNotification>);
impl Global for GlobalMigrationNotification {}
impl MigrationBanner {
pub fn new(workspace: WeakEntity<Workspace>, cx: &mut Context<Self>) -> Self {
if le... |
rust_dataset_chunk_508316 | rust_dataset.txt | 508,316 | 512 | self.migration_type.take();
self.markdown.take();
cx.notify();
}
}
impl EventEmitter<ToolbarItemEvent> for MigrationBanner {}
impl ToolbarItemView for MigrationBanner {
fn set_active_pane_item(
&mut self,
active_pane_item: Option<&dyn ItemHandle>,
window: &mut Window,
... |
rust_dataset_chunk_508317 | rust_dataset.txt | 508,317 | 512 | .6))
.border_1()
.border_color(cx.theme().colors().border_variant)
.rounded_sm()
.child(
h_flex()
.gap_2()
.overflow_hidden()
.child(
Icon::new(IconName::Warning)
... |
rust_dataset_chunk_508318 | rust_dataset.txt | 508,318 | 512 | Result<()> {
let old_text = KeymapFile::load_keymap_file(&fs).await?;
let Ok(Some(new_text)) = migrate_keymap(&old_text) else {
return Ok(());
};
let keymap_path = paths::keymap_file().as_path();
if fs.is_file(keymap_path).await {
fs.atomic_write(paths::keymap_backup_file().to_path_... |
rust_dataset_chunk_508319 | rust_dataset.txt | 508,319 | 512 | Context, DismissEvent, EventEmitter, FocusHandle, Focusable,
PromptButton, PromptLevel, Render, WeakEntity, Window,
};
use std::ffi::OsString;
use std::path::{Path, PathBuf};
use std::sync::atomic::{AtomicBool, Ordering};
use ui::{
ActiveTheme, Color, CommonAnimationExt, Icon, IconName, IconSize, IntoElement, ... |
rust_dataset_chunk_508320 | rust_dataset.txt | 508,320 | 512 | from a temporary location. Move it to Applications to finish installing it.",
),
&[
PromptButton::ok("Yes"),
PromptButton::cancel("No"),
PromptButton::new("Don't ask me again"),
],
)
.awa... |
rust_dataset_chunk_508321 | rust_dataset.txt | 508,321 | 512 | Render for InstallingZedModal {
fn render(&mut self, _window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
let theme = cx.theme();
v_flex()
.elevation_3(cx)
.w_80()
.overflow_hidden()
.child(
div()
.p... |
rust_dataset_chunk_508322 | rust_dataset.txt | 508,322 | 512 | _destination)
.await
.with_context(|| {
format!(
"failed to replace existing app at {}",
user_destination.display()
)
})?;
return Ok(user_destination);
}
match copy_app_bundle(app_path, &system_d... |
rust_dataset_chunk_508323 | rust_dataset.txt | 508,323 | 512 | collecting workspace windows before restarting")?;
if !workspace::prepare_windows_to_quit(&workspace_windows, cx).await {
return Ok(());
}
cx.update(|_window, cx| {
cx.set_restart_path(app_path);
cx.restart();
})?;
Ok(())
}
fn user_applications_directory() -> Option<PathBuf>... |
rust_dataset_chunk_508324 | rust_dataset.txt | 508,324 | 512 | <u64>,
pub remote_connection: Option<RemoteConnectionOptions>,
pub open_behavior: Option<cli::OpenBehavior>,
}
pub enum OpenRequestKind {
CliConnection(
(
mpsc::UnboundedReceiver<CliRequest>,
Box<dyn CliResponseSink>,
),
),
FocusApp,
Extension {
e... |
rust_dataset_chunk_508325 | rust_dataset.txt | 508,325 | 512 | .finish(),
Self::GitCommit { sha } => f.debug_struct("GitCommit").field("sha", sha).finish(),
}
}
}
impl OpenRequest {
pub fn is_focus_app_only(&self) -> bool {
matches!(self.kind, Some(OpenRequestKind::FocusApp))
&& self.open_paths.is_empty()
&& self.diff_p... |
rust_dataset_chunk_508326 | rust_dataset.txt | 508,326 | 512 | _string(),
});
} else if url.starts_with(agent_skills::SKILL_SHARE_LINK_PREFIX) {
this.parse_skill_install_url(&url)?
} else if let Some(agent_path) = url.strip_prefix("zed://agent") {
this.parse_agent_url(agent_path)
} else if url == "... |
rust_dataset_chunk_508327 | rust_dataset.txt | 508,327 | 512 | ::local()).to_owned())
}
}
fn parse_agent_url(&mut self, agent_path: &str) {
// Format: "" or "?prompt=<text>".
let agent_path = agent_path.strip_prefix('/').unwrap_or(agent_path);
let external_source_prompt = agent_path.strip_prefix('?').and_then(|query| {
url::form... |
rust_dataset_chunk_508328 | rust_dataset.txt | 508,328 | 512 | _empty())
.context("invalid git commit url: missing repo query parameter")?
.to_string();
self.open_paths.push(repo);
self.kind = Some(OpenRequestKind::GitCommit {
sha: sha.to_string(),
});
Ok(())
}
fn parse_ssh_file_path(&mut self, file: &... |
rust_dataset_chunk_508329 | rust_dataset.txt | 508,329 | 512 | SCPUrl("ssh://[2600::]:~/foo") => Url("ssh://[2600::]/~/foo")
let ssh_target = url
.strip_prefix("ssh://")
.with_context(|| format!("invalid ssh url: {url}"))?;
let (authority, path) = if let Some((authority, path)) = ssh_target.rsplit_once(":~/") {
(authority, format!("/~/{path}"))
... |
rust_dataset_chunk_508330 | rust_dataset.txt | 508,330 | 512 | }
pub fn open(&self, request: RawOpenRequest) {
self.0
.unbounded_send(request)
.context("no listener for open requests")
.log_err();
}
}
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
pub fn listen_for_cli_connections(opener: OpenListener) -> Result<()... |
rust_dataset_chunk_508331 | rust_dataset.txt | 508,331 | 512 | async fn open_paths_with_positions(
path_positions: &[PathWithPosition],
diff_paths: &[[String; 2]],
diff_all: bool,
app_state: Arc<AppState>,
open_options: workspace::OpenOptions,
cx: &mut AsyncApp,
) -> Result<(
WindowHandle<MultiWorkspace>,
Vec<Option<Result<Box<dyn ItemHandle>>>>,
)... |
rust_dataset_chunk_508332 | rust_dataset.txt | 508,332 | 512 | , new_path) =
match futures::join!(canonicalize(old_parsed), canonicalize(new_parsed)) {
(Ok(old), Ok(new)) => (old, new),
(old, new) => {
for result in [old, new] {
if let Err(err) = result {
... |
rust_dataset_chunk_508333 | rust_dataset.txt | 508,333 | 512 | open_behavior,
env,
user_data_dir: _,
dev_container,
cwd,
} => {
if !urls.is_empty() {
cx.update(|cx| {
match OpenRequest::parse(
RawOpenRequest {
urls,
... |
rust_dataset_chunk_508334 | rust_dataset.txt | 508,334 | 512 | the state being inspected.
let state = cx.update(|cx| cx.debug_state());
let response = match serde_json::to_string_pretty(&state) {
Ok(message) => CliResponse::Stdout { message },
Err(error) => CliResponse::Stderr {
message: format!("failed t... |
rust_dataset_chunk_508335 | rust_dataset.txt | 508,335 | 512 | move { is_dir })
.await;
if !has_directory {
return None;
}
}
let settings_text = app_state
.fs
.load(paths::settings_file())
.await
.unwrap_or_default();
if settings_text.contains("cli_default_open_behavior") {
return None;... |
rust_dataset_chunk_508336 | rust_dataset.txt | 508,336 | 512 | }
cli::OpenBehavior::PreferNewWindow => workspace::WorkspaceMatching::MatchSubpaths,
cli::OpenBehavior::Add => workspace::WorkspaceMatching::MatchSubdirectory,
_ => workspace::WorkspaceMatching::MatchExact,
},
add_dirs_to_sidebar: match open_behavior {
cl... |
rust_dataset_chunk_508337 | rust_dataset.txt | 508,337 | 512 | workspace::open_new(open_options, app_state, cx, |workspace, window, cx| {
Editor::new_file(workspace, &Default::default(), window, cx)
})
.detach_and_log_err(cx);
});
}
return Ok(());
}
// If there are paths to open... |
rust_dataset_chunk_508338 | rust_dataset.txt | 508,338 | 512 | no regular paths), add the CLI's
// working directory so the workspace opens with the right context.
// Note: must use the CLI process's cwd (forwarded via `cli_cwd`), not
// `std::env::current_dir()`, since the Zed app process's cwd is typically
// `/` on macOS bundles or the launch dir of an already-r... |
rust_dataset_chunk_508339 | rust_dataset.txt | 508,339 | 512 | vided_paths {
for path_with_position in &paths_with_position {
if app_state.fs.is_dir(&path_with_position.path).await {
wait_for_window_close = true;
break;
}
}
}
if wait_for_window_close {
let (... |
rust_dataset_chunk_508340 | rust_dataset.txt | 508,340 | 512 | = Path::new(path_str.as_ref());
let mut parsed = PathWithPosition::parse_str(path_str.as_ref());
// If the unparsed path string actually points to an existing file or directory, use it
// instead of parsing out the line/col number. This matters for paths whose final
// component looks ... |
rust_dataset_chunk_508341 | rust_dataset.txt | 508,341 | 512 | }
}
fn assert_ssh_parse(
cx: &mut TestAppContext,
input: &str,
expected_url: Option<&str>,
host: &str,
username: Option<&str>,
port: Option<u16>,
path: &str,
) {
if let Some(expected_url) = expected_url {
assert_eq!(parse_s... |
rust_dataset_chunk_508342 | rust_dataset.txt | 508,342 | 512 | None,
None,
"/~/foo",
),
(
"ssh://me@[2001:db8::1]:~/project",
Some("ssh://me@[2001:db8::1]/~/project"),
"2001:db8::1",
Some("me"),
None,
"/~/project",
),
... |
rust_dataset_chunk_508343 | rust_dataset.txt | 508,343 | 512 | path!("/root/Project (2,3)").to_string(), None, None),
(path!("/root/test 123").to_string(), None, None),
]
);
}
// Test file with colon (`:`) in the name on non-Windows platforms,
// as it is valid for file names on Unix-like systems.
#[cfg(not(target_os = "windows"... |
rust_dataset_chunk_508344 | rust_dataset.txt | 508,344 | 512 | URLs starts with `/` before the drive letter,
// `/C:/root/test.txt` should be parsed as `C:/root/test.txt`
#[cfg(target_os = "windows")]
#[gpui::test]
fn test_parse_file_urls_with_drive_letter_on_windows(cx: &mut TestAppContext) {
let _app_state = init_test(cx);
for (input, expected) ... |
rust_dataset_chunk_508345 | rust_dataset.txt | 508,345 | 512 | (cx: &mut TestAppContext) {
let _app_state = init_test(cx);
let request = cx.update(|cx| {
OpenRequest::parse(
RawOpenRequest {
urls: vec![
"ssh://me@host/project".into(),
"ssh://me@host/project/README.md".i... |
rust_dataset_chunk_508346 | rust_dataset.txt | 508,346 | 512 | assert_eq!(
options.workspace_matching,
workspace::WorkspaceMatching::None
);
assert!(!options.add_dirs_to_sidebar);
assert!(options.requesting_window.is_none());
}
#[gpui::test]
fn test_open_options_for_request_respects_default_open_behavior(cx: &mut TestAp... |
rust_dataset_chunk_508347 | rust_dataset.txt | 508,347 | 512 | Context) {
let _app_state = init_test(cx);
let content =
"---\nname: my-skill\ndescription: Does a thing.\n---\n\nDo the thing.\n".to_string();
let link = agent_skills::encode_skill_share_link(&content);
let request = cx.update(|cx| {
OpenRequest::parse(
... |
rust_dataset_chunk_508348 | rust_dataset.txt | 508,348 | 512 | {
let _app_state = init_test(cx);
let request = cx.update(|cx| {
OpenRequest::parse(
RawOpenRequest {
urls: vec!["zed://agent/?prompt=hello".into()],
..Default::default()
},
cx,
)
... |
rust_dataset_chunk_508349 | rust_dataset.txt | 508,349 | 512 | commit/abc123?repo=path/to/repo".into()],
..Default::default()
},
cx,
)
.unwrap()
});
match request.kind.unwrap() {
OpenRequestKind::GitCommit { sha } => {
assert_eq!(sha, "abc123");
}
... |
rust_dataset_chunk_508350 | rust_dataset.txt | 508,350 | 512 | .await;
assert_eq!(cx.windows().len(), 0);
// First open the workspace directory
open_workspace_file(path!("/root/dir1"), <_>::default(), app_state.clone(), cx).await;
assert_eq!(cx.windows().len(), 1);
let multi_workspace = cx.windows()[0].downcast::<MultiWorkspac... |
rust_dataset_chunk_508351 | rust_dataset.txt | 508,351 | 512 | workspace::OpenOptions {
wait: true,
..Default::default()
},
None,
&response_sink,
&app_state,
&mut cx,
)
.await;
... |
rust_dataset_chunk_508352 | rust_dataset.txt | 508,352 | 512 | Vec<_>>();
assert_eq!(items.len(), 2, "Workspace should have two items");
});
})
.unwrap();
// Test case 3: Open a single file that does not exist yet,
// but tell Zed to NOT add it to the current workspace
open_workspace_file(
... |
rust_dataset_chunk_508353 | rust_dataset.txt | 508,353 | 512 | })
.expect("window exists");
for workspace in workspaces {
window
.update(cx, |multi_workspace, window, cx| {
multi_workspace.activate(workspace.clone(), None, window, cx);
window.activate_window();
... |
rust_dataset_chunk_508354 | rust_dataset.txt | 508,354 | 512 | |multi_workspace, _, cx| {
let workspace = multi_workspace.workspace().read(cx);
assert_eq!(workspace.items(cx).count(), 1);
let roots = workspace
.project()
.read(cx)
.visible_worktrees(cx)
... |
rust_dataset_chunk_508355 | rust_dataset.txt | 508,355 | 512 | Path::new(file2_path),
&Rope::from("content2"),
LineEnding::Unix,
)
.await
.unwrap();
// First, open a workspace normally
let response_sink = DiscardResponseSink;
let workspace_paths = vec![file1_path.to_string()];
le... |
rust_dataset_chunk_508356 | rust_dataset.txt | 508,356 | 512 | .com/zed-industries/zed.git");
}
_ => panic!("Expected GitClone kind"),
}
}
#[gpui::test]
fn test_parse_git_clone_url_without_slash(cx: &mut TestAppContext) {
let _app_state = init_test(cx);
let request = cx.update(|cx| {
OpenRequest::parse(
... |
rust_dataset_chunk_508357 | rust_dataset.txt | 508,357 | 512 | app_state
.fs
.create_file(Path::new(file1_path), Default::default())
.await
.unwrap();
app_state
.fs
.save(
Path::new(file1_path),
&Rope::from("content1"),
LineEnding::Unix,
)
... |
rust_dataset_chunk_508358 | rust_dataset.txt | 508,358 | 512 | .unwrap();
// Now use --add flag (open_behavior = OpenBehavior::Add) to add a new file
// It should open in the focused window (window2), not an arbitrary window
let new_file_path = if cfg!(windows) {
"C:\\root\\new_file.txt"
} else {
"/root/new_file.txt"
... |
rust_dataset_chunk_508359 | rust_dataset.txt | 508,359 | 512 | json!({
".devcontainer": {
"devcontainer.json": "{}"
},
"src": {
"main.rs": "fn main() {}"
}
}),
)
.await;
let errored = cx
... |
rust_dataset_chunk_508360 | rust_dataset.txt | 508,360 | 512 | no .devcontainer config, the flag should be cleared once the
// worktree scan completes, rather than persisting on the workspace.
let multi_workspace = cx.update(|cx| cx.windows()[0].downcast::<MultiWorkspace>().unwrap());
multi_workspace
.update(cx, |multi_workspace, _, cx| {
... |
rust_dataset_chunk_508361 | rust_dataset.txt | 508,361 | 512 | yncResponseSender(response_tx));
cx.spawn(|mut cx| async move {
handle_cli_connection((request_rx, response_sink), app_state, &mut cx).await;
})
.detach();
let prompt_called = Arc::new(std::sync::atomic::AtomicBool::new(false));
let prompt_called_for_thread = prompt... |
rust_dataset_chunk_508362 | rust_dataset.txt | 508,362 | 512 | project/file.txt").to_string()],
cli::OpenBehavior::Default,
),
None,
);
assert_eq!(status, 0);
assert!(
!prompt_shown,
"no prompt should be shown when no windows exist"
);
assert_eq!(cx.windows().len(), 1);
}
... |
rust_dataset_chunk_508363 | rust_dataset.txt | 508,363 | 512 | Create an existing window with project_a
open_workspace_file(
path!("/project_a"),
Default::default(),
app_state.clone(),
cx,
)
.await;
assert_eq!(cx.windows().len(), 1);
let (status, prompt_shown) = run_cli_with_zed_handler(
... |
rust_dataset_chunk_508364 | rust_dataset.txt | 508,364 | 512 | AppContext) {
let app_state = init_test(cx);
app_state
.fs
.as_fake()
.insert_tree(path!("/project"), json!({ "file.txt": "content" }))
.await;
cx.update(|cx| {
settings::SettingsStore::update_global(cx, |store, cx| {
... |
rust_dataset_chunk_508365 | rust_dataset.txt | 508,365 | 512 | .unwrap();
}
#[gpui::test]
async fn test_e2e_new_window_setting_opens_project_root_in_new_window(cx: &mut TestAppContext) {
let app_state = init_test(cx);
app_state
.fs
.as_fake()
.insert_tree(path!("/project"), json!({ "file.txt": "content" }))
... |
rust_dataset_chunk_508366 | rust_dataset.txt | 508,366 | 512 | (cx, |store, cx| {
store.update_user_settings(cx, |settings| {
settings.workspace.cli_default_open_behavior =
Some(settings::CliDefaultOpenBehavior::NewWindow);
});
});
});
open_workspace_file(path!("/project"), Def... |
rust_dataset_chunk_508367 | rust_dataset.txt | 508,367 | 512 | ui::test]
async fn test_e2e_explicit_new_flag_no_prompt(cx: &mut TestAppContext) {
let app_state = init_test(cx);
app_state
.fs
.as_fake()
.insert_tree(path!("/project_a"), json!({ "file.txt": "content" }))
.await;
app_state
.fs
... |
rust_dataset_chunk_508368 | rust_dataset.txt | 508,368 | 512 | async fn test_e2e_paths_in_existing_workspace_no_prompt(cx: &mut TestAppContext) {
let app_state = init_test(cx);
app_state
.fs
.as_fake()
.insert_tree(
path!("/project"),
json!({
"src": {
... |
rust_dataset_chunk_508369 | rust_dataset.txt | 508,369 | 512 | ...", window, cx);
editor
});
Self {
editor,
last_error: None,
}
}
fn cancel(&mut self, _: &menu::Cancel, _window: &mut Window, cx: &mut Context<Self>) {
cx.emit(DismissEvent);
}
fn confirm(&mut self, _: &menu::Confirm, window: &mut ... |
rust_dataset_chunk_508370 | rust_dataset.txt | 508,370 | 512 | .child(
Label::new("Paste a URL to open.")
.color(Color::Muted)
.size(LabelSize::Small),
)
}),
)
}
}
--- FILE: zed/crates/zed/src/zed/quick_action_bar/preview.rs ---
... |
rust_dataset_chunk_508371 | rust_dataset.txt | 508,371 | 512 | &dyn gpui::Action,
),
};
let alt_click = gpui::Keystroke {
key: "click".into(),
modifiers: Modifiers::alt(),
..Default::default()
};
let button = IconButton::new(button_id, IconName::Eye)
.icon_size(IconSize::Small)
... |
rust_dataset_chunk_508372 | rust_dataset.txt | 508,372 | 512 | (button.into_any_element())
}
}
--- FILE: zed/crates/zed/src/zed/quick_action_bar/repl_menu.rs ---
use gpui::ElementId;
use gpui::TaskExt;
use gpui::{AnyElement, Entity};
use picker::Picker;
use repl::{
ExecutionState, JupyterSettings, Kernel, KernelSpecification, KernelStatus, Session,
SessionSupport,
... |
rust_dataset_chunk_508373 | rust_dataset.txt | 508,373 | 512 | cx);
}
SessionSupport::Unsupported => return None,
};
let menu_state = session_state(session.clone(), cx);
let id = "repl-menu";
let element_id = |suffix| ElementId::Name(format!("{}-{}", id, suffix).into());
let editor = editor.downgrade();
l... |
rust_dataset_chunk_508374 | rust_dataset.txt | 508,374 | 512 | editor = editor.clone();
move |_, cx| {
repl::interrupt(editor.clone(), cx);
}
},
)
.custom_entry(
move |_window, _cx| {
... |
rust_dataset_chunk_508375 | rust_dataset.txt | 508,375 | 512 | _background))
.into_any_element()
})
.size(ButtonSize::Compact)
.style(ButtonStyle::Subtle)
.tooltip(Tooltip::text(menu_state.tooltip))
.on_click(|_, window, cx| window.dispatch_action(Box::new(repl::Run {}), cx))
.into_any_element(... |
rust_dataset_chunk_508376 | rust_dataset.txt | 508,376 | 512 | (cx).kernel_specification.clone())
}
SessionSupport::Inactive(kernel_specification) => Some(kernel_specification),
SessionSupport::RequiresSetup(_language_name) => None,
SessionSupport::Unsupported => None,
};
let current_kernel_name = current_kernelspec.... |
rust_dataset_chunk_508377 | rust_dataset.txt | 508,377 | 512 | )
.style(ButtonStyle::Subtle)
.shape(ui::IconButtonShape::Square)
.icon_size(ui::IconSize::Small)
.icon_color(Color::Muted)
.tooltip(Tooltip::text(tooltip))
.on_click(|_, _wind... |
rust_dataset_chunk_508378 | rust_dataset.txt | 508,378 | 512 | State {
tooltip: "Nothing running".into(),
icon: IconName::ReplNeutral,
icon_color: Color::Default,
icon_is_animating: false,
popover_disabled: false,
indicator: None,
status: KernelStatus::Shutdown,
..fill_fields()
};
match &session.kernel {
... |
rust_dataset_chunk_508379 | rust_dataset.txt | 508,379 | 512 | Editor, EditorSettings};
use gpui::{
Action, Anchor, AnchoredPositionMode, ClickEvent, Context, ElementId, Entity, EventEmitter,
FocusHandle, Focusable, InteractiveElement, ParentElement, Render, Styled, Subscription,
WeakEntity, Window, anchored, deferred, point,
};
use project::{
DisableAiSettings,
... |
rust_dataset_chunk_508380 | rust_dataset.txt | 508,380 | 512 | buffer_search_bar,
show: true,
toggle_selections_handle: Default::default(),
toggle_settings_handle: Default::default(),
workspace: workspace.weak_handle(),
};
this.apply_settings(cx);
cx.observe_global::<SettingsStore>(|this, cx| this.... |
rust_dataset_chunk_508381 | rust_dataset.txt | 508,381 | 512 | editor_value.git_blame_inline_enabled();
let show_git_blame_gutter = editor_value.show_git_blame_gutter();
let auto_signature_help_enabled = editor_value.auto_signature_help_enabled(cx);
let show_line_numbers = editor_value.line_numbers_enabled(cx);
let has_edit_prediction_provider = ed... |
rust_dataset_chunk_508382 | rust_dataset.txt | 508,382 | 512 | editor.render_context_menu(MAX_CODE_ACTION_MENU_LINES, window, cx)
})
})
.flatten();
v_flex()
.child(
IconButton::new("toggle_code_actions_icon", IconName::BoltOutlined)
.icon_size(IconSize::Smal... |
rust_dataset_chunk_508383 | rust_dataset.txt | 508,383 | 512 | .toggle_selections_handle.clone())
.anchor(Anchor::TopRight)
.menu(move |window, cx| {
let focus = focus.clone();
let menu = ContextMenu::build(window, cx, move |menu, _, _| {
menu.context(focus.clone())
... |
rust_dataset_chunk_508384 | rust_dataset.txt | 508,384 | 512 | _branch =
ProjectSettings::get_global(cx).git.diff_base == GitDiffBaseSetting::DefaultBranch;
let fs = self
.workspace
.upgrade()
.map(|workspace| workspace.read(cx).app_state().fs.clone());
PopoverMenu::new("editor-settings")
... |
rust_dataset_chunk_508385 | rust_dataset.txt | 508,385 | 512 | })
.ok();
}
},
);
}
if supports_code_lens {
... |
rust_dataset_chunk_508386 | rust_dataset.txt | 508,386 | 512 | | {
editor.toggle_diagnostics(
&ToggleDiagnostics,
window,
cx,
... |
rust_dataset_chunk_508387 | rust_dataset.txt | 508,387 | 512 | _menu(
&editor::actions::ToggleAutoSignatureHelp,
window,
cx,
);
})
... |
rust_dataset_chunk_508388 | rust_dataset.txt | 508,388 | 512 | {
move |window, cx| {
let new_value = !helix_mode_enabled;
HelixModeSetting::override_global(HelixModeSetting(new_value), cx);
VimModeSetting::override_global(VimM... |
rust_dataset_chunk_508389 | rust_dataset.txt | 508,389 | 512 | })
.on_click(move |event, window, cx| (self.on_click)(event, window, cx))
}
}
impl ToolbarItemView for QuickActionBar {
fn set_active_pane_item(
&mut self,
active_pane_item: Option<&dyn ItemHandle>,
_: &mut Window,
cx: &mut Context<Self>,
) -> ToolbarItemLocatio... |
rust_dataset_chunk_508390 | rust_dataset.txt | 508,390 | 512 | (cx);
let Some(remote_client) = project.remote_client() else {
return;
};
workspace.register_action({
let remote_client = remote_client.downgrade();
move |_, _: &SimulateDisconnect, _window, cx| {
let Some(remote_client) = remote_client.upgrad... |
rust_dataset_chunk_508391 | rust_dataset.txt | 508,391 | 512 | use editor::{Editor, MultiBuffer};
use extension_host::ExtensionStore;
use feature_flags::{FeatureFlagAppExt as _, PanicFeatureFlag};
use fs::Fs;
use futures::FutureExt as _;
use futures::{StreamExt, channel::mpsc, select_biased};
use git_ui::branch_diff::BranchDiffToolbar;
use git_ui::commit_view::CommitViewToolbar;
u... |
rust_dataset_chunk_508392 | rust_dataset.txt | 508,392 | 512 | KeybindSource,
KeymapFile, KeymapFileLoadResult, MigrationStatus, SPECIFIC_OVERRIDES_KEYMAP_PATH, Settings,
SettingsFile, SettingsStore, VIM_KEYMAP_PATH, initial_local_debug_tasks_content,
initial_project_settings_content, initial_tasks_content, update_settings_file,
};
use sidebar::Sidebar;
#[cfg(debug_as... |
rust_dataset_chunk_508393 | rust_dataset.txt | 508,393 | 512 | project-specific settings file.
OpenProjectSettingsFile,
/// Opens the tasks panel.
OpenTasks,
/// Opens debug tasks configuration.
OpenDebugTasks,
/// Shows the default semantic token rules (read-only).
ShowDefaultSemanticTokenRules,
/// Resets the appli... |
rust_dataset_chunk_508394 | rust_dataset.txt | 508,394 | 512 | ;
move |flag, cx| {
if added || !*flag {
return;
}
added = true;
cx.on_action(|_: &TestPanic, _| panic!("Ran the TestPanic action"))
.on_action(|_: &TestCrash, _| {
unsafe extern "C" {
fn ... |
rust_dataset_chunk_508395 | rust_dataset.txt | 508,395 | 512 | on_action(|_: &OpenTasks, cx| {
with_active_or_new_workspace(cx, |_, window, cx| {
open_settings_file(
paths::tasks_file(),
|| settings::initial_tasks_content().as_ref().into(),
window,
cx,
);
});
})
.on_acti... |
rust_dataset_chunk_508396 | rust_dataset.txt | 508,396 | 512 | (display_uuid: Option<Uuid>, cx: &mut App) -> WindowOptions {
let display = display_uuid.and_then(|uuid| {
cx.displays()
.into_iter()
.find(|display| display.uuid().ok() == Some(uuid))
});
let app_id = ReleaseChannel::global(cx).app_id();
let window_decorations = match st... |
rust_dataset_chunk_508397 | rust_dataset.txt | 508,397 | 512 | the Window-menu tiling items enabled. No-op on
// other platforms.
app_owns_titlebar_drag: true,
display_id: display.map(|display| display.id()),
window_background: cx.theme().window_background_appearance(),
app_id: Some(app_id.to_owned()),
#[cfg(any(target_os = "linux",... |
rust_dataset_chunk_508398 | rust_dataset.txt | 508,398 | 512 | ();
project_handle.assert_released();
})
.detach();
})
.detach();
}
cx.spawn_in(window, async move |_this, cx| {
const TELEMETRY_INTERVAL: std::time::Duration = std::time::Duration::from_mins(5);
loop {
... |
rust_dataset_chunk_508399 | rust_dataset.txt | 508,399 | 512 | ok();
});
})
.detach();
cx.observe_new(move |workspace: &mut Workspace, window, cx| {
let Some(window) = window else {
return;
};
let workspace_handle = cx.entity();
let center_pane = workspace.active_pane().clone();
initialize_pane(workspace, &c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.