From b120cbd73b498c3aca0e3ff59b6467e4fdff1732 Mon Sep 17 00:00:00 2001 From: Bandsberg Date: Mon, 27 Dec 2021 13:12:11 +0100 Subject: [PATCH 1/5] Auto generated codelldb settings --- .vscode/launch.json | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..c66f977bd --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,45 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "lldb", + "request": "launch", + "name": "Debug executable 'fj-host'", + "cargo": { + "args": [ + "build", + "--bin=fj-host", + "--package=fj-host" + ], + "filter": { + "name": "fj-host", + "kind": "bin" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug unit tests in executable 'fj-host'", + "cargo": { + "args": [ + "test", + "--no-run", + "--bin=fj-host", + "--package=fj-host" + ], + "filter": { + "name": "fj-host", + "kind": "bin" + } + }, + "args": [], + "cwd": "${workspaceFolder}" + } + ] +} \ No newline at end of file From 09b30b5e672c231e450c58e7d966d88abeb59891 Mon Sep 17 00:00:00 2001 From: Bandsberg Date: Mon, 27 Dec 2021 16:42:53 +0100 Subject: [PATCH 2/5] Rename debug settings --- .vscode/launch.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index c66f977bd..73d64e0ef 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -7,7 +7,7 @@ { "type": "lldb", "request": "launch", - "name": "Debug executable 'fj-host'", + "name": "Debug executable 'fj'", "cargo": { "args": [ "build", @@ -25,7 +25,7 @@ { "type": "lldb", "request": "launch", - "name": "Debug unit tests in executable 'fj-host'", + "name": "Debug unit tests in executable 'fj'", "cargo": { "args": [ "test", From 6bdbef5430698e086fa1ad94d1fb6458b317c31d Mon Sep 17 00:00:00 2001 From: Bandsberg Date: Mon, 27 Dec 2021 16:43:05 +0100 Subject: [PATCH 3/5] Recompile model on save --- src/main.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index 5b0a3f204..1758d1469 100644 --- a/src/main.rs +++ b/src/main.rs @@ -65,11 +65,8 @@ fn main() -> anyhow::Result<()> { // handle it. let event = event.expect("Error handling watch event"); - if let notify::EventKind::Access( - notify::event::AccessKind::Close( - notify::event::AccessMode::Write, - ), - ) = event.kind + if let notify::EventKind::Modify(notify::event::ModifyKind::Any) = + event.kind { let shape = match model.load(¶meters) { Ok(shape) => shape, From bae977880682d7c7111f11bc509444c014dec642 Mon Sep 17 00:00:00 2001 From: Bandsberg Date: Mon, 27 Dec 2021 17:32:16 +0100 Subject: [PATCH 4/5] Handle all acceptable ModifyKind kinds --- src/main.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 1758d1469..2fb2a09e6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -65,8 +65,13 @@ fn main() -> anyhow::Result<()> { // handle it. let event = event.expect("Error handling watch event"); - if let notify::EventKind::Modify(notify::event::ModifyKind::Any) = - event.kind + if let notify::EventKind::Modify(notify::event::ModifyKind::Any) + | notify::EventKind::Modify(notify::event::ModifyKind::Data( + notify::event::DataChange::Any, + )) + | notify::EventKind::Modify(notify::event::ModifyKind::Data( + notify::event::DataChange::Content, + )) = event.kind { let shape = match model.load(¶meters) { Ok(shape) => shape, From 266ea982c1520dfa5239e9cee77ba0c78f9425fa Mon Sep 17 00:00:00 2001 From: Bandsberg Date: Mon, 27 Dec 2021 17:34:39 +0100 Subject: [PATCH 5/5] Added comment --- src/main.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.rs b/src/main.rs index 2fb2a09e6..8829ac73f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -65,6 +65,7 @@ fn main() -> anyhow::Result<()> { // handle it. let event = event.expect("Error handling watch event"); + //Various acceptable ModifyKind kinds. Varies across platforms (e.g. MacOs vs. Windows10) if let notify::EventKind::Modify(notify::event::ModifyKind::Any) | notify::EventKind::Modify(notify::event::ModifyKind::Data( notify::event::DataChange::Any,