Skip to content

Commit

Permalink
Ignore Antora playbooks that are inside of a module, as they are prob…
Browse files Browse the repository at this point in the history
…ably examples (#1293)
  • Loading branch information
ahus1 committed Feb 10, 2023
1 parent 7fa8867 commit 6bd8b12
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -33,7 +34,10 @@ public class AsciiDocAntoraPlaybookIndex {
public static Collection<VirtualFile> getVirtualFiles(@NotNull Project project) {
Set<VirtualFile> 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;
Expand Down

0 comments on commit 6bd8b12

Please sign in to comment.