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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user