mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-07-23 04:35:00 +00:00
refactor: clean code & fix suffix computation & combine export actors (#263)
* dev: use bail! macro * dev: remove redundant arg structures as we have inlay hints * dev: unify actor namings * dev: unify actor namings (cont) * fix: suffix computation * dev: add EditorActor::new * dev: unify index file flavors * dev: combine export actors * dev: small tweaks * dev: mimic try blocks * dev: accumulate export requests * dev: remove unnecessary Option * dev: unify serde renames * dev: remove unnecessary Option * dev: small tweaks
This commit is contained in:
parent
d05c5012ff
commit
94a0a1b23a
21 changed files with 663 additions and 1036 deletions
|
@ -132,17 +132,15 @@ mod polymorphic {
|
|||
use super::*;
|
||||
|
||||
#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum PageSelection {
|
||||
#[serde(rename = "first")]
|
||||
First,
|
||||
#[serde(rename = "merged")]
|
||||
Merged,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum ExportKind {
|
||||
Pdf,
|
||||
WordCount,
|
||||
Svg { page: PageSelection },
|
||||
Png { page: PageSelection },
|
||||
}
|
||||
|
@ -151,7 +149,6 @@ mod polymorphic {
|
|||
pub fn extension(&self) -> &str {
|
||||
match self {
|
||||
Self::Pdf => "pdf",
|
||||
Self::WordCount => "txt",
|
||||
Self::Svg { .. } => "svg",
|
||||
Self::Png { .. } => "png",
|
||||
}
|
||||
|
@ -179,12 +176,11 @@ mod polymorphic {
|
|||
pub struct ServerInfoRequest {}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ServerInfoResponse {
|
||||
pub root: Option<PathBuf>,
|
||||
#[serde(rename = "fontPaths")]
|
||||
pub font_paths: Vec<PathBuf>,
|
||||
pub inputs: Dict,
|
||||
#[serde(rename = "estimatedMemoryUsage")]
|
||||
pub estimated_memory_usage: HashMap<String, usize>,
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue