Avoid panic when rust language isn't present (project unit tests)
This commit is contained in:
parent
e1556893f7
commit
2cbb313467
1 changed files with 4 additions and 11 deletions
|
@ -75,18 +75,11 @@ impl Project {
|
||||||
let path = Arc::from(abs_path);
|
let path = Arc::from(abs_path);
|
||||||
let language_server = languages
|
let language_server = languages
|
||||||
.get_language("Rust")
|
.get_language("Rust")
|
||||||
.unwrap()
|
.map(|language| language.start_server(&path, cx));
|
||||||
.start_server(&path, cx);
|
|
||||||
cx.spawn(|this, mut cx| async move {
|
cx.spawn(|this, mut cx| async move {
|
||||||
let worktree = Worktree::open_local(
|
let language_server = language_server.and_then(|language| language.log_err().flatten());
|
||||||
rpc,
|
let worktree =
|
||||||
path,
|
Worktree::open_local(rpc, path, fs, languages, language_server, &mut cx).await?;
|
||||||
fs,
|
|
||||||
languages,
|
|
||||||
language_server.log_err().flatten(),
|
|
||||||
&mut cx,
|
|
||||||
)
|
|
||||||
.await?;
|
|
||||||
this.update(&mut cx, |this, cx| {
|
this.update(&mut cx, |this, cx| {
|
||||||
this.add_worktree(worktree.clone(), cx);
|
this.add_worktree(worktree.clone(), cx);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue