@@ -100,7 +100,113 @@ export const executeActions = {
100
100
regexp : / ^ ( G E T | D E L E T E | P O S T | P U T ) \s \w + / ,
101
101
decorationClassName : 'action-execute-decoration' ,
102
102
} ;
103
-
103
+ const keywords = [
104
+ 'GET' ,
105
+ 'POST' ,
106
+ 'PUT' ,
107
+ 'DELETE' ,
108
+ 'HEAD' ,
109
+ 'OPTIONS' ,
110
+ 'PATCH' ,
111
+ 'TRACE' ,
112
+ 'index' ,
113
+ 'indices' ,
114
+ 'type' ,
115
+ 'types' ,
116
+ 'from' ,
117
+ 'size' ,
118
+ 'explain' ,
119
+ 'analyze' ,
120
+ 'default_operator' ,
121
+ 'df' ,
122
+ 'analyzer' ,
123
+ 'lenient' ,
124
+ 'lowercase_expanded_terms' ,
125
+ 'analyze_wildcard' ,
126
+ 'all_shards' ,
127
+ 'allow_no_indices' ,
128
+ 'expand_wildcards' ,
129
+ 'preference' ,
130
+ 'routing' ,
131
+ 'ignore_unavailable' ,
132
+ 'allow_no_indices' ,
133
+ 'ignore_throttled' ,
134
+ 'search_type' ,
135
+ 'batched_reduce_size' ,
136
+ 'ccs_minimize_roundtrips' ,
137
+ 'max_concurrent_shard_requests' ,
138
+ 'pre_filter_shard_size' ,
139
+ 'rest_total_hits_as_int' ,
140
+ 'scroll' ,
141
+ 'search_type' ,
142
+ 'typed_keys' ,
143
+ 'wait_for_active_shards' ,
144
+ 'wait_for_completion' ,
145
+ 'requests_per_second' ,
146
+ 'slices' ,
147
+ 'timeout' ,
148
+ 'terminate_after' ,
149
+ 'stats' ,
150
+ 'version' ,
151
+ 'version_type' ,
152
+ 'if_seq_no' ,
153
+ 'if_primary_term' ,
154
+ 'refresh' ,
155
+ 'routing' ,
156
+ 'parent' ,
157
+ 'preference' ,
158
+ 'realtime' ,
159
+ 'refresh' ,
160
+ 'retry_on_conflict' ,
161
+ 'timeout' ,
162
+ 'version' ,
163
+ 'version_type' ,
164
+ 'if_seq_no' ,
165
+ 'if_primary_term' ,
166
+ 'pipeline' ,
167
+ 'wait_for_active_shards' ,
168
+ 'wait_for_completion' ,
169
+ 'requests_per_second' ,
170
+ 'slices' ,
171
+ 'timeout' ,
172
+ 'terminate_after' ,
173
+ 'stats' ,
174
+ 'version' ,
175
+ 'version_type' ,
176
+ 'if_seq_no' ,
177
+ 'if_primary_term' ,
178
+ 'refresh' ,
179
+ 'routing' ,
180
+ 'parent' ,
181
+ 'preference' ,
182
+ 'realtime' ,
183
+ 'refresh' ,
184
+ 'retry_on_conflict' ,
185
+ 'timeout' ,
186
+ 'version' ,
187
+ 'version_type' ,
188
+ 'if_seq_no' ,
189
+ 'if_primary_term' ,
190
+ 'pipeline' ,
191
+ 'wait_for_active_shards' ,
192
+ 'wait_for_completion' ,
193
+ 'requests_per_second' ,
194
+ 'slices' ,
195
+ 'timeout' ,
196
+ 'terminate_after' ,
197
+ 'stats' ,
198
+ 'version' ,
199
+ 'version_type' ,
200
+ '_search' ,
201
+ '_count' ,
202
+ '_mapping' ,
203
+ '_cluster' ,
204
+ '_nodes' ,
205
+ '_aliases' ,
206
+ '_doc' ,
207
+ '_update' ,
208
+ '_bulk' ,
209
+ ] ;
104
210
export const search = {
105
211
id : 'search' ,
106
212
rules : {
@@ -109,105 +215,7 @@ export const search = {
109
215
tokenPostfix : '.search' ,
110
216
111
217
// keywords of elasticsearch
112
- keywords : [
113
- 'GET' ,
114
- 'POST' ,
115
- 'PUT' ,
116
- 'DELETE' ,
117
- 'HEAD' ,
118
- 'OPTIONS' ,
119
- 'PATCH' ,
120
- 'TRACE' ,
121
- 'index' ,
122
- 'indices' ,
123
- 'type' ,
124
- 'types' ,
125
- 'from' ,
126
- 'size' ,
127
- 'explain' ,
128
- 'analyze' ,
129
- 'default_operator' ,
130
- 'df' ,
131
- 'analyzer' ,
132
- 'lenient' ,
133
- 'lowercase_expanded_terms' ,
134
- 'analyze_wildcard' ,
135
- 'all_shards' ,
136
- 'allow_no_indices' ,
137
- 'expand_wildcards' ,
138
- 'preference' ,
139
- 'routing' ,
140
- 'ignore_unavailable' ,
141
- 'allow_no_indices' ,
142
- 'ignore_throttled' ,
143
- 'search_type' ,
144
- 'batched_reduce_size' ,
145
- 'ccs_minimize_roundtrips' ,
146
- 'max_concurrent_shard_requests' ,
147
- 'pre_filter_shard_size' ,
148
- 'rest_total_hits_as_int' ,
149
- 'scroll' ,
150
- 'search_type' ,
151
- 'typed_keys' ,
152
- 'wait_for_active_shards' ,
153
- 'wait_for_completion' ,
154
- 'requests_per_second' ,
155
- 'slices' ,
156
- 'timeout' ,
157
- 'terminate_after' ,
158
- 'stats' ,
159
- 'version' ,
160
- 'version_type' ,
161
- 'if_seq_no' ,
162
- 'if_primary_term' ,
163
- 'refresh' ,
164
- 'routing' ,
165
- 'parent' ,
166
- 'preference' ,
167
- 'realtime' ,
168
- 'refresh' ,
169
- 'retry_on_conflict' ,
170
- 'timeout' ,
171
- 'version' ,
172
- 'version_type' ,
173
- 'if_seq_no' ,
174
- 'if_primary_term' ,
175
- 'pipeline' ,
176
- 'wait_for_active_shards' ,
177
- 'wait_for_completion' ,
178
- 'requests_per_second' ,
179
- 'slices' ,
180
- 'timeout' ,
181
- 'terminate_after' ,
182
- 'stats' ,
183
- 'version' ,
184
- 'version_type' ,
185
- 'if_seq_no' ,
186
- 'if_primary_term' ,
187
- 'refresh' ,
188
- 'routing' ,
189
- 'parent' ,
190
- 'preference' ,
191
- 'realtime' ,
192
- 'refresh' ,
193
- 'retry_on_conflict' ,
194
- 'timeout' ,
195
- 'version' ,
196
- 'version_type' ,
197
- 'if_seq_no' ,
198
- 'if_primary_term' ,
199
- 'pipeline' ,
200
- 'wait_for_active_shards' ,
201
- 'wait_for_completion' ,
202
- 'requests_per_second' ,
203
- 'slices' ,
204
- 'timeout' ,
205
- 'terminate_after' ,
206
- 'stats' ,
207
- 'version' ,
208
- 'version_type' ,
209
- '_search' ,
210
- ] ,
218
+ keywords,
211
219
212
220
typeKeywords : [ 'any' , 'boolean' , 'number' , 'object' , 'string' , 'undefined' ] ,
213
221
@@ -222,11 +230,16 @@ export const search = {
222
230
// The main tokenizer for our languages
223
231
tokenizer : {
224
232
root : [
225
- [ executeActions . regexp , executeActions . decorationClassName ] ,
226
- [ / [ { } ] / , 'delimiter.bracket' ] ,
233
+ {
234
+ regex : '{' ,
235
+ action : {
236
+ token : 'paren.lparen' ,
237
+ next : 'json' ,
238
+ } ,
239
+ } ,
227
240
{ include : 'common' } ,
228
241
] ,
229
-
242
+ constant : [ [ executeActions . regexp , executeActions . decorationClassName ] ] ,
230
243
common : [
231
244
// identifiers and keywords
232
245
[
0 commit comments