diff --git a/lib/src/error/runtime.rs b/lib/src/error/runtime.rs index 8d08d72..04c4dbb 100644 --- a/lib/src/error/runtime.rs +++ b/lib/src/error/runtime.rs @@ -125,7 +125,9 @@ pub enum RuntimeError { #[diagnostic(code(watchexec::runtime::clearscreen))] Clearscreen(#[from] clearscreen::Error), - /// Error received when parsing a glob (possibly from an [`IgnoreFile`](crate::ignore::files::IgnoreFile)) fails. + /// Error received when parsing a glob (possibly from an [`IgnoreFile`]) fails. + /// + /// [`IgnoreFile`]: crate::ignore::IgnoreFile #[error("cannot parse glob from ignore '{file:?}': {err}")] #[diagnostic(code(watchexec::runtime::ignore_glob))] GlobsetGlob { @@ -138,7 +140,9 @@ pub enum RuntimeError { // TODO: extract glob error into diagnostic }, - /// Error received when an [`IgnoreFile`](crate::ignore::files::IgnoreFile) cannot be read. + /// Error received when an [`IgnoreFile`] cannot be read. + /// + /// [`IgnoreFile`]: crate::ignore::IgnoreFile #[error("cannot read ignore '{file}': {err}")] #[diagnostic(code(watchexec::runtime::ignore_file_read))] IgnoreFileRead { @@ -153,7 +157,7 @@ pub enum RuntimeError { /// Error emitted by a [`Filterer`](crate::filter::Filterer). /// /// With built-in filterers this will probably be a dynbox of - /// [`TaggedFiltererError`](crate::filter::tagged::error::TaggedFiltererError), but it is + /// [`TaggedFiltererError`](crate::error::TaggedFiltererError), but it is /// possible to use a custom filterer which emits a different error type. #[error("{kind} filterer: {err}")] #[diagnostic(code(watchexec::runtime::filterer))] diff --git a/lib/src/ignore/filter.rs b/lib/src/ignore/filter.rs index 55b3684..efe7af4 100644 --- a/lib/src/ignore/filter.rs +++ b/lib/src/ignore/filter.rs @@ -20,7 +20,7 @@ use super::files::IgnoreFile; /// /// This reads and compiles ignore files, and should be used for handling ignore files. It's created /// with a project origin and a list of ignore files, and new ignore files can be added later -/// (unless [`finish`](Filter::finish()) is called). +/// (unless [`finish`](IgnoreFilterer::finish()) is called). /// /// It implements [`Filterer`] so it can be used directly in another filterer; it is not designed to /// be used as a standalone filterer. diff --git a/lib/src/lib.rs b/lib/src/lib.rs index db3e079..a36e6a3 100644 --- a/lib/src/lib.rs +++ b/lib/src/lib.rs @@ -63,6 +63,7 @@ //! } //! }); //! +//! we.reconfigure(runtime); //! we.main().await.into_diagnostic()?; //! Ok(()) //! } diff --git a/lib/src/watchexec.rs b/lib/src/watchexec.rs index 4a726b3..da6ca31 100644 --- a/lib/src/watchexec.rs +++ b/lib/src/watchexec.rs @@ -54,6 +54,17 @@ impl Watchexec { /// /// Returns an [`Arc`] for convenience; use [`try_unwrap`][Arc::try_unwrap()] to get the value /// directly if needed. + /// + /// Note that `RuntimeConfig` is not a "live" or "shared" instance: if using reconfiguration, + /// you'll usually pass a `clone()` of your `RuntimeConfig` instance to this function; changes + /// made to the instance you _keep_ will not automatically be used by Watchexec, you need to + /// call [`reconfigure()`](Watchexec::reconfigure) with your updated config to apply the changes. + /// + /// Watchexec will subscribe to most signals sent to the process it runs in and send them, as + /// [`Event`]s, to the action handler. At minimum, you should check for interrupt/ctrl-c events + /// and return an [`Outcome::Exit`], otherwise hitting ctrl-c will do nothing. + /// + /// [`Outcome::Exit`]: crate::action::Outcome::Exit pub fn new( mut init: InitConfig, mut runtime: RuntimeConfig,