Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,13 @@ public List<Section> findSectionsByTag(String tag) {
}

private QuteTextDocument findDocumentByTemplateId(String templateId) {
// 1. Try to get the template from the Qute project
if (templateId.indexOf('.') != -1) {
// ex: base.html
return documents.get(templateId);
QuteTextDocument document = documents.get(templateId);
if (document != null) {
return document;
}
}
// ex : base
for (String variant : getTemplateVariants()) {
Expand All @@ -274,6 +278,19 @@ private QuteTextDocument findDocumentByTemplateId(String templateId) {
return document;
}
}
if (!getProjectDependencies().isEmpty()) {
// 2. The Qute project have some project dependencies, try to get a valid from
// those dependencies
for (QuteProject projectDependency : getProjectDependencies()) {
if (projectDependency != null) {
QuteTextDocument documentFromDependency = projectDependency.findDocumentByTemplateId(templateId);
if (documentFromDependency != null) {
return documentFromDependency;
}
}
}
}

return null;
}

Expand Down
Loading