This commit is contained in:
parent
e768eb0a34
commit
3e68f7fde4
10 changed files with 49 additions and 111 deletions
|
@ -329,7 +329,6 @@ impl RemoteBufferStore {
|
|||
&self,
|
||||
path: Arc<Path>,
|
||||
worktree: Entity<Worktree>,
|
||||
skip_file_contents: bool,
|
||||
cx: &mut Context<BufferStore>,
|
||||
) -> Task<Result<Entity<Buffer>>> {
|
||||
let worktree_id = worktree.read(cx).id().to_proto();
|
||||
|
@ -342,7 +341,6 @@ impl RemoteBufferStore {
|
|||
project_id,
|
||||
worktree_id,
|
||||
path: path_string,
|
||||
skip_file_contents,
|
||||
})
|
||||
.await?;
|
||||
let buffer_id = BufferId::new(response.buffer_id)?;
|
||||
|
@ -788,11 +786,10 @@ impl LocalBufferStore {
|
|||
&self,
|
||||
path: Arc<Path>,
|
||||
worktree: Entity<Worktree>,
|
||||
skip_file_contents: bool,
|
||||
cx: &mut Context<BufferStore>,
|
||||
) -> Task<Result<Entity<Buffer>>> {
|
||||
let load_buffer = worktree.update(cx, |worktree, cx| {
|
||||
let load_file = worktree.load_file(path.as_ref(), skip_file_contents, cx);
|
||||
let load_file = worktree.load_file(path.as_ref(), cx);
|
||||
let reservation = cx.reserve_entity();
|
||||
let buffer_id = BufferId::from(reservation.entity_id().as_non_zero_u64());
|
||||
cx.spawn(move |_, mut cx| async move {
|
||||
|
@ -976,7 +973,6 @@ impl BufferStore {
|
|||
pub fn open_buffer(
|
||||
&mut self,
|
||||
project_path: ProjectPath,
|
||||
skip_file_contents: bool,
|
||||
cx: &mut Context<Self>,
|
||||
) -> Task<Result<Entity<Buffer>>> {
|
||||
if let Some(buffer) = self.get_by_path(&project_path, cx) {
|
||||
|
@ -995,12 +991,8 @@ impl BufferStore {
|
|||
return Task::ready(Err(anyhow!("no such worktree")));
|
||||
};
|
||||
let load_buffer = match &self.state {
|
||||
BufferStoreState::Local(this) => {
|
||||
this.open_buffer(path, worktree, skip_file_contents, cx)
|
||||
}
|
||||
BufferStoreState::Remote(this) => {
|
||||
this.open_buffer(path, worktree, skip_file_contents, cx)
|
||||
}
|
||||
BufferStoreState::Local(this) => this.open_buffer(path, worktree, cx),
|
||||
BufferStoreState::Remote(this) => this.open_buffer(path, worktree, cx),
|
||||
};
|
||||
|
||||
entry
|
||||
|
@ -1493,7 +1485,7 @@ impl BufferStore {
|
|||
let buffers = this.update(&mut cx, |this, cx| {
|
||||
project_paths
|
||||
.into_iter()
|
||||
.map(|project_path| this.open_buffer(project_path, false, cx))
|
||||
.map(|project_path| this.open_buffer(project_path, cx))
|
||||
.collect::<Vec<_>>()
|
||||
})?;
|
||||
for buffer_task in buffers {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue