Skip to content
Permalink
Browse files

Don't suggest ##* for masks.

  • Loading branch information...
wizjany committed Jul 28, 2019
1 parent 50cea37 commit c93e5ccfdfd100c20836c66ce7f280beaf5d0e6f
@@ -49,11 +49,12 @@ private SuggestionHelper() {

public static Stream<String> getBlockCategorySuggestions(String tag, boolean allowRandom) {
if (tag.isEmpty() || tag.equals("#")) {
return Stream.of("##", "##*");
return allowRandom ? Stream.of("##", "##*") : Stream.of("##");
}
if (tag.startsWith("##")) {
if (tag.equals("##")) {
return Stream.concat(Stream.of("##*"), getNamespacedRegistrySuggestions(BlockCategory.REGISTRY, tag.substring(2)).map(s -> "##" + s));
return Stream.concat(allowRandom ? Stream.of("##*") : Stream.empty(),
getNamespacedRegistrySuggestions(BlockCategory.REGISTRY, tag.substring(2)).map(s -> "##" + s));
} else if (tag.equals("##*") && allowRandom) {
return getNamespacedRegistrySuggestions(BlockCategory.REGISTRY, tag.substring(3)).map(s -> "##*" + s);
} else {

0 comments on commit c93e5cc

Please sign in to comment.
You can’t perform that action at this time.