settings: Allow null
as a value for font fallback fields (#20186)
This PR updates the `buffer_font_fallbacks` and `ui_font_fallbacks` settings to allow `null` as a value instead of showing a warning. Related to https://github.com/zed-industries/zed/issues/18006. Release Notes: - Updated the settings schema to allow `null` as a value for `buffer_font_fallbacks` and `ui_font_fallbacks` instead of showing a warning.
This commit is contained in:
parent
e1cb8a66f0
commit
77de20c23a
1 changed files with 7 additions and 2 deletions
|
@ -1,4 +1,6 @@
|
||||||
use schemars::schema::{ArrayValidation, InstanceType, RootSchema, Schema, SchemaObject};
|
use schemars::schema::{
|
||||||
|
ArrayValidation, InstanceType, RootSchema, Schema, SchemaObject, SingleOrVec,
|
||||||
|
};
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
|
|
||||||
pub struct SettingsJsonSchemaParams<'a> {
|
pub struct SettingsJsonSchemaParams<'a> {
|
||||||
|
@ -20,7 +22,10 @@ impl<'a> SettingsJsonSchemaParams<'a> {
|
||||||
|
|
||||||
pub fn font_fallback_schema(&self) -> Schema {
|
pub fn font_fallback_schema(&self) -> Schema {
|
||||||
SchemaObject {
|
SchemaObject {
|
||||||
instance_type: Some(InstanceType::Array.into()),
|
instance_type: Some(SingleOrVec::Vec(vec![
|
||||||
|
InstanceType::Array,
|
||||||
|
InstanceType::Null,
|
||||||
|
])),
|
||||||
array: Some(Box::new(ArrayValidation {
|
array: Some(Box::new(ArrayValidation {
|
||||||
items: Some(schemars::schema::SingleOrVec::Single(Box::new(
|
items: Some(schemars::schema::SingleOrVec::Single(Box::new(
|
||||||
self.font_family_schema(),
|
self.font_family_schema(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue