pub struct VariableContext {Show 16 fields
pub selected_text: Option<String>,
pub current_line: Option<String>,
pub current_word: Option<String>,
pub line_index: Option<u32>,
pub filename: Option<String>,
pub directory: Option<String>,
pub filepath: Option<String>,
pub workspace_name: Option<String>,
pub workspace_folder: Option<String>,
pub clipboard: Option<String>,
pub line_comment: Option<String>,
pub block_comment_start: Option<String>,
pub block_comment_end: Option<String>,
pub extra: HashMap<String, String>,
pub fixed_now: Option<TimestampParts>,
pub fixed_random: Option<u64>,
}Expand description
Editor-supplied context the renderer consults to resolve
variable references. The host fills in the file / cursor
fields; timestamp + random / UUID values are computed at
expansion time inside VariableContext::resolve.
extra is the plugin / user-defined variable slot –
values the host wants to expose without subclassing.
Names lookup falls through to extra when the built-in
set doesn’t recognise the name.
Fields§
§selected_text: Option<String>§current_line: Option<String>§current_word: Option<String>§line_index: Option<u32>0-based.
filename: Option<String>§directory: Option<String>§filepath: Option<String>§workspace_name: Option<String>§workspace_folder: Option<String>§clipboard: Option<String>§line_comment: Option<String>§block_comment_start: Option<String>§block_comment_end: Option<String>§extra: HashMap<String, String>User / plugin extras. Looked up after the built-in set.
fixed_now: Option<TimestampParts>Optional fixed timestamp (for tests). When None, the
renderer reads SystemTime::now().
fixed_random: Option<u64>Optional fixed random seed (for tests).
Implementations§
Trait Implementations§
Source§impl Clone for VariableContext
impl Clone for VariableContext
Source§fn clone(&self) -> VariableContext
fn clone(&self) -> VariableContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 VariableContext
impl Debug for VariableContext
Source§impl Default for VariableContext
impl Default for VariableContext
Source§fn default() -> VariableContext
fn default() -> VariableContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for VariableContext
impl RefUnwindSafe for VariableContext
impl Send for VariableContext
impl Sync for VariableContext
impl Unpin for VariableContext
impl UnsafeUnpin for VariableContext
impl UnwindSafe for VariableContext
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