Store modified time of `FileContents` as `jiff::Timestamp`
Dependencies
- [2]
WFWTKCJNCreate initial Visual Studio Code extension - [3]
72K45XKDRefactor inline credit to improve hover messages
Change contents
- replacement in pijul-extension/src/file_system/working_copy.rs at line 42
Some(open_file) => Ok(open_file.contents.modified_time),Some(open_file) => Ok(open_file.contents.modified_time.into()), - edit in pijul-extension/src/file_system/open_file/contents.rs at line 1
use std::time::SystemTime; - edit in pijul-extension/src/file_system/open_file/contents.rs at line 2
use jiff::Timestamp; - replacement in pijul-extension/src/file_system/open_file/contents.rs at line 21
pub modified_time: SystemTime,pub modified_time: Timestamp, - replacement in pijul-extension/src/file_system/open_file/contents.rs at line 32
let last_modified_time = working_copy.modified_time(path.as_str()).unwrap_or(SystemTime::now());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
fn modified_time(&self, file: &str) -> Result<SystemTime, Self::Error> {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
Ok(self.modified_time)Ok(self.modified_time.into()) - edit in pijul-extension/Cargo.toml at line 9
jiff.workspace = true - edit in extensions/vscode/src/vscode_sys/mod.rs at line 231
"isDirty": get_is_dirty -> bool; - edit in extensions/vscode/src/inline_credit/mod.rs at line 82
&editor_document, - edit in extensions/vscode/src/inline_credit/line_annotation.rs at line 56
text_document: &vscode_sys::TextDocument, - edit in extensions/vscode/src/inline_credit/line_annotation.rs at line 86
}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
"jiff",