pub struct SimpleConfigWatcher { /* private fields */ }Expand description
Simple config watcher that polls file mtimes instead of using filesystem events.
Implementations§
Source§impl SimpleConfigWatcher
impl SimpleConfigWatcher
pub fn new(workspace_path: PathBuf) -> Self
Sourcepub fn new_with_user_config_paths(workspace_path: PathBuf) -> Self
pub fn new_with_user_config_paths(workspace_path: PathBuf) -> Self
Create a polling watcher that tracks all workspace and user-level configuration locations supported by the current defaults provider.
Loading the manager here is best-effort. If a config file is malformed, the watcher still tracks the provider’s default paths so a subsequent correction or newly-created user config can be observed.
Sourcepub fn add_watch_path(&mut self, path: PathBuf)
pub fn add_watch_path(&mut self, path: PathBuf)
Watch an additional config file (for example the user-level vtcode.toml)
in addition to the workspace-local files.
pub fn should_reload(&mut self) -> bool
pub fn load_config(&mut self) -> Option<VTCodeConfig>
Sourcepub fn take_reload_error(&mut self) -> Option<String>
pub fn take_reload_error(&mut self) -> Option<String>
Take the most recent reload error, if a malformed or inaccessible layer was observed. Callers can surface this warning without replacing the last valid runtime configuration.
Sourcepub fn set_last_known_config(&mut self, config: VTCodeConfig)
pub fn set_last_known_config(&mut self, config: VTCodeConfig)
Seed the fail-closed reload value with the configuration already used to start a session. This keeps command-line/runtime overrides active if a watched file becomes malformed or temporarily unavailable.