···5151 template: Option<String>,
5252}
53535454-// AnnotatedValue will be cloned internally in the templater. If the cloning
5555-// cost matters, wrap it with Rc.
5656-fn config_template_language() -> GenericTemplateLanguage<'static, AnnotatedValue> {
5757- type L = GenericTemplateLanguage<'static, AnnotatedValue>;
5858- let mut language = L::new();
5959- // "name" instead of "path" to avoid confusion with the source file path
6060- language.add_keyword("name", |self_property| {
6161- let out_property = self_property.map(|annotated| annotated.path.to_string());
6262- Ok(L::wrap_string(out_property))
6363- });
6464- language.add_keyword("value", |self_property| {
6565- // TODO: would be nice if we can provide raw dynamically-typed value
6666- let out_property =
6767- self_property.and_then(|annotated| Ok(to_toml_value(&annotated.value)?.to_string()));
6868- Ok(L::wrap_string(out_property))
6969- });
7070- language.add_keyword("overridden", |self_property| {
7171- let out_property = self_property.map(|annotated| annotated.is_overridden);
7272- Ok(L::wrap_boolean(out_property))
7373- });
7474- language
7575-}
7676-7754#[instrument(skip_all)]
7855pub fn cmd_config_list(
7956 ui: &mut Ui,
···129106 }
130107 Ok(())
131108}
109109+110110+// AnnotatedValue will be cloned internally in the templater. If the cloning
111111+// cost matters, wrap it with Rc.
112112+fn config_template_language() -> GenericTemplateLanguage<'static, AnnotatedValue> {
113113+ type L = GenericTemplateLanguage<'static, AnnotatedValue>;
114114+ let mut language = L::new();
115115+ // "name" instead of "path" to avoid confusion with the source file path
116116+ language.add_keyword("name", |self_property| {
117117+ let out_property = self_property.map(|annotated| annotated.path.to_string());
118118+ Ok(L::wrap_string(out_property))
119119+ });
120120+ language.add_keyword("value", |self_property| {
121121+ // TODO: would be nice if we can provide raw dynamically-typed value
122122+ let out_property =
123123+ self_property.and_then(|annotated| Ok(to_toml_value(&annotated.value)?.to_string()));
124124+ Ok(L::wrap_string(out_property))
125125+ });
126126+ language.add_keyword("overridden", |self_property| {
127127+ let out_property = self_property.map(|annotated| annotated.is_overridden);
128128+ Ok(L::wrap_boolean(out_property))
129129+ });
130130+ language
131131+}