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:
Marshall Bowers 2024-11-04 12:58:10 -05:00 committed by GitHub
parent e1cb8a66f0
commit 77de20c23a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;
pub struct SettingsJsonSchemaParams<'a> {
@ -20,7 +22,10 @@ impl<'a> SettingsJsonSchemaParams<'a> {
pub fn font_fallback_schema(&self) -> Schema {
SchemaObject {
instance_type: Some(InstanceType::Array.into()),
instance_type: Some(SingleOrVec::Vec(vec![
InstanceType::Array,
InstanceType::Null,
])),
array: Some(Box::new(ArrayValidation {
items: Some(schemars::schema::SingleOrVec::Single(Box::new(
self.font_family_schema(),