| 565 | } |
| 566 | |
| 567 | pub fn with_lsp_touch_file<F, Fut>(mut self, callback: F) -> Self |
| 568 | where |
| 569 | F: Fn(String, bool) -> Fut + Send + Sync + 'static, |
| 570 | Fut: std::future::Future<Output = Result<(), ToolError>> + Send + 'static, |
| 571 | { |
| 572 | self.lsp_touch_file = Some(Arc::new(move |file_path, write| { |
| 573 | Box::pin(callback(file_path, write)) |
| 574 | })); |
| 575 | self |
| 576 | } |
| 577 | |
| 578 | pub async fn do_lsp_touch_file(&self, file_path: String, write: bool) -> Result<(), ToolError> { |
| 579 | if let Some(ref callback) = self.lsp_touch_file { |