File tree 1 file changed +17
-3
lines changed
1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -733,6 +733,10 @@ class TokenTypeBlock extends TokenType {
733
733
strings . push ( ...blockPart . toLowerCase ( ) . split ( " " ) ) ;
734
734
} else if ( blockPart . type === BlockInputType . ENUM ) {
735
735
for ( const enumValue of blockPart . values ) {
736
+
737
+ if ( this . stringForms . length >= WorkspaceQuerier . MAX_RESULTS )
738
+ return ;
739
+
736
740
enumerateStringForms (
737
741
partIdx + 1 ,
738
742
[ ...strings , ...enumValue . string . toLowerCase ( ) . split ( " " ) ] ,
@@ -749,11 +753,16 @@ class TokenTypeBlock extends TokenType {
749
753
} ;
750
754
751
755
enumerateStringForms ( ) ;
756
+
757
+ if ( this . stringForms . length >= WorkspaceQuerier . MAX_STRING_FORMS ) {
758
+ console . log ( "Warning: Block '" + this . block . id + "' has too many string forms. Search results may not be very good." ) ;
759
+ this . stringForms . length = 0 ;
760
+ }
752
761
}
753
762
754
763
/**
755
764
* @param {QueryInfo } query
756
- * @param {number } idx
765
+ * @param {number } idxi
757
766
* @param {number } depth
758
767
* @returns
759
768
*/
@@ -1159,12 +1168,17 @@ export default class WorkspaceQuerier {
1159
1168
/**
1160
1169
* The maximum number of results to find before we give up searching sub-blocks.
1161
1170
*/
1162
- static MAX_RESULTS = 1000 ;
1171
+ static MAX_RESULTS = 2000 ;
1163
1172
1164
1173
/**
1165
1174
* The maximum number of tokens to find before giving up.
1166
1175
*/
1167
- static MAX_TOKENS = 10000 ;
1176
+ static MAX_TOKENS = 100000 ;
1177
+
1178
+ /**
1179
+ * The maximum number of string forms a block can have before we give up.
1180
+ */
1181
+ static MAX_STRING_FORMS = 500 ;
1168
1182
1169
1183
/**
1170
1184
* Indexes a workspace in preparation for querying it.
You can’t perform that action at this time.
0 commit comments