Store modified time of `FileContents` as `jiff::Timestamp`

finchie
Dec 9, 2025, 3:25 AM
M2NAH3DCKREU74FXJSQDDRA35LP55VVCD6Z2UH5UCAL7TOTFNNQQC

Dependencies

  • [2] WFWTKCJN Create initial Visual Studio Code extension
  • [3] 72K45XKD Refactor inline credit to improve hover messages

Change contents

  • replacement in pijul-extension/src/file_system/working_copy.rs at line 42
    [2.20255][2.20255:20324]()
    Some(open_file) => Ok(open_file.contents.modified_time),
    [2.20255]
    [2.20324]
    Some(open_file) => Ok(open_file.contents.modified_time.into()),
  • edit in pijul-extension/src/file_system/open_file/contents.rs at line 1
    [2.23999][2.24000:24028]()
    use std::time::SystemTime;
  • edit in pijul-extension/src/file_system/open_file/contents.rs at line 2
    [2.24053]
    [2.24053]
    use jiff::Timestamp;
  • replacement in pijul-extension/src/file_system/open_file/contents.rs at line 21
    [2.24554][2.24554:24589]()
    pub modified_time: SystemTime,
    [2.24554]
    [2.24589]
    pub modified_time: Timestamp,
  • replacement in pijul-extension/src/file_system/open_file/contents.rs at line 32
    [2.24796][2.24796:24927]()
    let last_modified_time = working_copy
    .modified_time(path.as_str())
    .unwrap_or(SystemTime::now());
    [2.24796]
    [2.24927]
    let last_modified_time = match working_copy.modified_time(path.as_str()) {
    Ok(modified_time) => match Timestamp::try_from(modified_time) {
    Ok(converted_timestamp) => converted_timestamp,
    Err(error) => {
    tracing::error!(
    message = "jiff::Timestamp::TryFrom<std::time::SystemTime> failed",
    ?error
    );
    Timestamp::now()
    }
    },
    Err(error) => {
    tracing::error!(
    message = "Failed to get modified time from working copy",
    ?error
    );
    Timestamp::now()
    }
    };
  • replacement in pijul-extension/src/file_system/open_file/contents.rs at line 90
    [2.25960][2.25960:26037]()
    fn modified_time(&self, file: &str) -> Result<SystemTime, Self::Error> {
    [2.25960]
    [2.26037]
    fn modified_time(&self, file: &str) -> Result<std::time::SystemTime, Self::Error> {
  • replacement in pijul-extension/src/file_system/open_file/contents.rs at line 98
    [2.26267][2.26267:26298]()
    Ok(self.modified_time)
    [2.26267]
    [2.26298]
    Ok(self.modified_time.into())
  • edit in pijul-extension/Cargo.toml at line 9
    [2.53536]
    [2.53536]
    jiff.workspace = true
  • edit in extensions/vscode/src/vscode_sys/mod.rs at line 231
    [2.64585]
    [2.64585]
    "isDirty": get_is_dirty -> bool;
  • edit in extensions/vscode/src/inline_credit/mod.rs at line 82
    [3.3292]
    [3.3292]
    &editor_document,
  • edit in extensions/vscode/src/inline_credit/line_annotation.rs at line 56
    [2.125029]
    [2.125029]
    text_document: &vscode_sys::TextDocument,
  • edit in extensions/vscode/src/inline_credit/line_annotation.rs at line 86
    [2.126786]
    [2.129438]
    }
    CreditSource::Untracked => {
    let timestamp = if text_document.get_is_dirty()? {
    Timestamp::now()
    } else {
    open_file.contents.modified_time
    };
    LineAnnotation::Untracked { timestamp }
  • edit in extensions/vscode/src/inline_credit/line_annotation.rs at line 96
    [2.129448][3.6508:6745](),[3.6745][2.130273:130323](),[2.130273][2.130273:130323](),[2.130323][3.6746:6863](),[3.6863][2.130421:130440](),[2.130421][2.130421:130440](),[2.130440][3.6864:6892]()
    CreditSource::Untracked => LineAnnotation::Untracked {
    // TODO: return the current time if `TextDocument::get_is_dirty()`
    timestamp: Timestamp::try_from(open_file.contents.modified_time).map_err(|error| {
    napi::Error::from_reason(format!(
    "Failed to parse timestamp {:#?}: {error}",
    open_file.contents.modified_time
    ))
    })?,
    },
  • edit in Cargo.lock at line 2502
    [2.234968]
    [2.234968]
    "jiff",