Don't load document twice if they are imported twice

Also protect against cyclic imports
This commit is contained in:
Olivier Goffart 2020-10-30 10:14:27 +01:00
parent a4b476bdf3
commit 2d55b2a51a
5 changed files with 123 additions and 38 deletions

View file

@ -95,7 +95,7 @@ pub fn compile_syntax_node(
Cow::from("ugly")
});
let mut all_docs = vec![];
let mut all_docs = typeloader::LoadedDocuments::default();
if doc_node.source_file.is_some() {
typeloader::load_dependencies_recursively(
&doc_node,