Skip to content

Commit

Permalink
fetch derived categories in chained store
Browse files Browse the repository at this point in the history
  • Loading branch information
ericvergnaud committed May 20, 2022
1 parent 5c2027b commit 628872e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CodeStore/src/main/java/prompto/code/MutableCodeStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,12 @@ private IQueryBuilder filterOnModules(IQueryBuilder builder, boolean filterOnMod

@Override
public Collection<CategoryDeclaration> fetchDerivedCategoryDeclarations(Identifier id) {
Stream<CategoryDeclaration> stream1 = super.fetchDerivedCategoryDeclarations(id).stream();
Stream<CategoryDeclaration> stream2 = doFetchDerivedCategoryDeclarations(id).stream();
return Stream.concat(stream1, stream2).collect(Collectors.toList());
}

Collection<CategoryDeclaration> doFetchDerivedCategoryDeclarations(Identifier id) {
IQueryBuilder builder = store.newQueryBuilder()
.verify(AttributeInfo.CATEGORY, MatchOp.HAS, "CategoryDeclaration")
.verify(AttributeInfo.DERIVED_FROM, MatchOp.HAS, id.toString())
Expand Down
4 changes: 3 additions & 1 deletion Core/src/main/java/prompto/type/IEnumeratedType.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package prompto.type;

public interface IEnumeratedType {
import prompto.grammar.Identifier;

public interface IEnumeratedType {
Identifier getTypeNameId();
}

0 comments on commit 628872e

Please sign in to comment.