-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ast: Fix virtual predicate used for rule index build
This commit fixes a bug in the predicate that checks if a ref refers to a virtual doc during the rule index build. Empty packages or packages containing only undefined rules generate an empty object. The bug was causing refs to empty packages to not be considered _virtual_ and therefore they could be indexed. In the issue, the case that passes did so because the ref was non-ground so the indexer excluded it. The case the failed was ground and the ref referred to an empty package so the indexer included it. This could be seen by enabling tracing (the index event showed zero matching rules so the expression failed.) The fix updates the virtual predicate to just walk down the rule tree instead of accumulating rules. If at any point there are no rules AND there are no children, the ref is not virtual. Otherwise, the ref is virtual. Fixes #1863 Signed-off-by: Torin Sandall <[email protected]>
- Loading branch information
Showing
3 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters