mirror of
https://github.com/latex-lsp/texlab.git
synced 2025-12-23 09:19:21 +00:00
Do not treat links to packages as bidirectional
This commits fixes issues related to the project discovery where two separate projects reference the same local package or document class. See #679.
This commit is contained in:
parent
47d3d98239
commit
18db6f5eff
1 changed files with 10 additions and 2 deletions
|
|
@ -8,7 +8,7 @@ use anyhow::Result;
|
|||
use crossbeam_channel::Sender;
|
||||
use lsp_types::Url;
|
||||
use notify::Watcher;
|
||||
use petgraph::{graphmap::UnGraphMap, visit::Dfs};
|
||||
use petgraph::{graphmap::DiGraphMap, visit::Dfs};
|
||||
use rustc_hash::{FxHashMap, FxHashSet};
|
||||
|
||||
use crate::{
|
||||
|
|
@ -145,6 +145,14 @@ impl Workspace {
|
|||
for target in targets {
|
||||
if let Some(j) = all_uris.iter().position(|uri| uri == target) {
|
||||
edges.push((i, j, ()));
|
||||
|
||||
if target.as_str().ends_with(".tex")
|
||||
|| target.as_str().ends_with(".bib")
|
||||
|| target.as_str().ends_with(".rnw")
|
||||
{
|
||||
edges.push((j, i, ()));
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -154,7 +162,7 @@ impl Workspace {
|
|||
|
||||
let mut slice = self.clone();
|
||||
slice.documents_by_uri = FxHashMap::default();
|
||||
let graph = UnGraphMap::from_edges(edges);
|
||||
let graph = DiGraphMap::from_edges(edges);
|
||||
let mut dfs = Dfs::new(&graph, start);
|
||||
while let Some(i) = dfs.next(&graph) {
|
||||
let uri = &all_uris[i];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue