Upgrade toml
to v0.8 (#7931)
This PR upgrades our `toml` dependency to v0.8. I noticed that our current version of `toml` wasn't able to parse certain kinds of documents involving enums, whereas the newer version can. Release Notes: - N/A
This commit is contained in:
parent
f82b2741cd
commit
3cbc18895a
4 changed files with 72 additions and 22 deletions
|
@ -415,8 +415,8 @@ impl ExtensionStore {
|
|||
language.matcher.clone(),
|
||||
vec![],
|
||||
move || {
|
||||
let config = std::fs::read(language_path.join("config.toml"))?;
|
||||
let config: LanguageConfig = ::toml::from_slice(&config)?;
|
||||
let config = std::fs::read_to_string(language_path.join("config.toml"))?;
|
||||
let config: LanguageConfig = ::toml::from_str(&config)?;
|
||||
let queries = load_plugin_queries(&language_path);
|
||||
Ok((config, queries))
|
||||
},
|
||||
|
|
|
@ -337,13 +337,17 @@ pub async fn language(
|
|||
}
|
||||
|
||||
fn load_config(name: &str) -> LanguageConfig {
|
||||
::toml::from_slice(
|
||||
&LanguageDir::get(&format!("{}/config.toml", name))
|
||||
let config_toml = String::from_utf8(
|
||||
LanguageDir::get(&format!("{}/config.toml", name))
|
||||
.unwrap()
|
||||
.data,
|
||||
.data
|
||||
.to_vec(),
|
||||
)
|
||||
.with_context(|| format!("failed to load config.toml for language {name:?}"))
|
||||
.unwrap()
|
||||
.unwrap();
|
||||
|
||||
::toml::from_str(&config_toml)
|
||||
.with_context(|| format!("failed to load config.toml for language {name:?}"))
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
fn load_queries(name: &str) -> LanguageQueries {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue