mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-08 07:35:01 +03:00
Avoid panic when rust language isn't present (project unit tests)
This commit is contained in:
parent
e1556893f7
commit
2cbb313467
@ -75,18 +75,11 @@ impl Project {
|
||||
let path = Arc::from(abs_path);
|
||||
let language_server = languages
|
||||
.get_language("Rust")
|
||||
.unwrap()
|
||||
.start_server(&path, cx);
|
||||
.map(|language| language.start_server(&path, cx));
|
||||
cx.spawn(|this, mut cx| async move {
|
||||
let worktree = Worktree::open_local(
|
||||
rpc,
|
||||
path,
|
||||
fs,
|
||||
languages,
|
||||
language_server.log_err().flatten(),
|
||||
&mut cx,
|
||||
)
|
||||
.await?;
|
||||
let language_server = language_server.and_then(|language| language.log_err().flatten());
|
||||
let worktree =
|
||||
Worktree::open_local(rpc, path, fs, languages, language_server, &mut cx).await?;
|
||||
this.update(&mut cx, |this, cx| {
|
||||
this.add_worktree(worktree.clone(), cx);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user