Compare commits

...

6 Commits

Author SHA1 Message Date
Joseph T. Lyons
0c090b6e05 zed 0.110.2 2023-10-26 11:54:32 +02:00
Piotr Osiewicz
c8233f0d26 vue: use anyhow::ensure instead of asserting on filesystem state (#3173)
Release Notes:
- Fixed a crash on failed assertion in Vue.js language support.
2023-10-26 11:49:24 +02:00
Joseph T. Lyons
26a6fac992 vcs_menu: Fix a circular view handle in modal picker. (#3168)
Release Notes:

- Fixed a crash in modal branch picker.
2023-10-25 18:45:08 +02:00
Max Brunsfeld
643d60c2e7 zed 0.110.1 2023-10-25 17:39:39 +02:00
Max Brunsfeld
e1dbc7e998 Bump RPC version for channels + notifications changes 2023-10-25 17:38:59 +02:00
Joseph T. Lyons
7499aa3be4 v0.110.x preview 2023-10-25 16:07:12 +02:00
6 changed files with 38 additions and 31 deletions

2
Cargo.lock generated
View File

@@ -10094,7 +10094,7 @@ dependencies = [
[[package]]
name = "zed"
version = "0.110.0"
version = "0.110.2"
dependencies = [
"activity_indicator",
"ai",

View File

@@ -9,4 +9,4 @@ pub use notification::*;
pub use peer::*;
mod macros;
pub const PROTOCOL_VERSION: u32 = 65;
pub const PROTOCOL_VERSION: u32 = 66;

View File

@@ -16,7 +16,7 @@ actions!(branches, [OpenRecent]);
pub fn init(cx: &mut AppContext) {
Picker::<BranchListDelegate>::init(cx);
cx.add_async_action(toggle);
cx.add_action(toggle);
}
pub type BranchList = Picker<BranchListDelegate>;
@@ -24,30 +24,29 @@ pub fn build_branch_list(
workspace: ViewHandle<Workspace>,
cx: &mut ViewContext<BranchList>,
) -> Result<BranchList> {
Ok(Picker::new(BranchListDelegate::new(workspace, 29, cx)?, cx)
.with_theme(|theme| theme.picker.clone()))
let delegate = workspace.read_with(cx, |workspace, cx| {
BranchListDelegate::new(workspace, cx.handle(), 29, cx)
})?;
Ok(Picker::new(delegate, cx).with_theme(|theme| theme.picker.clone()))
}
fn toggle(
_: &mut Workspace,
workspace: &mut Workspace,
_: &OpenRecent,
cx: &mut ViewContext<Workspace>,
) -> Option<Task<Result<()>>> {
Some(cx.spawn(|workspace, mut cx| async move {
workspace.update(&mut cx, |workspace, cx| {
// Modal branch picker has a longer trailoff than a popover one.
let delegate = BranchListDelegate::new(cx.handle(), 70, cx)?;
workspace.toggle_modal(cx, |_, cx| {
cx.add_view(|cx| {
Picker::new(delegate, cx)
.with_theme(|theme| theme.picker.clone())
.with_max_size(800., 1200.)
})
});
Ok::<_, anyhow::Error>(())
})??;
Ok(())
}))
) -> Result<()> {
// Modal branch picker has a longer trailoff than a popover one.
let delegate = BranchListDelegate::new(workspace, cx.handle(), 70, cx)?;
workspace.toggle_modal(cx, |_, cx| {
cx.add_view(|cx| {
Picker::new(delegate, cx)
.with_theme(|theme| theme.picker.clone())
.with_max_size(800., 1200.)
})
});
Ok(())
}
pub struct BranchListDelegate {
@@ -62,15 +61,16 @@ pub struct BranchListDelegate {
impl BranchListDelegate {
fn new(
workspace: ViewHandle<Workspace>,
workspace: &Workspace,
handle: ViewHandle<Workspace>,
branch_name_trailoff_after: usize,
cx: &AppContext,
) -> Result<Self> {
let project = workspace.read(cx).project().read(&cx);
let project = workspace.project().read(&cx);
let Some(worktree) = project.visible_worktrees(cx).next() else {
bail!("Cannot update branch list as there are no visible worktrees")
};
let mut cwd = worktree.read(cx).abs_path().to_path_buf();
cwd.push(".git");
let Some(repo) = project.fs().open_repo(&cwd) else {
@@ -79,13 +79,14 @@ impl BranchListDelegate {
let all_branches = repo.lock().branches()?;
Ok(Self {
matches: vec![],
workspace,
workspace: handle,
all_branches,
selected_index: 0,
last_query: Default::default(),
branch_name_trailoff_after,
})
}
fn display_error_toast(&self, message: String, cx: &mut ViewContext<BranchList>) {
const GIT_CHECKOUT_FAILURE_ID: usize = 2048;
self.workspace.update(cx, |model, ctx| {

View File

@@ -3,7 +3,7 @@ authors = ["Nathan Sobo <nathansobo@gmail.com>"]
description = "The fast, collaborative code editor."
edition = "2021"
name = "zed"
version = "0.110.0"
version = "0.110.2"
publish = false
[lib]

View File

@@ -1 +1 @@
dev
preview

View File

@@ -1,4 +1,4 @@
use anyhow::{anyhow, Result};
use anyhow::{anyhow, ensure, Result};
use async_trait::async_trait;
use futures::StreamExt;
pub use language::*;
@@ -98,7 +98,10 @@ impl super::LspAdapter for VueLspAdapter {
)
.await?;
}
assert!(fs::metadata(&server_path).await.is_ok());
ensure!(
fs::metadata(&server_path).await.is_ok(),
"@vue/language-server package installation failed"
);
if fs::metadata(&ts_path).await.is_err() {
self.node
.npm_install_packages(
@@ -108,7 +111,10 @@ impl super::LspAdapter for VueLspAdapter {
.await?;
}
assert!(fs::metadata(&ts_path).await.is_ok());
ensure!(
fs::metadata(&ts_path).await.is_ok(),
"typescript for Vue package installation failed"
);
*self.typescript_install_path.lock() = Some(ts_path);
Ok(LanguageServerBinary {
path: self.node.binary_path().await?,