diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index afda65a09..debac2c63 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -10,6 +10,7 @@ This document provides a high-level view of the changes introduced by release. === 0.38.11 - Upgrade AsciidoctorJ to 2.2.4 and PlantUML to 1.2022.14 +- Ignore Antora playbooks that are inside of a module, as they are probably examples (#1293) === 0.38.10 diff --git a/src/main/java/org/asciidoc/intellij/psi/search/AsciiDocAntoraPlaybookIndex.java b/src/main/java/org/asciidoc/intellij/psi/search/AsciiDocAntoraPlaybookIndex.java index 3dd63cd2e..24882f08d 100644 --- a/src/main/java/org/asciidoc/intellij/psi/search/AsciiDocAntoraPlaybookIndex.java +++ b/src/main/java/org/asciidoc/intellij/psi/search/AsciiDocAntoraPlaybookIndex.java @@ -6,6 +6,7 @@ import com.intellij.util.indexing.FileBasedIndex; import com.intellij.util.indexing.ID; import org.asciidoc.intellij.psi.AsciiDocSearchScope; +import org.asciidoc.intellij.psi.AsciiDocUtil; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; @@ -33,7 +34,10 @@ public class AsciiDocAntoraPlaybookIndex { public static Collection getVirtualFiles(@NotNull Project project) { Set files = CollectionFactory.createSmallMemoryFootprintSet(); FileBasedIndex.getInstance().processValues(NAME, PLAYBOOK_KEY, null, (file, value) -> { - files.add(file); + if (AsciiDocUtil.findAntoraModuleDir(project, file) == null) { + // if a playbook is located in an example folder, ignore it + files.add(file); + } return true; }, new AsciiDocSearchScope(project), null); return files;