diff options
Diffstat (limited to 'support/texlab/crates/commands/src/fwd_search.rs')
-rw-r--r-- | support/texlab/crates/commands/src/fwd_search.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/support/texlab/crates/commands/src/fwd_search.rs b/support/texlab/crates/commands/src/fwd_search.rs index f1991cd48e..8b6227d8c2 100644 --- a/support/texlab/crates/commands/src/fwd_search.rs +++ b/support/texlab/crates/commands/src/fwd_search.rs @@ -84,7 +84,11 @@ impl ForwardSearch { } fn find_pdf(workspace: &Workspace, document: &Document) -> Result<PathBuf, ForwardSearchError> { - let root = ProjectRoot::walk_and_find(workspace, &document.dir); + let Some(document_dir) = &document.dir else { + return Err(ForwardSearchError::NotLocal(document.uri.clone())); + }; + + let root = ProjectRoot::walk_and_find(workspace, document_dir); log::debug!("[FwdSearch] root={root:#?}"); @@ -103,7 +107,7 @@ impl ForwardSearch { }) .ok_or_else(|| ForwardSearchError::InvalidPath(document.uri.clone()))?; - let pdf_path = pdf_dir.join(&pdf_name); + let pdf_path = pdf_dir.join(pdf_name); let pdf_exists = pdf_path.exists(); log::debug!("[FwdSearch] pdf_path={pdf_path:?}, pdf_exists={pdf_exists}"); |