Don't rely on relative path for docs preprocessor (#16883)
Reapplies #16700 with a corrected command. Now it no longer relies on a relative path. Thanks @maxdeviant for the quick help 🙏 Release Notes: - N/A
This commit is contained in:
parent
a87076e815
commit
7a964ff91a
16 changed files with 639 additions and 24 deletions
|
@ -22,10 +22,34 @@ pub struct KeymapBlock {
|
|||
bindings: BTreeMap<String, KeymapAction>,
|
||||
}
|
||||
|
||||
impl KeymapBlock {
|
||||
pub fn context(&self) -> Option<&str> {
|
||||
self.context.as_deref()
|
||||
}
|
||||
|
||||
pub fn bindings(&self) -> &BTreeMap<String, KeymapAction> {
|
||||
&self.bindings
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Default, Clone)]
|
||||
#[serde(transparent)]
|
||||
pub struct KeymapAction(Value);
|
||||
|
||||
impl ToString for KeymapAction {
|
||||
fn to_string(&self) -> String {
|
||||
match &self.0 {
|
||||
Value::String(s) => s.clone(),
|
||||
Value::Array(arr) => arr
|
||||
.iter()
|
||||
.map(|v| v.to_string())
|
||||
.collect::<Vec<_>>()
|
||||
.join(", "),
|
||||
_ => self.0.to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl JsonSchema for KeymapAction {
|
||||
fn schema_name() -> String {
|
||||
"KeymapAction".into()
|
||||
|
@ -135,6 +159,10 @@ impl KeymapFile {
|
|||
|
||||
serde_json::to_value(root_schema).unwrap()
|
||||
}
|
||||
|
||||
pub fn blocks(&self) -> &[KeymapBlock] {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
|
||||
fn no_action() -> Box<dyn gpui::Action> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue