Compare commits
10 Commits
dont-set-s
...
v0.134.1-p
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bc0dd3aecb | ||
|
|
bb394bd9d0 | ||
|
|
a5eec9c25e | ||
|
|
9529e367a9 | ||
|
|
932555abca | ||
|
|
6e5e482854 | ||
|
|
f3a82e450f | ||
|
|
8a1e4512c4 | ||
|
|
03abd7df78 | ||
|
|
28b0378fe9 |
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -329,7 +329,7 @@ jobs:
|
||||
with:
|
||||
draft: true
|
||||
prerelease: ${{ env.RELEASE_CHANNEL == 'preview' }}
|
||||
files: target/release/zed-linux-x86_64.tar.gz
|
||||
files: zed-linux-x86_64.tar.gz
|
||||
body: ""
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -12654,7 +12654,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "zed"
|
||||
version = "0.134.0"
|
||||
version = "0.134.1"
|
||||
dependencies = [
|
||||
"activity_indicator",
|
||||
"anyhow",
|
||||
|
||||
@@ -12,7 +12,7 @@ use settings::{Settings, SettingsStore};
|
||||
use sha2::{Digest, Sha256};
|
||||
use std::io::Write;
|
||||
use std::{env, mem, path::PathBuf, sync::Arc, time::Duration};
|
||||
use sysinfo::{CpuRefreshKind, MemoryRefreshKind, Pid, ProcessRefreshKind, RefreshKind, System};
|
||||
use sysinfo::{CpuRefreshKind, Pid, ProcessRefreshKind, RefreshKind, System};
|
||||
use telemetry_events::{
|
||||
ActionEvent, AppEvent, AssistantEvent, AssistantKind, CallEvent, CopilotEvent, CpuEvent,
|
||||
EditEvent, EditorEvent, Event, EventRequestBody, EventWrapper, ExtensionEvent, MemoryEvent,
|
||||
@@ -171,40 +171,38 @@ impl Telemetry {
|
||||
drop(state);
|
||||
|
||||
let this = self.clone();
|
||||
cx.spawn(|_| async move {
|
||||
// Avoiding calling `System::new_all()`, as there have been crashes related to it
|
||||
let refresh_kind = RefreshKind::new()
|
||||
.with_memory(MemoryRefreshKind::everything()) // For memory usage
|
||||
.with_processes(ProcessRefreshKind::everything()) // For process usage
|
||||
.with_cpu(CpuRefreshKind::everything()); // For core count
|
||||
|
||||
let mut system = System::new_with_specifics(refresh_kind);
|
||||
|
||||
// Avoiding calling `refresh_all()`, just update what we need
|
||||
system.refresh_specifics(refresh_kind);
|
||||
|
||||
// Waiting some amount of time before the first query is important to get a reasonable value
|
||||
// https://docs.rs/sysinfo/0.29.10/sysinfo/trait.ProcessExt.html#tymethod.cpu_usage
|
||||
const DURATION_BETWEEN_SYSTEM_EVENTS: Duration = Duration::from_secs(4 * 60);
|
||||
|
||||
loop {
|
||||
smol::Timer::after(DURATION_BETWEEN_SYSTEM_EVENTS).await;
|
||||
|
||||
system.refresh_specifics(refresh_kind);
|
||||
cx.background_executor()
|
||||
.spawn(async move {
|
||||
let mut system = System::new_with_specifics(
|
||||
RefreshKind::new().with_cpu(CpuRefreshKind::everything()),
|
||||
);
|
||||
|
||||
let refresh_kind = ProcessRefreshKind::new().with_cpu().with_memory();
|
||||
let current_process = Pid::from_u32(std::process::id());
|
||||
let Some(process) = system.processes().get(¤t_process) else {
|
||||
let process = current_process;
|
||||
log::error!("Failed to find own process {process:?} in system process table");
|
||||
// TODO: Fire an error telemetry event
|
||||
return;
|
||||
};
|
||||
system.refresh_process_specifics(current_process, refresh_kind);
|
||||
|
||||
this.report_memory_event(process.memory(), process.virtual_memory());
|
||||
this.report_cpu_event(process.cpu_usage(), system.cpus().len() as u32);
|
||||
}
|
||||
})
|
||||
.detach();
|
||||
// Waiting some amount of time before the first query is important to get a reasonable value
|
||||
// https://docs.rs/sysinfo/0.29.10/sysinfo/trait.ProcessExt.html#tymethod.cpu_usage
|
||||
const DURATION_BETWEEN_SYSTEM_EVENTS: Duration = Duration::from_secs(4 * 60);
|
||||
|
||||
loop {
|
||||
smol::Timer::after(DURATION_BETWEEN_SYSTEM_EVENTS).await;
|
||||
|
||||
let current_process = Pid::from_u32(std::process::id());
|
||||
system.refresh_process_specifics(current_process, refresh_kind);
|
||||
let Some(process) = system.process(current_process) else {
|
||||
log::error!(
|
||||
"Failed to find own process {current_process:?} in system process table"
|
||||
);
|
||||
// TODO: Fire an error telemetry event
|
||||
return;
|
||||
};
|
||||
|
||||
this.report_memory_event(process.memory(), process.virtual_memory());
|
||||
this.report_cpu_event(process.cpu_usage(), system.cpus().len() as u32);
|
||||
}
|
||||
})
|
||||
.detach();
|
||||
}
|
||||
|
||||
pub fn set_authenticated_user_info(
|
||||
|
||||
@@ -264,7 +264,7 @@ pub async fn post_hang(
|
||||
Error::Internal(anyhow!(err))
|
||||
})?;
|
||||
|
||||
let mut backtrace = "Possible hang detected on main threadL".to_string();
|
||||
let mut backtrace = "Possible hang detected on main thread:".to_string();
|
||||
let unknown = "<unknown>".to_string();
|
||||
for frame in report.backtrace.iter() {
|
||||
backtrace.push_str(&format!("\n{}", frame.symbols.first().unwrap_or(&unknown)));
|
||||
|
||||
@@ -9054,8 +9054,11 @@ impl Editor {
|
||||
return;
|
||||
}
|
||||
|
||||
let focused = self.focus_handle(cx).contains_focused(cx);
|
||||
|
||||
let project = project.clone();
|
||||
let blame = cx.new_model(|cx| GitBlame::new(buffer, project, user_triggered, cx));
|
||||
let blame =
|
||||
cx.new_model(|cx| GitBlame::new(buffer, project, user_triggered, focused, cx));
|
||||
self.blame_subscription = Some(cx.observe(&blame, |_, _, cx| cx.notify()));
|
||||
self.blame = Some(blame);
|
||||
}
|
||||
@@ -10055,6 +10058,10 @@ impl Editor {
|
||||
let rename_editor_focus_handle = rename.editor.read(cx).focus_handle.clone();
|
||||
cx.focus(&rename_editor_focus_handle);
|
||||
} else {
|
||||
if let Some(blame) = self.blame.as_ref() {
|
||||
blame.update(cx, GitBlame::focus)
|
||||
}
|
||||
|
||||
self.blink_manager.update(cx, BlinkManager::enable);
|
||||
self.show_cursor_names(cx);
|
||||
self.buffer.update(cx, |buffer, cx| {
|
||||
@@ -10075,6 +10082,10 @@ impl Editor {
|
||||
self.blink_manager.update(cx, BlinkManager::disable);
|
||||
self.buffer
|
||||
.update(cx, |buffer, cx| buffer.remove_active_selections(cx));
|
||||
|
||||
if let Some(blame) = self.blame.as_ref() {
|
||||
blame.update(cx, GitBlame::blur)
|
||||
}
|
||||
self.hide_context_menu(cx);
|
||||
hide_hover(self, cx);
|
||||
cx.emit(EditorEvent::Blurred);
|
||||
|
||||
@@ -88,7 +88,9 @@ pub struct GitBlame {
|
||||
buffer_snapshot: BufferSnapshot,
|
||||
buffer_edits: text::Subscription,
|
||||
task: Task<Result<()>>,
|
||||
focused: bool,
|
||||
generated: bool,
|
||||
changed_while_blurred: bool,
|
||||
user_triggered: bool,
|
||||
regenerate_on_edit_task: Task<Result<()>>,
|
||||
_regenerate_subscriptions: Vec<Subscription>,
|
||||
@@ -99,6 +101,7 @@ impl GitBlame {
|
||||
buffer: Model<Buffer>,
|
||||
project: Model<Project>,
|
||||
user_triggered: bool,
|
||||
focused: bool,
|
||||
cx: &mut ModelContext<Self>,
|
||||
) -> Self {
|
||||
let entries = SumTree::from_item(
|
||||
@@ -153,6 +156,8 @@ impl GitBlame {
|
||||
entries,
|
||||
buffer_edits,
|
||||
user_triggered,
|
||||
focused,
|
||||
changed_while_blurred: false,
|
||||
commit_details: HashMap::default(),
|
||||
task: Task::ready(Ok(())),
|
||||
generated: false,
|
||||
@@ -186,6 +191,18 @@ impl GitBlame {
|
||||
})
|
||||
}
|
||||
|
||||
pub fn blur(&mut self, _: &mut ModelContext<Self>) {
|
||||
self.focused = false;
|
||||
}
|
||||
|
||||
pub fn focus(&mut self, cx: &mut ModelContext<Self>) {
|
||||
self.focused = true;
|
||||
if self.changed_while_blurred {
|
||||
self.changed_while_blurred = false;
|
||||
self.generate(cx);
|
||||
}
|
||||
}
|
||||
|
||||
fn sync(&mut self, cx: &mut ModelContext<Self>) {
|
||||
let edits = self.buffer_edits.consume();
|
||||
let new_snapshot = self.buffer.read(cx).snapshot();
|
||||
@@ -298,6 +315,10 @@ impl GitBlame {
|
||||
}
|
||||
|
||||
fn generate(&mut self, cx: &mut ModelContext<Self>) {
|
||||
if !self.focused {
|
||||
self.changed_while_blurred = true;
|
||||
return;
|
||||
}
|
||||
let buffer_edits = self.buffer.update(cx, |buffer, _| buffer.subscribe());
|
||||
let snapshot = self.buffer.read(cx).snapshot();
|
||||
let blame = self.project.read(cx).blame_buffer(&self.buffer, None, cx);
|
||||
@@ -544,7 +565,8 @@ mod tests {
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let blame = cx.new_model(|cx| GitBlame::new(buffer.clone(), project.clone(), true, cx));
|
||||
let blame =
|
||||
cx.new_model(|cx| GitBlame::new(buffer.clone(), project.clone(), true, true, cx));
|
||||
|
||||
let event = project.next_event(cx).await;
|
||||
assert_eq!(
|
||||
@@ -613,7 +635,7 @@ mod tests {
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let git_blame = cx.new_model(|cx| GitBlame::new(buffer.clone(), project, false, cx));
|
||||
let git_blame = cx.new_model(|cx| GitBlame::new(buffer.clone(), project, false, true, cx));
|
||||
|
||||
cx.executor().run_until_parked();
|
||||
|
||||
@@ -693,7 +715,7 @@ mod tests {
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let git_blame = cx.new_model(|cx| GitBlame::new(buffer.clone(), project, false, cx));
|
||||
let git_blame = cx.new_model(|cx| GitBlame::new(buffer.clone(), project, false, true, cx));
|
||||
|
||||
cx.executor().run_until_parked();
|
||||
|
||||
@@ -842,7 +864,7 @@ mod tests {
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
let git_blame = cx.new_model(|cx| GitBlame::new(buffer.clone(), project, false, cx));
|
||||
let git_blame = cx.new_model(|cx| GitBlame::new(buffer.clone(), project, false, true, cx));
|
||||
cx.executor().run_until_parked();
|
||||
git_blame.update(cx, |blame, cx| blame.check_invariants(cx));
|
||||
|
||||
|
||||
@@ -47,7 +47,6 @@ mod macos {
|
||||
.header("src/platform/mac/dispatch.h")
|
||||
.allowlist_var("_dispatch_main_q")
|
||||
.allowlist_var("_dispatch_source_type_data_add")
|
||||
.allowlist_var("DISPATCH_QUEUE_PRIORITY_DEFAULT")
|
||||
.allowlist_var("DISPATCH_QUEUE_PRIORITY_HIGH")
|
||||
.allowlist_var("DISPATCH_TIME_NOW")
|
||||
.allowlist_function("dispatch_get_global_queue")
|
||||
|
||||
@@ -76,7 +76,7 @@ impl PlatformDispatcher for MacDispatcher {
|
||||
fn dispatch_after(&self, duration: Duration, runnable: Runnable) {
|
||||
unsafe {
|
||||
let queue =
|
||||
dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT.try_into().unwrap(), 0);
|
||||
dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH.try_into().unwrap(), 0);
|
||||
let when = dispatch_time(DISPATCH_TIME_NOW as u64, duration.as_nanos() as i64);
|
||||
dispatch_after_f(
|
||||
when,
|
||||
|
||||
@@ -98,8 +98,14 @@ impl PtyProcessInfo {
|
||||
|
||||
fn refresh(&mut self) -> Option<&Process> {
|
||||
let pid = self.pid_getter.pid()?;
|
||||
self.system.refresh_processes_specifics(self.refresh_kind);
|
||||
self.system.process(pid)
|
||||
if self
|
||||
.system
|
||||
.refresh_process_specifics(pid, self.refresh_kind)
|
||||
{
|
||||
self.system.process(pid)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
fn load(&mut self) -> Option<ProcessInfo> {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
description = "The fast, collaborative code editor."
|
||||
edition = "2021"
|
||||
name = "zed"
|
||||
version = "0.134.0"
|
||||
version = "0.134.1"
|
||||
publish = false
|
||||
license = "GPL-3.0-or-later"
|
||||
authors = ["Zed Team <hi@zed.dev>"]
|
||||
|
||||
@@ -1 +1 @@
|
||||
dev
|
||||
preview
|
||||
@@ -52,17 +52,17 @@ zed_dir="${temp_dir}/zed$suffix.app"
|
||||
|
||||
# Binary
|
||||
mkdir -p "${zed_dir}/bin"
|
||||
cp "target/${target_triple}/release/Zed" "${zed_dir}/zed"
|
||||
cp "target/${target_triple}/release/Zed" "${zed_dir}/bin/zed"
|
||||
|
||||
# Icons
|
||||
mkdir -p "${zed_dir}/share/icons/hicolor/512x512/apps"
|
||||
cp "crates/zed/resources/app-icon$suffix.png" "${zed_dir}/share/icons/hicolor/512x512/apps/zed.png"
|
||||
mkdir -p "${zed_dir}/share/icons/hicolor/1024x1024/apps"
|
||||
cp "crates/zed/resources/app-icon$suffix/share/icons/hicolor/1024x1024/apps/zed.png"
|
||||
cp "crates/zed/resources/app-icon$suffix@2x.png" "${zed_dir}/share/icons/hicolor/1024x1024/apps/zed.png"
|
||||
|
||||
# .desktop
|
||||
mkdir -p "${zed_dir}/share/applications"
|
||||
cp "crates/zed/resources/zed$suffix.desktop" "${zed_dir}/share/applications/zed$suffix.desktop"
|
||||
cp "crates/zed/resources/zed.desktop" "${zed_dir}/share/applications/zed$suffix.desktop"
|
||||
if [[ "$channel" == "preview" ]]; then
|
||||
sed -i "s|Name=Zed|Name=Zed Preview|g" "${zed_dir}/share/applications/zed$suffix.desktop"
|
||||
elif [[ "$channel" == "nightly" ]]; then
|
||||
@@ -84,4 +84,4 @@ else
|
||||
fi
|
||||
|
||||
rm -rf "${archive}"
|
||||
tar -czvf $archive -C ${temp_dir} ${zed_dir}
|
||||
tar -czvf $archive -C ${temp_dir} "zed$suffix.app"
|
||||
|
||||
Reference in New Issue
Block a user