diff --git a/Cargo.toml b/Cargo.toml index 506f14543..a1d3acc7d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,8 +46,10 @@ flate2 = "1.0.22" tar = "0.4.38" tower = "0.4.12" -dioxus-rsx = { git = "https://github.com/dioxuslabs/dioxus.git" } -dioxus-autofmt = { git = "https://github.com/dioxuslabs/dioxus.git" } +dioxus-rsx = { path = "../../dioxus/packages/rsx" } +dioxus-autofmt = { path = "../../dioxus/packages/autofmt" } +# dioxus-rsx = { git = "https://github.com/dioxuslabs/dioxus.git" } +# dioxus-autofmt = { git = "https://github.com/dioxuslabs/dioxus.git" } [[bin]] path = "src/main.rs" diff --git a/extension/src/main.ts b/extension/src/main.ts index 156d45565..1c75d3780 100644 --- a/extension/src/main.ts +++ b/extension/src/main.ts @@ -14,7 +14,7 @@ export async function activate(context: vscode.ExtensionContext) { } context.subscriptions.push( - vscode.commands.registerTextEditorCommand('editor.action.clipboardPasteAction', onPasteHandler), + // vscode.commands.registerTextEditorCommand('editor.action.clipboardPasteAction', onPasteHandler), vscode.commands.registerCommand('extension.htmlToDioxusRsx', translateBlock), vscode.commands.registerCommand('extension.htmlToDioxusComponent', translateComponent), vscode.commands.registerCommand('extension.formatRsx', fmtSelection), diff --git a/src/cli/autoformat/mod.rs b/src/cli/autoformat/mod.rs index 5c1532d58..6716a3964 100644 --- a/src/cli/autoformat/mod.rs +++ b/src/cli/autoformat/mod.rs @@ -13,6 +13,7 @@ pub struct Autoformat { } impl Autoformat { + // Todo: autoformat the entire crate pub fn autoformat(self) -> Result<()> { if let Some(raw) = self.raw { if let Some(inner) = dioxus_autofmt::fmt_block(&raw, 0) { @@ -59,3 +60,17 @@ rsx! { dbg!(out); } + +/* +parse the whole doc +find all the comment blocks + + + + + + + + + +*/ diff --git a/src/server/mod.rs b/src/server/mod.rs index 1df13ca6a..76e31a82a 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -34,26 +34,29 @@ pub async fn startup(config: CrateConfig) -> Result<()> { // file watcher: check file change let watcher_conf = config.clone(); - let mut watcher = RecommendedWatcher::new(move |_: notify::Result| { - if chrono::Local::now().timestamp() > last_update_time { - log::info!("Start to rebuild project..."); - if builder::build(&watcher_conf).is_ok() { - // change the websocket reload state to true; - // the page will auto-reload. - if watcher_conf - .dioxus_config - .web - .watcher - .reload_html - .unwrap_or(false) - { - let _ = Serve::regen_dev_page(&watcher_conf); + let mut watcher = RecommendedWatcher::new( + move |_: notify::Result| { + if chrono::Local::now().timestamp() > last_update_time { + log::info!("Start to rebuild project..."); + if builder::build(&watcher_conf).is_ok() { + // change the websocket reload state to true; + // the page will auto-reload. + if watcher_conf + .dioxus_config + .web + .watcher + .reload_html + .unwrap_or(false) + { + let _ = Serve::regen_dev_page(&watcher_conf); + } + let _ = reload_tx.send("reload".into()); + last_update_time = chrono::Local::now().timestamp(); } - let _ = reload_tx.send("reload".into()); - last_update_time = chrono::Local::now().timestamp(); } - } - }) + }, + notify::Config::default(), + ) .unwrap(); let allow_watch_path = config .dioxus_config