Fix incomplete language names list being used for JSON schema
For now, since initializing the languages themselves is still async, create a parallel duplicated code path that is synchronous, and just provided the language names.
This commit is contained in:
parent
cd87c5552e
commit
4775d839d7
3 changed files with 25 additions and 4 deletions
|
@ -248,7 +248,7 @@ impl Settings {
|
|||
|
||||
pub fn settings_file_json_schema(
|
||||
theme_names: Vec<String>,
|
||||
language_names: Vec<String>,
|
||||
language_names: &[String],
|
||||
) -> serde_json::Value {
|
||||
let settings = SchemaSettings::draft07().with(|settings| {
|
||||
settings.option_add_null_type = false;
|
||||
|
@ -275,8 +275,13 @@ pub fn settings_file_json_schema(
|
|||
instance_type: Some(SingleOrVec::Single(Box::new(InstanceType::Object))),
|
||||
object: Some(Box::new(ObjectValidation {
|
||||
properties: language_names
|
||||
.into_iter()
|
||||
.map(|name| (name, Schema::new_ref("#/definitions/EditorSettings".into())))
|
||||
.iter()
|
||||
.map(|name| {
|
||||
(
|
||||
name.clone(),
|
||||
Schema::new_ref("#/definitions/EditorSettings".into()),
|
||||
)
|
||||
})
|
||||
.collect(),
|
||||
..Default::default()
|
||||
})),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue