Module MarkerState

Module MarkerState 

Source
Expand description

§MarkerState Module (ApplicationState)

§RESPONSIBILITIES

Manages marker-related state including custom documents, status bar items, and source control management (SCM) state.

§ARCHITECTURAL ROLE

MarkerState is part of the FeatureState module, representing marker-related state including:

  • Custom documents
  • Status bar items
  • SCM providers, groups, and resources
  • SCM provider handle counter

§KEY COMPONENTS

  • MarkerState: Main struct containing marker-related state and counter
  • Default: Initialization implementation
  • Helper methods: Marker manipulation utilities

§ERROR HANDLING

  • Thread-safe access via Arc<Mutex<...>>
  • Proper lock error handling with MapLockError helpers

§LOGGING

State changes are logged at appropriate levels (debug, info, warn, error).

§PERFORMANCE CONSIDERATIONS

  • Lock mutexes briefly and release immediately
  • Avoid nested locks to prevent deadlocks
  • Use Arc for shared ownership across threads
  • Use AtomicU32 for unique SCM provider handles

§TODO

  • Add marker validation invariants
  • Implement marker lifecycle events
  • Add marker metrics collection

Structs§

MarkerState
Marker-related state containing custom documents, status bar, and SCM state.