pub struct WorkspaceContext {
pub root_path: PathBuf,
pub project_type: Option<ProjectType>,
pub active_files: Vec<ActiveFile>,
pub recent_changes: Vec<FileChange>,
pub git_info: Option<GitInfo>,
}Expand description
The full workspace context — complete situational awareness for the fighter.
Fields§
§root_path: PathBufRoot path of the workspace/project.
project_type: Option<ProjectType>Detected project type.
active_files: Vec<ActiveFile>Currently active/open files.
recent_changes: Vec<FileChange>Recent file changes.
git_info: Option<GitInfo>Git repository information.
Implementations§
Source§impl WorkspaceContext
impl WorkspaceContext
Sourcepub fn new(root_path: PathBuf) -> Self
pub fn new(root_path: PathBuf) -> Self
Create a new workspace context for the given root path — enter the arena.
Sourcepub fn detect_project_type(root: &Path) -> Option<ProjectType>
pub fn detect_project_type(root: &Path) -> Option<ProjectType>
Detect the project type from marker files in the root directory — identify the fighting style.
Sourcepub fn add_active_file(&mut self, file: ActiveFile)
pub fn add_active_file(&mut self, file: ActiveFile)
Add an active file to the context — equip a new weapon.
Sourcepub fn record_change(&mut self, change: FileChange)
pub fn record_change(&mut self, change: FileChange)
Record a file change — log a combat move.
Sourcepub fn recent_files(&self, limit: usize) -> Vec<&ActiveFile>
pub fn recent_files(&self, limit: usize) -> Vec<&ActiveFile>
Get the most recently active files — review the fighter’s current loadout.
Trait Implementations§
Source§impl Clone for WorkspaceContext
impl Clone for WorkspaceContext
Source§fn clone(&self) -> WorkspaceContext
fn clone(&self) -> WorkspaceContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WorkspaceContext
impl Debug for WorkspaceContext
Source§impl<'de> Deserialize<'de> for WorkspaceContext
impl<'de> Deserialize<'de> for WorkspaceContext
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for WorkspaceContext
impl RefUnwindSafe for WorkspaceContext
impl Send for WorkspaceContext
impl Sync for WorkspaceContext
impl Unpin for WorkspaceContext
impl UnsafeUnpin for WorkspaceContext
impl UnwindSafe for WorkspaceContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more