|
|
@ -69,6 +69,21 @@ where
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fn deserialize_tab_width_option<'de, D>(deserializer: D) -> Result<Option<usize>, D::Error>
|
|
|
|
|
|
|
|
where
|
|
|
|
|
|
|
|
D: serde::Deserializer<'de>,
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
usize::deserialize(deserializer).and_then(|n| {
|
|
|
|
|
|
|
|
if n > 0 && n <= 16 {
|
|
|
|
|
|
|
|
Ok(Some(n))
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
Err(serde::de::Error::custom(
|
|
|
|
|
|
|
|
"tab width must be a value from 1 to 16 inclusive",
|
|
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pub fn deserialize_auto_pairs<'de, D>(deserializer: D) -> Result<Option<AutoPairs>, D::Error>
|
|
|
|
pub fn deserialize_auto_pairs<'de, D>(deserializer: D) -> Result<Option<AutoPairs>, D::Error>
|
|
|
|
where
|
|
|
|
where
|
|
|
|
D: serde::Deserializer<'de>,
|
|
|
|
D: serde::Deserializer<'de>,
|
|
|
@ -537,18 +552,20 @@ pub struct DebuggerQuirks {
|
|
|
|
pub absolute_paths: bool,
|
|
|
|
pub absolute_paths: bool,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)]
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
|
|
|
#[serde(rename_all = "kebab-case")]
|
|
|
|
#[serde(rename_all = "kebab-case")]
|
|
|
|
pub struct IndentationConfiguration {
|
|
|
|
pub struct IndentationConfiguration {
|
|
|
|
#[serde(deserialize_with = "deserialize_tab_width")]
|
|
|
|
#[serde(deserialize_with = "deserialize_tab_width_option")]
|
|
|
|
pub tab_width: usize,
|
|
|
|
pub tab_width: Option<usize>,
|
|
|
|
pub unit: String,
|
|
|
|
pub unit: Option<String>,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
|
|
|
|
|
|
#[serde(rename_all = "kebab-case")]
|
|
|
|
pub struct LanguageIndentationConfiguration {
|
|
|
|
pub struct LanguageIndentationConfiguration {
|
|
|
|
#[serde(flatten)]
|
|
|
|
#[serde(deserialize_with = "deserialize_tab_width")]
|
|
|
|
pub indent: IndentationConfiguration,
|
|
|
|
pub tab_width: usize,
|
|
|
|
|
|
|
|
pub unit: String,
|
|
|
|
#[serde(default)]
|
|
|
|
#[serde(default)]
|
|
|
|
pub required: bool,
|
|
|
|
pub required: bool,
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -612,6 +629,15 @@ impl FromStr for AutoPairConfig {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
impl Default for IndentationConfiguration {
|
|
|
|
|
|
|
|
fn default() -> Self {
|
|
|
|
|
|
|
|
IndentationConfiguration {
|
|
|
|
|
|
|
|
tab_width: None,
|
|
|
|
|
|
|
|
unit: None,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#[derive(Debug)]
|
|
|
|
#[derive(Debug)]
|
|
|
|
pub struct TextObjectQuery {
|
|
|
|
pub struct TextObjectQuery {
|
|
|
|
pub query: Query,
|
|
|
|
pub query: Query,
|
|
|
|