Skip to content

Commit

Permalink
remove old fns
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaBatty committed Jul 30, 2024
1 parent 98e7590 commit 48f9a6b
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions sway-lsp/src/core/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,27 +362,3 @@ mod tests {
assert_eq!(document.position_to_index(Position::new(1, 2)), 8);
}
}

/// Marks the specified file as "dirty" by creating a corresponding flag file.
///
/// This function ensures the necessary directory structure exists before creating the flag file.
pub fn mark_file_as_dirty(uri: &Url) -> Result<(), LanguageServerError> {
let path = document::get_path_from_url(uri)?;
Ok(PidFileLocking::lsp(path)
.lock()
.map_err(|e| DirectoryError::LspLocksDirFailed(e.to_string()))?)
}

/// Removes the corresponding flag file for the specified Url.
///
/// If the flag file does not exist, this function will do nothing.
pub fn remove_dirty_flag(uri: &Url) -> Result<(), LanguageServerError> {
let path = document::get_path_from_url(uri)?;
let uri = uri.clone();
Ok(PidFileLocking::lsp(path)
.release()
.map_err(|err| DocumentError::UnableToRemoveFile {
path: uri.path().to_string(),
err: err.to_string(),
})?)
}

0 comments on commit 48f9a6b

Please sign in to comment.