Session persistence state for the Editor.
Groups the Editor's session-related fields into a focused sub-struct: the periodic save timer and the directory paths for session files and swap files. These are set once at startup and only the timer mutates during the Editor's lifetime.
All mutations go through functions on this module.
Summary
Functions
Records a timer reference created by the session workflow.
Returns a pure instruction for canceling the save timer.
Clears a completed or canceled quit request.
Latches completion of the one-time editor startup workflow.
Returns true if session persistence is enabled (session_dir is set).
Creates a new session state from startup options.
Remembers the command and project root used by the last test run.
Requests quit confirmation for the editor or all editor instances.
Returns a pure instruction for restarting the save timer.
Returns keyword options for Minga.Session functions.
Returns a pure instruction for starting the periodic save timer.
Returns true if swap file recovery is enabled (swap_dir is set).
Returns keyword options for swap recovery functions.
Returns the interval used by the session workflow's periodic save timer.
Types
@type pending_quit() :: :quit | :quit_all | nil
@type t() :: %MingaEditor.State.Session{ last_test_command: last_test_command(), pending_quit: pending_quit(), session_dir: String.t() | nil, session_started?: boolean(), swap_dir: String.t() | nil, timer: reference() | nil }
Functions
Records a timer reference created by the session workflow.
Returns a pure instruction for canceling the save timer.
Clears a completed or canceled quit request.
Latches completion of the one-time editor startup workflow.
Returns true if session persistence is enabled (session_dir is set).
Creates a new session state from startup options.
@spec remember_test_command(t(), last_test_command()) :: t()
Remembers the command and project root used by the last test run.
Requests quit confirmation for the editor or all editor instances.
Returns a pure instruction for restarting the save timer.
Returns keyword options for Minga.Session functions.
Returns a pure instruction for starting the periodic save timer.
Returns true if swap file recovery is enabled (swap_dir is set).
Returns keyword options for swap recovery functions.
@spec timer_interval() :: pos_integer()
Returns the interval used by the session workflow's periodic save timer.