|
98 | 98 | "define-directives": {
|
99 | 99 | "patterns": [
|
100 | 100 | {
|
101 |
| - "begin": "^\\s*(?i)(#define)\\s*", |
| 101 | + "begin": "^\\s*(?i)(#\\s*define)\\s+", |
102 | 102 | "beginCaptures": {
|
103 | 103 | "1": {
|
104 | 104 | "name": "keyword.other.define.cos"
|
|
180 | 180 | }
|
181 | 181 | ]
|
182 | 182 | },
|
183 |
| - "dotted-attrs": { |
| 183 | + "dotted-attrs": { "comment": "WTF?", |
184 | 184 | "match": "((%|\\w|\\.|#)+)",
|
185 | 185 | "captures": {
|
186 | 186 | "1": {
|
|
190 | 190 | },
|
191 | 191 | "statements": {
|
192 | 192 | "patterns": [
|
193 |
| - { |
194 |
| - "include": "#properties" |
195 |
| - }, |
196 |
| - { |
197 |
| - "include": "#parameters" |
198 |
| - }, |
199 |
| - { |
200 |
| - "include": "#indices" |
201 |
| - }, |
202 |
| - { |
203 |
| - "include": "#fks" |
204 |
| - }, |
205 |
| - { |
206 |
| - "include": "#classes" |
207 |
| - }, |
208 |
| - { |
209 |
| - "include": "#methods" |
210 |
| - }, |
211 |
| - { |
212 |
| - "include": "#xml-data" |
213 |
| - }, |
214 |
| - { |
215 |
| - "include": "#keywords" |
216 |
| - }, |
217 |
| - { |
218 |
| - "include": "#variables" |
219 |
| - } |
| 193 | + { "include": "#properties" }, |
| 194 | + { "include": "#parameters" }, |
| 195 | + { "include": "#indices"}, |
| 196 | + { "include": "#relationship" }, |
| 197 | + { "include": "#foreignkey" }, |
| 198 | + { "include": "#classes" }, |
| 199 | + { "include": "#methods" }, |
| 200 | + { "include": "#class-query" }, |
| 201 | + { "include": "#xml-data" }, |
| 202 | + { "include": "#keywords" }, |
| 203 | + { "include": "#variables" } |
| 204 | + |
220 | 205 | ]
|
221 | 206 | },
|
222 | 207 | "properties": {
|
223 | 208 | "begin": "^\\s*(?i)(Property)\\s+(\\w+)",
|
224 | 209 | "beginCaptures": {
|
225 | 210 | "1": {
|
226 |
| - "name": "entity.name.type.property.cos" |
| 211 | + "name": "storage.type.cos" |
227 | 212 | },
|
228 | 213 | "2": {
|
229 |
| - "name": "variable.other.cos" |
| 214 | + "name": "entity.name.cos" |
230 | 215 | }
|
231 | 216 | },
|
232 | 217 | "end": "$",
|
|
243 | 228 | "begin": "^\\s*(?i)(Parameter)\\s+(\\w+)",
|
244 | 229 | "beginCaptures": {
|
245 | 230 | "1": {
|
246 |
| - "name": "entity.name.type.property.cos" |
| 231 | + "name": "storage.type.cos" |
247 | 232 | },
|
248 | 233 | "2": {
|
249 |
| - "name": "variable.other.cos" |
| 234 | + "name": "entity.name.cos" |
250 | 235 | }
|
251 | 236 | },
|
252 | 237 | "end": "$",
|
|
263 | 248 | "begin": "^\\s*(?i)(Index)\\s+(\\w+)",
|
264 | 249 | "beginCaptures": {
|
265 | 250 | "1": {
|
266 |
| - "name": "entity.name.type.property.cos" |
| 251 | + "name": "storage.type.cos" |
267 | 252 | },
|
268 | 253 | "2": {
|
269 |
| - "name": "variable.other.cos" |
| 254 | + "name": "entity.name.cos" |
270 | 255 | }
|
271 | 256 | },
|
272 | 257 | "end": "$",
|
|
284 | 269 | }
|
285 | 270 | ]
|
286 | 271 | },
|
287 |
| - "fks": { |
| 272 | + "relationship": { |
288 | 273 | "begin": "^\\s*(?i)(Relationship)\\s+(\\w+)",
|
289 | 274 | "beginCaptures": {
|
290 | 275 | "1": {
|
291 |
| - "name": "entity.name.type.property.cos" |
| 276 | + "name": "storage.type.cos" |
292 | 277 | },
|
293 | 278 | "2": {
|
294 |
| - "name": "variable.other.cos" |
| 279 | + "name": "entity.name.cos" |
295 | 280 | }
|
296 | 281 | },
|
297 | 282 | "end": "$",
|
|
304 | 289 | }
|
305 | 290 | ]
|
306 | 291 | },
|
| 292 | + "foreignkey": { |
| 293 | + "begin": "^\\s*(?i)(ForeignKey)\\s+(\\w+)", |
| 294 | + "beginCaptures": { |
| 295 | + "1": { |
| 296 | + "name": "storage.type.cos" |
| 297 | + }, |
| 298 | + "2": { |
| 299 | + "name": "entity.name.cos" |
| 300 | + } |
| 301 | + }, |
| 302 | + "end": ";\\s*$", |
| 303 | + "patterns": [ |
| 304 | + { "comment": "FK props \"ForeignKey TestKey(Propeties)\"", |
| 305 | + "begin": "\\(", "end":"\\)", |
| 306 | + "patterns": [ |
| 307 | + |
| 308 | + { |
| 309 | + "match": "(\\w+)", |
| 310 | + "captures": { |
| 311 | + "1": { "name": "variable.parameter.cos" } |
| 312 | + } |
| 313 | + } |
| 314 | + ] |
| 315 | + }, |
| 316 | + { "comment": "FK references", |
| 317 | + "begin": "(?i)(References)\\s+(\\w+)\\s*\\(", "end": "\\)", |
| 318 | + "beginCaptures": { |
| 319 | + "1": { "name": "storage.type.cos" }, |
| 320 | + "2": { "name": "entity.name.cos" } |
| 321 | + }, |
| 322 | + "patterns": [ |
| 323 | + { |
| 324 | + "match": "(\\w+)", |
| 325 | + "captures": { |
| 326 | + "1": { "name": "variable.parameter.cos" } |
| 327 | + } |
| 328 | + } |
| 329 | + ] |
| 330 | + } |
| 331 | + ] |
| 332 | + }, |
| 333 | + |
| 334 | + |
| 335 | + |
307 | 336 | "as-keywords": {
|
308 | 337 | "match": "\\b(?i)(As)\\b",
|
309 | 338 | "captures": {
|
|
313 | 342 | }
|
314 | 343 | },
|
315 | 344 | "classes": {
|
316 |
| - "begin": "^\\s*(?i)(Class)\\s+(\\w+)", |
| 345 | + "begin": "^\\s*(?i)(Class)\\s+([%|A-Za-z][A-Za-z0-9.]+)", |
317 | 346 | "beginCaptures": {
|
318 | 347 | "1": {
|
319 |
| - "name": "entity.name.type.property.cos" |
| 348 | + "name": "storage.type.cos" |
320 | 349 | },
|
321 | 350 | "2": {
|
322 |
| - "name": "variable.other.cos" |
| 351 | + "name": "entity.name.cos" |
323 | 352 | }
|
324 | 353 | },
|
325 | 354 | "end": "$",
|
|
336 | 365 | "include": "#dotted-attrs"
|
337 | 366 | },
|
338 | 367 | {
|
339 |
| - "begin": "\\{", |
340 |
| - "end": "\\}", |
| 368 | + "begin": "\\{", "end": "\\}", |
341 | 369 | "patterns": [
|
342 |
| - { |
343 |
| - "include": "#statements" |
344 |
| - } |
| 370 | + { "include": "#class-content" } |
345 | 371 | ]
|
346 | 372 | }
|
347 | 373 | ]
|
348 | 374 | },
|
| 375 | + "class-content": { |
| 376 | + "patterns": [ |
| 377 | + { "include": "#comments" }, |
| 378 | + { "include": "#properties" }, |
| 379 | + { "include": "#parameters" }, |
| 380 | + { "include": "#indices" }, |
| 381 | + { "include": "#relationship" }, |
| 382 | + { "include": "#foreignkey" }, |
| 383 | + { "include": "#methods" }, |
| 384 | + { "include": "#class-query" }, |
| 385 | + { "include": "#xml-data" }, |
| 386 | + { "include": "#keywords" }, |
| 387 | + { "include": "#variables" } |
| 388 | + ] |
| 389 | + }, |
| 390 | + |
349 | 391 | "methods": {
|
350 | 392 | "begin": "^\\s*(?i)(Method|ClassMethod|ClientMethod)\\s+(\\w+)",
|
351 | 393 | "beginCaptures": {
|
352 | 394 | "1": {
|
353 |
| - "name": "entity.name.type.property.cos" |
| 395 | + "name": "storage.type.cos" |
354 | 396 | },
|
355 | 397 | "2": {
|
356 |
| - "name": "variable.other.cos" |
| 398 | + "name": "entity.name.cos" |
357 | 399 | }
|
358 | 400 | },
|
359 | 401 | "end": "$",
|
360 | 402 | "patterns": [
|
361 |
| - { |
362 |
| - "include": "#method-params" |
363 |
| - }, |
364 |
| - { |
365 |
| - "include": "#as-keywords" |
366 |
| - }, |
367 |
| - { |
368 |
| - "include": "#dotted-attrs" |
369 |
| - }, |
370 |
| - { |
371 |
| - "begin": "\\{", |
372 |
| - "end": "\\}", |
373 |
| - "patterns": [ |
| 403 | + { "include": "#method-params" }, |
| 404 | + { "include": "#as-keywords" }, |
| 405 | + { "include": "#dotted-attrs" }, |
| 406 | + { "comment": "method options [SqlProc, etc...]", |
| 407 | + "begin": "\\[", "end": "\\]", |
| 408 | + "patterns":[ |
374 | 409 | {
|
375 |
| - "include": "#statements" |
| 410 | + "match": "(\\w+)", |
| 411 | + "captures": { |
| 412 | + "1": { "name": "variable.other.cos" } |
| 413 | + } |
376 | 414 | }
|
377 | 415 | ]
|
| 416 | + }, |
| 417 | + { "comment": "method body", |
| 418 | + "begin": "\\{", "end": "\\}", |
| 419 | + "patterns": [ |
| 420 | + { "include": "comments" }, |
| 421 | + { "include": "#keywords" }, |
| 422 | + { "include": "#variables" } |
| 423 | + |
| 424 | + ] |
378 | 425 | }
|
379 | 426 | ]
|
380 | 427 | },
|
|
423 | 470 | }
|
424 | 471 | ]
|
425 | 472 | },
|
| 473 | + |
| 474 | + "class-query": { |
| 475 | + "comment": "query definition line", |
| 476 | + "begin": "^\\s*(?i)(Query)\\s+([%A-Za-z0-9.]+)", "end": "}", |
| 477 | + "beginCaptures": { |
| 478 | + "1": { "name": "storage.type.cos" }, |
| 479 | + "2": { "name": "entity.name.cos" } |
| 480 | + }, |
| 481 | + "patterns": [ |
| 482 | + { "comment": "query arguments \"(id as %String)\"", |
| 483 | + "begin": "\\(", "end": "\\)", |
| 484 | + "patterns":[ |
| 485 | + |
| 486 | + { "comment": "query-argument. just name ", |
| 487 | + "match": "(\\w+)", |
| 488 | + "captures": { |
| 489 | + "1": { "name": "variable.parameter.cos" } |
| 490 | + } |
| 491 | + } |
| 492 | + |
| 493 | + ] |
| 494 | + }, |
| 495 | + { "comment": "query type \"As %SQLQuery\"", |
| 496 | + "match": "\\s+(?i)(As)\\s+([%A-Za-z0-9.]+)\\s*", |
| 497 | + "captures": { |
| 498 | + "1": { "name": "keyword.operator.as.cos" }, |
| 499 | + "2": { "name": "variable.other.cos" } |
| 500 | + } |
| 501 | + }, |
| 502 | + { "comment": "query options \"(CONTAINID = 1, EXTENT = 1)\"", |
| 503 | + "begin": "\\(", "end": "\\)", |
| 504 | + "patterns": [ |
| 505 | + { |
| 506 | + "match": "(\\w+)", |
| 507 | + "captures": { |
| 508 | + "1": { "name": "variable.parameter.cos" } |
| 509 | + } |
| 510 | + } |
| 511 | + ] |
| 512 | + }, |
| 513 | + { "comment": "query properties \"[SqlName = test, SqlProc]\"", |
| 514 | + "begin": "\\[", "end": "\\]", |
| 515 | + "patterns": [ |
| 516 | + { |
| 517 | + "match": "(\\w+)", |
| 518 | + "captures": { |
| 519 | + "1": { "name": "variable.other.cos" } |
| 520 | + } |
| 521 | + } |
| 522 | + ] |
| 523 | + }, |
| 524 | + { "comment": "SQL Query block", |
| 525 | + "begin": "\\{", "end": "(?=})", |
| 526 | + "patterns": [{ "include": "#expressions" }] |
| 527 | + } |
| 528 | + |
| 529 | + ] |
| 530 | + }, |
| 531 | + |
426 | 532 | "keywords": {
|
427 | 533 | "patterns": [
|
428 | 534 | {
|
|
491 | 597 | "match": "(##class)\\(((%|\\w|\\.|#)+)\\)",
|
492 | 598 | "captures": {
|
493 | 599 | "1": {
|
494 |
| - "name": "entity.name.class.reference.cos" |
| 600 | + "name": "keyword.other.cos" |
495 | 601 | },
|
496 | 602 | "2": {
|
497 |
| - "name": "variable.parameter.function-argument.cos" |
| 603 | + "name": "entity.name.cos" |
498 | 604 | }
|
499 | 605 | }
|
500 | 606 | },
|
|
509 | 615 | },
|
510 | 616 | "variables": {
|
511 | 617 | "patterns": [
|
512 |
| - { |
| 618 | + { "comment": "shortcut to this class members", |
513 | 619 | "match": "\\.\\.\\w+",
|
514 |
| - "name": "variable.other.property.cos" |
515 |
| - }, |
516 |
| - { |
517 |
| - "match": "\\.\\.#\\w+", |
518 |
| - "name": "variable.other.parameter.cos" |
| 620 | + "name": "entity.name.cos" |
519 | 621 | },
|
520 | 622 | {
|
521 | 623 | "match": "\\^\\w+",
|
522 | 624 | "name": "variable.other.global.cos"
|
523 | 625 | },
|
524 | 626 | {
|
525 | 627 | "match": "\\$\\w+(\\.\\w+)*",
|
526 |
| - "name": "variable.other.system.cos" |
| 628 | + "name": "keyword.other.system.cos" |
527 | 629 | },
|
528 |
| - { |
| 630 | + { "comment": "macros \"$$$SOME\" ", |
529 | 631 | "match": "\\$\\$\\$\\w+",
|
530 |
| - "name": "variable.other.macros.cos" |
| 632 | + "name": "constant.other.macros.cos" |
531 | 633 | },
|
532 | 634 | {
|
533 | 635 | "include": "#strings"
|
|
0 commit comments