-
Notifications
You must be signed in to change notification settings - Fork 61
/
package.json
628 lines (628 loc) · 26.9 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
{
"name": "vscode-antlr4",
"displayName": "ANTLR4 grammar syntax support",
"description": "Language support for ANTLR4 grammar files",
"icon": "misc/ANTLRng2.png",
"galleryBanner": {
"color": "#2789e1",
"theme": "dark"
},
"version": "2.4.7",
"publisher": "mike-lischke",
"license": "SEE LICENSE IN License.txt",
"repository": {
"type": "git",
"url": "https://github.com/mike-lischke/vscode-antlr4"
},
"bugs": {
"url": "https://github.com/mike-lischke/vscode-antlr4/issues"
},
"homepage": "http://www.soft-gems.net",
"engines": {
"vscode": "^1.92.0"
},
"categories": [
"Programming Languages",
"Debuggers"
],
"main": "./out/main.cjs",
"type": "module",
"activationEvents": [
"onLanguage:antlr-injection"
],
"contributes": {
"languages": [
{
"id": "antlr",
"aliases": [
"ANTLR",
"antlr"
],
"extensions": [
".g",
".g4"
],
"firstLine": "^(lexer|parser)?\\s*grammar\\s*\\w+\\s*;",
"configuration": "./antlr.configuration.json"
},
{
"id": "antlr-injection"
}
],
"grammars": [
{
"language": "antlr",
"scopeName": "source.antlr",
"path": "./syntaxes/antlr.json"
},
{
"language": "antlr-injection",
"scopeName": "markdown.antlr.codeblock",
"path": "./syntaxes/antlr.codeblock.json",
"injectTo": [
"text.html.markdown"
],
"embeddedLanguages": {
"meta.embedded.block.antlr": "antlr"
}
}
],
"themes": [
{
"label": "Complete Dark",
"uiTheme": "vs-dark",
"path": "./themes/complete_dark.json"
},
{
"label": "Complete Light",
"uiTheme": "vs",
"path": "./themes/complete_light.json"
}
],
"configuration": {
"title": "ANTLR4 configuration",
"properties": {
"antlr4.referencesCodeLens.enabled": {
"type": "boolean",
"default": false,
"description": "Enable/disable the references code lens"
},
"antlr4.customCSS": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"description": "List of custom CSS file names for diagram SVG files"
},
"antlr4.rrd.saveDir": {
"type": "string",
"default": "",
"description": "Default export target folder for railroad diagrams"
},
"antlr4.rrd.stripNamePart": {
"type": "string",
"default": "",
"description": "Regular expression that is matched against rules names, to filter out parts of the name that should not be shown in the diagram"
},
"antlr4.rrd.wrapAfter": {
"type": "number",
"default": 0,
"description": "If > 0, element sequences (the visual expression of a single alternative) are wrapped when the number of characters in all rendered elements exceeds this value. Since rendering also depends on other graphical details, total line lengths may still vary a bit."
},
"antlr4.atn.saveDir": {
"type": "string",
"default": "",
"description": "Default export target folder for ATN SVG files"
},
"antlr4.atn.maxLabelCount": {
"type": "number",
"default": 3,
"description": "Highest number of labels displayed on a transition in an ATN graph"
},
"antlr4.call-graph.saveDir": {
"type": "string",
"default": "",
"description": "Default export target folder for call graphs"
},
"antlr4.generation": {
"type": "object",
"default": {
"mode": "internal",
"listeners": true,
"visitors": false
},
"description": "Settings related to parser generation",
"properties": {
"mode": {
"type": "string",
"default": "internal",
"description": "Determines the mode for code generation (none at all, only for internal use, also for external use)",
"enum": [
"none",
"internal",
"external"
]
},
"outputDir": {
"type": "string",
"default": "",
"description": "Output dir where all output is generated (relative to grammar or absolute path)"
},
"importDir": {
"type": "string",
"default": "",
"description": "Location to import grammars from (relative to a grammar or absolute path)"
},
"package": {
"type": "string",
"default": "",
"description": "Package/namespace for generated code"
},
"language": {
"type": "string",
"default": "",
"description": "Specifies the target language for the generated code, overriding what is specified in the grammar"
},
"listeners": {
"type": "boolean",
"default": true,
"description": "Also create listeners on code generation"
},
"visitors": {
"type": "boolean",
"default": false,
"description": "Also create visitors on code generation"
},
"javaHomeOverride": {
"type": "string",
"description": "Path to your JDK/JRE installation. Set this if `java` is not on your `$PATH` or you wish to use a different Java installation. The Java binary at `${javaHomeOverride}/bin/java` will be used to invoke antlr if this property is set."
},
"alternativeJar": {
"type": "string",
"description": "Path to a Java jar file to be used for parser generation"
},
"additionalParameters": {
"type": [
"string",
"array"
],
"description": "Additional command line parameters you want to send to the ANTLR4 jar. Either a single string or a list of strings."
}
}
},
"antlr4.format": {
"type": "object",
"default": {
"alignTrailingComments": false,
"allowShortBlocksOnASingleLine": true,
"breakBeforeBraces": false,
"columnLimit": 100,
"continuationIndentWidth": 4,
"indentWidth": 4,
"keepEmptyLinesAtTheStartOfBlocks": false,
"maxEmptyLinesToKeep": 1,
"reflowComments": true,
"spaceBeforeAssignmentOperators": true,
"tabWidth": 4,
"useTab": true,
"alignColons": "none",
"singleLineOverrulesHangingColon": true,
"allowShortRulesOnASingleLine": true,
"alignSemicolons": "none",
"breakBeforeParens": false,
"ruleInternalsOnSingleLine": false,
"minEmptyLines": 0,
"groupedAlignments": true,
"alignFirstTokens": false,
"alignLexerCommands": false,
"alignActions": false,
"alignLabels": true,
"alignTrailers": false
},
"description": "Settings related to code formatting",
"properties": {
"disabled": {
"type": "boolean",
"default": false,
"description": "If true, disables formatting"
},
"alignTrailingComments": {
"type": "boolean",
"default": false,
"description": "If true, aligns trailing comments"
},
"allowShortBlocksOnASingleLine": {
"type": "boolean",
"default": true,
"description": "Allows contracting short blocks to a single line"
},
"breakBeforeBraces": {
"type": "boolean",
"default": false,
"description": "When true start predicates and actions on a new line"
},
"columnLimit": {
"type": "number",
"default": 100,
"description": "The character count after which automatic line breaking takes place"
},
"continuationIndentWidth": {
"type": "number",
"default": 4,
"description": "Indentation for line continuation (only used if useTab is false)"
},
"indentWidth": {
"type": "number",
"default": 4,
"description": "Character count for indentation (if useTab is false)"
},
"keepEmptyLinesAtTheStartOfBlocks": {
"type": "boolean",
"default": false,
"description": "If true, empty lines at the start of blocks are kept"
},
"maxEmptyLinesToKeep": {
"type": "number",
"default": 1,
"description": "The maximum number of consecutive empty lines to keep"
},
"reflowComments": {
"type": "boolean",
"default": true,
"description": "Reformat comments to fit the column limit"
},
"spaceBeforeAssignmentOperators": {
"type": "boolean",
"default": true,
"description": "Enables spaces around operators"
},
"tabWidth": {
"type": "number",
"default": 4,
"description": "Multiples of this value determine tab stops in a document"
},
"useTab": {
"type": "boolean",
"default": true,
"description": "Use tabs for indentation"
},
"alignColons": {
"type": "string",
"default": "none",
"enum": [
"none",
"trailing",
"hanging"
],
"description": "Align colons among rules (scope depends on groupedAlignments)"
},
"singleLineOverrulesHangingColon": {
"type": "boolean",
"default": true,
"description": "Single line mode overrides hanging colon setting (applies also to alignSemicolons)"
},
"allowShortRulesOnASingleLine": {
"type": "boolean",
"default": true,
"description": "Allows contracting short rules on a single line (short: < 2/3 of columnLimit)"
},
"alignSemicolons": {
"type": "string",
"default": "none",
"enum": [
"none",
"ownLine",
"hanging"
],
"description": "Determines the alignment of semicolons in rules (no alignment, first column on an own line or aligned to pipe chars on an own line)"
},
"breakBeforeParens": {
"type": "boolean",
"default": false,
"description": "For blocks: if true puts opening parentheses on an own line"
},
"ruleInternalsOnSingleLine": {
"type": "boolean",
"default": false,
"description": "Place rule internals (return value, local variables, @init, @after) all on a single line"
},
"minEmptyLines": {
"type": "number",
"default": 0,
"description": "Determines the number of empty lines that must exist (between rules or other full statements)"
},
"groupedAlignments": {
"type": "boolean",
"default": true,
"description": "When true only consecutive lines are considered for alignments"
},
"alignFirstTokens": {
"type": "boolean",
"default": false,
"description": "Align the first token after the colon among rules"
},
"alignLexerCommands": {
"type": "boolean",
"default": false,
"description": "Align lexer commands (starting with ->) among rule"
},
"alignActions": {
"type": "boolean",
"default": false,
"description": "Align action blocks + predicates among rules and alternatives"
},
"alignLabels": {
"type": "boolean",
"default": true,
"description": "Align alt labels (only when a rule is not on a single line)"
},
"alignTrailers": {
"type": "boolean",
"default": false,
"description": "Combine all alignments (align whatever comes first: colons, comments etc.)"
}
}
},
"antlr4.debug": {
"type": "object",
"description": "Debugging related settings",
"default": {
"visualParseTreeHorizontal": true,
"visualParseTreeClustered": false
},
"properties": {
"visualParseTreeHorizontal": {
"type": "boolean",
"default": true,
"description": "Visual parse trees extend to the right (true) or down (false)"
},
"visualParseTreeClustered": {
"type": "boolean",
"default": false,
"description": "Use a clustered tree for visual parse trees where all terminals are aligned, or the more compact standard tree"
}
}
},
"antlr4.log": {
"type": "string",
"description": "Determines the level of logging",
"default": "none",
"enum": [
"none",
"debug"
],
"enumDescriptions": [
"No logging",
"Log debug messages"
]
}
}
},
"commands": [
{
"command": "antlr.atn.singleRule",
"title": "Show ATN Graph for Rule",
"category": "ANTLR"
},
{
"command": "antlr.rrd.singleRule",
"title": "Show Railroad Diagram for Rule",
"category": "ANTLR"
},
{
"command": "antlr.rrd.allRules",
"title": "Show Railroad Diagram for All Rules",
"category": "ANTLR"
},
{
"command": "antlr.call-graph",
"title": "Show Grammar Call Graph",
"category": "ANTLR"
},
{
"command": "antlr.tools.generateSentences",
"title": "Generate Valid Input for Rule",
"category": "ANTLR"
}
],
"menus": {
"explorer/context": [],
"editor/title/context": [
{
"when": "resourceLangId == antlr",
"command": "antlr.rrd.allRules",
"group": "antlr@1"
}
],
"editor/title": [
{
"when": "resourceLangId == antlr",
"command": "antlr.rrd.allRules",
"group": "antlr@1"
}
],
"editor/context": [
{
"when": "resourceLangId == antlr",
"command": "antlr.rrd.singleRule",
"group": "antlr@1"
},
{
"when": "resourceLangId == antlr",
"command": "antlr.rrd.allRules",
"group": "antlr@2"
},
{
"when": "resourceLangId == antlr",
"command": "antlr.atn.singleRule",
"group": "antlr@3"
},
{
"when": "resourceLangId == antlr",
"command": "antlr.call-graph",
"group": "antlr@4"
},
{
"when": "resourceLangId == antlr",
"command": "antlr.tools.generateSentences",
"group": "antlr@5"
}
]
},
"viewsContainers": {
"activitybar": [
{
"id": "antlr4-view",
"title": "ANTLR4 View",
"icon": "misc/antlr-logo.svg"
}
]
},
"views": {
"antlr4-view": [
{
"id": "antlr4.lexerSymbols",
"name": "Lexer Tokens",
"when": "antlr4.isLexer || antlr4.isCombined"
},
{
"id": "antlr4.parserSymbols",
"name": "Parser Rules",
"when": "antlr4.isParser || antlr4.isCombined"
},
{
"id": "antlr4.imports",
"name": "Grammar Dependencies",
"when": "antlr4.hasImports"
},
{
"id": "antlr4.channels",
"name": "Token Channels",
"when": "antlr4.isLexer || antlr4.isCombined"
},
{
"id": "antlr4.modes",
"name": "Lexer Modes",
"when": "antlr4.isLexer || antlr4.isCombined"
},
{
"id": "antlr4.actions",
"name": "Actions & Predicates",
"when": "antlr4.isLexer || antlr4.isParser || antlr4.isCombined"
}
]
},
"breakpoints": [
{
"language": "antlr"
}
],
"debuggers": [
{
"type": "antlr-debug",
"label": "ANTLR4 Debug",
"runtime": "node",
"configurationAttributes": {
"launch": {
"required": [
"input"
],
"properties": {
"input": {
"type": "string",
"description": "Path to a text file containing test input to parse.",
"default": "input.txt"
},
"startRule": {
"type": "string",
"description": "The name of the rule to be used as entry point. If omitted the first parser rule in the grammar is used instead.",
"default": ""
},
"grammar": {
"type": "string",
"description": "The path to a grammar to debug. Leave empty to debug the grammar in the active editor.",
"default": null
},
"actionFile": {
"type": "string",
"description": "The path to a JS file which can evaluate semantic predicates and handle actions from grammars.",
"default": null
},
"trace": {
"type": "boolean",
"description": "Log internal debugger messages to debug console.",
"default": false
},
"printParseTree": {
"type": "boolean",
"description": "Print the textual parse tree in the debug console",
"default": true
},
"visualParseTree": {
"type": "boolean",
"description": "Show a visual parse tree during debug",
"default": true
}
}
}
},
"configurationSnippets": [
{
"label": "ANTLR: Parse",
"description": "A new configuration for parsing with a grammar.",
"body": {
"type": "antlr-debug",
"request": "launch",
"name": "Debug Current Grammar",
"input": "input.txt",
"visualParseTree": true
}
}
]
}
]
},
"scripts": {
"publish": "vsce publish",
"package": "vsce package",
"vscode:prepublish": "npm run build",
"local-test": "node --no-warnings --experimental-vm-modules node_modules/jest/bin/jest.js --coverage",
"test": "node --no-warnings --experimental-vm-modules node_modules/jest/bin/jest.js --no-coverage",
"generate": "antlr4ng -Dlanguage=TypeScript -visitor -Xexact-output-dir grammars/LexBasic.g4 grammars/ANTLRv4Lexer.g4 grammars/ANTLRv4Parser.g4 -o src/parser",
"lint": "eslint \"./src/**/*.ts\"",
"build": "tsc -b && esbuild ./src/extension.ts --bundle --outfile=out/main.cjs --external:vscode --format=cjs --platform=node --loader:.svg=file",
"build-watch": "npm run build -- --watch"
},
"dependencies": {
"@unicode/unicode-15.1.0": "1.5.2",
"@vscode/debugadapter": "1.66.0",
"@vscode/debugprotocol": "1.66.0",
"antlr-format": "2.1.5",
"antlr4-c3": "3.4.1",
"antlr4ng": "3.0.4",
"d3": "7.9.0",
"fs-extra": "11.2.0"
},
"devDependencies": {
"@stylistic/eslint-plugin-ts": "2.6.4",
"@types/d3": "7.4.3",
"@types/fs-extra": "11.0.4",
"@types/jest": "29.5.12",
"@types/node": "22.5.0",
"@types/vscode": "1.92.0",
"@typescript-eslint/eslint-plugin": "8.2.0",
"@typescript-eslint/eslint-plugin-tslint": "7.0.2",
"@typescript-eslint/parser": "8.2.0",
"antlr4ng-cli": "2.0.0",
"esbuild": "0.23.1",
"eslint": "8.57.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-jsdoc": "50.2.2",
"eslint-plugin-prefer-arrow": "1.2.3",
"jest": "29.7.0",
"ts-jest": "29.2.5",
"ts-node": "10.9.2",
"typescript": "5.5.4"
}
}