Avoid an unwrap when loading languages (#8562)
We couldn't reproduce the panic, but I believe it was possible when uninstalling an extension while one if its grammars was still loading. Release Notes: - Fixed a crash that could happen when uninstalling a language extension while its grammar was loading. --------- Co-authored-by: Conrad <conrad@zed.dev>
This commit is contained in:
parent
4a4ca2c3b8
commit
9e4b3ce94c
5 changed files with 38 additions and 31 deletions
|
@ -1522,16 +1522,16 @@ mod tests {
|
|||
});
|
||||
|
||||
languages
|
||||
.language_for_file("the/script", None)
|
||||
.language_for_file("the/script".as_ref(), None)
|
||||
.await
|
||||
.unwrap_err();
|
||||
languages
|
||||
.language_for_file("the/script", Some(&"nothing".into()))
|
||||
.language_for_file("the/script".as_ref(), Some(&"nothing".into()))
|
||||
.await
|
||||
.unwrap_err();
|
||||
assert_eq!(
|
||||
languages
|
||||
.language_for_file("the/script", Some(&"#!/bin/env node".into()))
|
||||
.language_for_file("the/script".as_ref(), Some(&"#!/bin/env node".into()))
|
||||
.await
|
||||
.unwrap()
|
||||
.name()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue