-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.json
More file actions
2188 lines (2188 loc) · 82.7 KB
/
Copy pathpackage.json
File metadata and controls
2188 lines (2188 loc) · 82.7 KB
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
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"name": "vscode-kopytko",
"displayName": "Kopytko BrightScript",
"description": "BrightScript & Kopytko language support for Visual Studio Code — syntax, IntelliSense, diagnostics, and Kopytko import resolution.",
"version": "1.15.1",
"publisher": "bchelkowski",
"license": "MIT",
"icon": "images/kopytko-logo.png",
"keywords": [
"roku",
"brightscript",
"scenegraph",
"brs",
"kopytko",
"formatter",
"prettier",
"linter",
"lint",
"debugger",
"debug",
"remote",
"perfetto"
],
"engines": {
"vscode": "^1.125.0",
"node": ">=24.0.0"
},
"scripts": {
"vscode:prepublish": "npm run bundle",
"bundle": "npm run bundle:extension && npm run bundle:server && npm run bundle:webview && npm run bundle:perfetto-webview && npm run bundle:node-tree-webview && npm run bundle:nav-webview && npm run bundle:deep-linking-webview && npm run bundle:device-manager-webview && npm run bundle:script-editor-webview && npm run bundle:roku-pay-webview && npm run bundle:network-webview && npm run bundle:console-webview",
"bundle:extension": "esbuild src/extension.ts --bundle --outfile=out/extension.js --external:vscode --platform=node --format=cjs --sourcemap",
"bundle:server": "esbuild src/server/server.ts --bundle --outfile=out/server/server.js --platform=node --format=cjs --sourcemap",
"bundle:webview": "esbuild src/client/diagnostics/webview/main.ts --bundle --outfile=out/diagnostics-webview/main.js --platform=browser --format=iife --sourcemap",
"bundle:perfetto-webview": "esbuild src/client/perfetto/webview/main.ts --bundle --outfile=out/perfetto-webview/main.js --platform=browser --format=iife --sourcemap",
"bundle:node-tree-webview": "esbuild src/client/nodes/webview/main.ts --bundle --outfile=out/node-tree-webview/main.js --platform=browser --format=iife --sourcemap",
"bundle:nav-webview": "esbuild src/client/nav/webview/main.ts --bundle --outfile=out/nav-webview/main.js --platform=browser --format=iife --sourcemap",
"bundle:deep-linking-webview": "esbuild src/client/deepLinking/webview/main.ts --bundle --outfile=out/deep-linking-webview/main.js --platform=browser --format=iife --sourcemap",
"bundle:device-manager-webview": "esbuild src/client/deviceManager/webview/main.ts --bundle --outfile=out/device-manager-webview/main.js --platform=browser --format=iife --sourcemap",
"bundle:script-editor-webview": "esbuild src/client/deviceManager/editorWebview/main.ts --bundle --outfile=out/script-editor-webview/main.js --platform=browser --format=iife --sourcemap",
"bundle:roku-pay-webview": "esbuild src/client/rokuPay/webview/main.ts --bundle --outfile=out/roku-pay-webview/main.js --platform=browser --format=iife --sourcemap",
"bundle:network-webview": "esbuild src/client/network/webview/main.ts --bundle --outfile=out/network-webview/main.js --platform=browser --format=iife --sourcemap",
"bundle:console-webview": "esbuild src/client/console/webview/main.ts --bundle --outfile=out/console-webview/main.js --platform=browser --format=iife --sourcemap --loader:.woff=dataurl",
"compile": "tsc -p ./tsconfig.json && tsc -p ./tsconfig.server.json && npm run bundle:webview && npm run bundle:perfetto-webview && npm run bundle:node-tree-webview && npm run bundle:nav-webview && npm run bundle:deep-linking-webview && npm run bundle:device-manager-webview && npm run bundle:script-editor-webview && npm run bundle:roku-pay-webview && npm run bundle:network-webview && npm run bundle:console-webview",
"build:roku-device": "npm --prefix packages/roku-device install && npm --prefix packages/roku-device run build",
"watch": "tsc -w -p ./tsconfig.json",
"watch:server": "tsc -w -p ./tsconfig.server.json",
"watch:webview": "esbuild src/client/diagnostics/webview/main.ts --bundle --outfile=out/diagnostics-webview/main.js --platform=browser --format=iife --sourcemap --watch",
"watch:perfetto-webview": "esbuild src/client/perfetto/webview/main.ts --bundle --outfile=out/perfetto-webview/main.js --platform=browser --format=iife --sourcemap --watch",
"map": "node scripts/generate-map.mjs",
"check:claims": "node scripts/check-doc-claims.mjs",
"lint": "node scripts/generate-map.mjs --check && node scripts/check-doc-claims.mjs && eslint \"./src/**/*.ts\" \"./test/**/*.ts\"",
"test": "mocha",
"test:coverage": "nyc mocha",
"clean": "node -e \"const fs=require('fs'); fs.rmSync('out',{recursive:true,force:true}); fs.rmSync('out-test',{recursive:true,force:true})\"",
"package": "vsce package"
},
"dependencies": {
"d3": "^7.9.0",
"js-yaml": "^5.2.1",
"kopytko-brightscript-parser": "^1.4.0",
"kopytko-formatter": "^1.2.2",
"kopytko-linter": "^2.0.0",
"kopytko-roku-device": "^1.5.1",
"vscode-languageclient": "^10.1.0",
"vscode-languageserver": "^10.1.0",
"vscode-languageserver-textdocument": "^1.0.12",
"vscode-uri": "^3.1.0"
},
"devDependencies": {
"@types/js-yaml": "^4.0.9",
"@types/mocha": "^10.0.10",
"@types/node": "^26.1.1",
"@types/sinon": "^22.0.0",
"@types/vscode": "^1.125.0",
"@vscode/vsce": "^3.9.2",
"@xterm/addon-fit": "^0.11.0",
"@xterm/xterm": "^6.0.0",
"chai": "^6.2.2",
"esbuild": "^0.28.1",
"eslint": "^10.7.0",
"mocha": "^11.7.6",
"nyc": "^18.0.0",
"sinon": "^22.0.0",
"source-map-support": "^0.5.21",
"tsx": "^4.23.1",
"typescript": "^6.0.3",
"typescript-eslint": "^8.64.0"
},
"overrides": {
"serialize-javascript": "^7.0.5",
"diff": "^8.0.3"
},
"repository": {
"type": "git",
"url": "https://github.com/bchelkowski/vscode-kopytko"
},
"bugs": {
"url": "https://github.com/bchelkowski/vscode-kopytko/issues"
},
"categories": [
"Programming Languages",
"Linters",
"Snippets"
],
"activationEvents": [
"onLanguage:brightscript",
"onLanguage:xml",
"workspaceContains:**/*.brs",
"workspaceContains:**/.kopytkorc",
"onDebug"
],
"main": "./out/extension",
"contributes": {
"languages": [
{
"id": "brightscript",
"aliases": [
"BrightScript",
"brightscript",
"brs"
],
"extensions": [
".brs"
],
"configuration": "./language-configuration.json",
"icon": {
"light": "./images/brightscript.svg",
"dark": "./images/brightscript.svg"
}
}
],
"grammars": [
{
"language": "brightscript",
"scopeName": "source.brightscript",
"path": "./syntaxes/brightscript.tmLanguage.json"
}
],
"semanticTokenScopes": [
{
"language": "brightscript",
"scopes": {
"function": [
"entity.name.function",
"support.function"
],
"function.declaration": [
"entity.name.function",
"support.function"
],
"parameter": [
"variable.parameter"
],
"parameter.declaration": [
"variable.parameter"
],
"variable": [
"variable.other.readwrite"
],
"variable.declaration": [
"variable.other.readwrite"
],
"property": [
"variable.other.property"
],
"property.declaration": [
"variable.other.property"
]
}
}
],
"configuration": {
"title": "Kopytko BrightScript",
"properties": {
"kopytko.languageServer.enabled": {
"type": "boolean",
"default": true,
"description": "Enable the Kopytko language server."
},
"kopytko.languageServer.trace": {
"type": "string",
"enum": [
"off",
"messages",
"verbose"
],
"default": "off",
"description": "Trace LSP communication for debugging."
},
"kopytko.debug.trace": {
"type": "string",
"enum": [
"off",
"messages",
"verbose"
],
"enumDescriptions": [
"No protocol tracing.",
"Log every debug-protocol command, response and device update.",
"Also hex-dump every framed packet."
],
"default": "off",
"description": "Trace the Roku debug protocol (port 8081) to the Kopytko output channel. Use when a debug session disconnects or the channel freezes on resume."
},
"kopytko.imports.resolveModules": {
"type": "boolean",
"default": true,
"description": "Resolve @import annotations from installed Kopytko NPM modules."
},
"kopytko.imports.sourceDir": {
"type": "string",
"default": "app",
"description": "Root source directory for resolving internal @import paths (matches .kopytkorc sourceDir)."
},
"kopytko.imports.generatedPaths": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"markdownDescription": "Glob patterns for `@import` paths that are generated during the build process and do not exist as source files on disk (e.g. by a Kopytko plugin or code-generation tool). Unresolved imports matching these patterns are shown as informational hints instead of warnings, so the developer is aware of the situation without it being flagged as an error.\n\n**Supported wildcards:** `*` matches any characters except `/`; `**` matches any characters including `/`.\n\n**Examples:**\n- `/components/generated/**`\n- `**/auto-generated/*.brs`"
},
"kopytko.imports.generatedModules": {
"type": "array",
"items": {
"type": "object",
"required": [
"path",
"functions"
],
"properties": {
"path": {
"type": "string",
"description": "Glob pattern matching the @import path of the generated file."
},
"functions": {
"type": "array",
"items": {
"type": "string"
},
"description": "Function and sub names exported by the generated file."
}
}
},
"default": [],
"markdownDescription": "Declarations for `@import` paths that are generated during the build process and whose function names should be known to the language server.\n\nEach entry has a `path` glob pattern and a `functions` list. When a file imports a path matching `path`, the listed functions are added to the known function scope — so they are not flagged as undefined — and the import itself is shown as an informational hint rather than an unresolved warning.\n\nUse this when a plugin or code-generation tool creates `.brs` files that are not present as source files on disk but will exist at build time.\n\n**Example:**\n```json\n[\n {\n \"path\": \"/components/generated/PluginApi.brs\",\n \"functions\": [\"PluginInit\", \"PluginGetData\"]\n }\n]\n```"
},
"kopytko.imports.siblingPatterns": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 2
},
"default": [],
"markdownDescription": "Groups of file name patterns whose `.brs` files share import scope for the `import/unused` diagnostic check.\n\nFiles in the same group are always loaded together by the same XML component, so an `@import` in one file is considered used if any file in the group references one of its exported functions.\n\n**Pattern syntax:** each pattern may contain a single `*` wildcard; files with the same wildcard value in the same directory are considered siblings.\n\n**Example** — Kopytko component/template pairs:\n```json\n[\n [\"*.component.brs\", \"*.template.brs\"],\n [\"*.view.brs\", \"*.template.brs\"]\n]\n```\nWith this config, if `Foo.component.brs` imports `helperFn` and only `Foo.template.brs` calls it, the import is not flagged as unused."
},
"kopytko.readOnlyPaths": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"markdownDescription": "Glob patterns for files that the extension should treat as read-only. Acts as a shared fallback — applies to both formatting and linting unless overridden by `kopytko.format.readOnlyPaths` or `kopytko.lint.readOnlyPaths`.\n\n**Supported wildcards:** `*` matches any characters except `/`; `**` matches any characters including `/`.\n\n**Examples:**\n```json\n[\n \"**/node_modules/**\",\n \"**/generated/**\",\n \"**/vendor/*.brs\"\n]\n```"
},
"kopytko.format.readOnlyPaths": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"markdownDescription": "Glob patterns for files that the formatter should skip. When set, overrides `kopytko.readOnlyPaths` for formatting. When empty, falls back to `kopytko.readOnlyPaths`."
},
"kopytko.lint.readOnlyPaths": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"markdownDescription": "Glob patterns for files that the linter should skip. When set, overrides `kopytko.readOnlyPaths` for linting. When empty, falls back to `kopytko.readOnlyPaths`."
},
"kopytko.lint.rules.type/missing-return-type": {
"type": "string",
"enum": [
"error",
"warning",
"info",
"hint",
"off"
],
"default": "warning",
"description": "Warn when a function is missing an 'as Type' return type annotation."
},
"kopytko.lint.rules.type/missing-param-type": {
"type": "string",
"enum": [
"error",
"warning",
"info",
"hint",
"off"
],
"default": "warning",
"description": "Warn when a function parameter is missing an 'as Type' annotation."
},
"kopytko.lint.rules.component/duplicate-name": {
"type": "string",
"enum": [
"error",
"warning",
"info",
"hint",
"off"
],
"default": "warning",
"markdownDescription": "Warn when two XML files declare the same SceneGraph component name. Component names are global to the channel, so the declaration that loads last silently wins.\n\nBuild pipelines that copy the source tree into an output directory will report every component as a duplicate — exclude the copy with `kopytko.lint.readOnlyPaths` (e.g. `**/out/**`)."
},
"kopytko.casing.builtin": {
"type": "string",
"enum": [
"preserve",
"upper-case",
"lower-case",
"capitalize",
"pascal-case",
"camel-case"
],
"enumDescriptions": [
"Keep the catalog casing (e.g. Abs, CreateObject)",
"ALL CAPS (e.g. ABS, CREATEOBJECT)",
"all lowercase (e.g. abs, createobject)",
"First letter uppercase, rest lowercase (e.g. Abs, Createobject)",
"Each word capitalised (e.g. Abs, CreateObject)",
"First word lowercase, subsequent words capitalised (e.g. abs, createObject)"
],
"default": "preserve",
"description": "Casing applied to BrightScript built-in function names when a completion is inserted."
},
"kopytko.casing.keyword": {
"type": "string",
"enum": [
"preserve",
"upper-case",
"lower-case",
"capitalize",
"pascal-case",
"camel-case"
],
"enumDescriptions": [
"Keep the catalog casing (e.g. for, end sub)",
"ALL CAPS (e.g. FOR, END SUB)",
"all lowercase (e.g. for, end sub)",
"First letter uppercase, rest lowercase (e.g. For, End sub)",
"Each word capitalised (e.g. For, End Sub)",
"First word lowercase, subsequent words capitalised (e.g. for, end Sub)"
],
"default": "preserve",
"description": "Casing applied to BrightScript keywords when a completion is inserted. Acts as fallback for type, literal, and operator casing when those are not set."
},
"kopytko.casing.type": {
"type": "string",
"enum": [
"preserve",
"upper-case",
"lower-case",
"capitalize",
"pascal-case",
"camel-case"
],
"default": "preserve",
"markdownDescription": "Casing for BrightScript type names (`boolean`, `integer`, `string`, `void`, …). Falls back to `kopytko.casing.keyword` when not set."
},
"kopytko.casing.literal": {
"type": "string",
"enum": [
"preserve",
"upper-case",
"lower-case",
"capitalize",
"pascal-case",
"camel-case"
],
"default": "preserve",
"markdownDescription": "Casing for literal values (`true`, `false`, `invalid`). Falls back to `kopytko.casing.keyword` when not set."
},
"kopytko.casing.logicOperator": {
"type": "string",
"enum": [
"preserve",
"upper-case",
"lower-case",
"capitalize",
"pascal-case",
"camel-case"
],
"default": "preserve",
"markdownDescription": "Casing for logic operators (`and`, `or`, `not`). Falls back to `kopytko.casing.keyword` when not set."
},
"kopytko.casing.mathOperator": {
"type": "string",
"enum": [
"preserve",
"upper-case",
"lower-case",
"capitalize",
"pascal-case",
"camel-case"
],
"default": "preserve",
"markdownDescription": "Casing for math operators (`mod`). Falls back to `kopytko.casing.keyword` when not set."
},
"kopytko.casing.method": {
"type": "string",
"enum": [
"preserve",
"upper-case",
"lower-case",
"capitalize",
"pascal-case",
"camel-case"
],
"enumDescriptions": [
"Keep the catalog casing (e.g. Push, SetUrl)",
"ALL CAPS (e.g. PUSH, SETURL)",
"all lowercase (e.g. push, seturl)",
"First letter uppercase, rest lowercase (e.g. Push, Seturl)",
"Each word capitalised (e.g. Push, SetUrl)",
"First word lowercase, subsequent words capitalised (e.g. push, setUrl)"
],
"default": "preserve",
"description": "Casing applied to component method names when a completion is inserted."
},
"kopytko.casing.userFunction": {
"type": "string",
"enum": [
"preserve",
"upper-case",
"lower-case",
"capitalize",
"pascal-case",
"camel-case"
],
"enumDescriptions": [
"Keep the original casing",
"ALL CAPS",
"all lowercase",
"First letter uppercase, rest lowercase",
"Each word capitalised",
"First word lowercase, subsequent words capitalised"
],
"default": "preserve",
"description": "Casing applied to user-defined function/sub names in completions and formatting."
},
"kopytko.casing.userMethod": {
"type": "string",
"enum": [
"preserve",
"upper-case",
"lower-case",
"capitalize",
"pascal-case",
"camel-case"
],
"enumDescriptions": [
"Keep the original casing",
"ALL CAPS",
"all lowercase",
"First letter uppercase, rest lowercase",
"Each word capitalised",
"First word lowercase, subsequent words capitalised"
],
"default": "preserve",
"description": "Casing applied to user-defined associative array method names in completions."
},
"kopytko.casing.exact": {
"type": "object",
"default": {},
"markdownDescription": "Per-identifier casing overrides applied after all other casing rules. Keys are identifier names (case-insensitive), values are the exact output string.\n\n**Example:**\n```json\n{\n \"invalid\": \"Invalid\",\n \"getglobalaa\": \"GetGlobalAA\"\n}\n```"
},
"kopytko.format.indentSize": {
"type": "integer",
"default": 4,
"minimum": 1,
"maximum": 8,
"description": "Number of spaces per indentation level used by the BrightScript formatter."
},
"kopytko.format.useTabs": {
"type": "boolean",
"default": false,
"description": "Use tabs instead of spaces for indentation."
},
"kopytko.format.lineEnding": {
"type": "string",
"enum": [
"lf",
"crlf",
"auto"
],
"default": "auto",
"description": "Line ending style. 'auto' preserves the document's existing endings."
},
"kopytko.format.trimTrailingWhitespace": {
"type": "boolean",
"default": true,
"description": "Remove trailing whitespace from lines."
},
"kopytko.format.insertFinalNewline": {
"type": "boolean",
"default": true,
"description": "Ensure the file ends with a newline."
},
"kopytko.format.maxEmptyLines": {
"type": "integer",
"default": 2,
"minimum": 0,
"description": "Maximum consecutive blank lines allowed. 0 = no limit."
},
"kopytko.format.emptyLinesBetweenFunctions": {
"type": "integer",
"default": 1,
"minimum": 0,
"description": "Number of blank lines to enforce between top-level function/sub declarations."
},
"kopytko.format.emptyLinesBetweenMethods": {
"type": "integer",
"default": 1,
"minimum": 0,
"description": "Number of blank lines between AA method definitions inside a builder function."
},
"kopytko.format.emptyLinesAtBlockBoundaries": {
"type": "string",
"enum": [
"strip",
"enforce",
"preserve"
],
"default": "preserve",
"description": "Blank lines at the start/end of blocks: 'strip' removes them, 'enforce' adds one."
},
"kopytko.format.endKeywordStyle": {
"type": "string",
"enum": [
"spaced",
"compact",
"preserve"
],
"default": "preserve",
"markdownDescription": "Compound end-keyword style: `spaced` = `end if`, `compact` = `endif`. Applies to endif, endfunction, endsub, endwhile, endfor, endtry."
},
"kopytko.format.thenStyle": {
"type": "string",
"enum": [
"always",
"never",
"multiline-only",
"singleline-only",
"preserve"
],
"default": "preserve",
"description": "Controls 'then' on if-lines."
},
"kopytko.format.functionVsSubForVoid": {
"type": "string",
"enum": [
"function",
"sub",
"allow-void",
"preserve"
],
"enumDescriptions": [
"Convert all void procedures to use function keyword",
"Convert all void procedures to use sub keyword (removes 'as Void')",
"Allow function() as Void — keep both function-with-Void and sub as valid styles",
"Leave as-is"
],
"default": "preserve",
"markdownDescription": "Controls function vs sub for void procedures.\n\n```brightscript\n' \"sub\": converts function foo() as Void → sub foo()\n' \"function\": converts sub foo() → function foo() as Void\n' \"allow-void\": preserves both sub foo() and function foo() as Void\n```"
},
"kopytko.format.spaceBeforeNamedFunctionParens": {
"type": "boolean",
"default": false,
"markdownDescription": "Space before `(` in named function/sub definitions.\n\n```brightscript\n' true: function doWork ()\n' false: function doWork()\n```"
},
"kopytko.format.spaceBeforeAnonymousFunctionParens": {
"type": "boolean",
"default": false,
"markdownDescription": "Space before `(` in anonymous function expressions.\n\n```brightscript\n' true: m.handler = function ()\n' false: m.handler = function()\n```"
},
"kopytko.format.spaceBeforeCallParens": {
"type": "boolean",
"default": false,
"markdownDescription": "Space before `(` in function calls.\n\n```brightscript\n' true: doWork ()\n' false: doWork()\n```"
},
"kopytko.format.spaceInsideParens": {
"type": "string",
"enum": [
"never",
"always"
],
"default": "never",
"description": "Spaces inside '()' in calls and definitions."
},
"kopytko.format.parenCommaSpacing": {
"type": "string",
"enum": [
"preserve",
"after",
"before",
"both",
"none"
],
"enumDescriptions": [
"Keep existing spacing around commas.",
"Space after comma only: `a(\"1\", \"2\")`.",
"Space before comma only: `a(\"1\" ,\"2\")`.",
"Space on both sides: `a(\"1\" , \"2\")`.",
"No spaces around commas: `a(\"1\",\"2\")`."
],
"default": "preserve",
"markdownDescription": "Spaces around commas separating arguments in function calls and parameters in function/sub definitions — `foo(a, b)` / `function foo(a, b)`. Applies to whichever `()` most immediately encloses the comma, independent of `associativeArrayCommaSpacing`/`arrayCommaSpacing` for `{}`/`[]` elsewhere on the same line. Only applies to commas on the same line as `(` and `)` — multi-line parameter/argument lists are not affected."
},
"kopytko.format.paramAlignmentStyle": {
"type": "string",
"enum": [
"indent",
"align-to-paren",
"preserve"
],
"default": "preserve",
"description": "Multi-line parameter alignment style."
},
"kopytko.format.maxLineLength": {
"type": "integer",
"default": 120,
"minimum": 0,
"markdownDescription": "Max line length before the formatter wraps long strings. `0` = no limit."
},
"kopytko.format.wrapLongStrings": {
"type": "string",
"enum": [
"preserve",
"plus",
"array-join"
],
"default": "preserve",
"markdownDescription": "How to break long string literals.\n\n- `plus`: break with `+` concatenation\n- `array-join`: break with `[..., ...].join(\"\")`"
},
"kopytko.format.associativeArrayBracketSpacing": {
"type": "boolean",
"default": true,
"markdownDescription": "Spaces inside `{}`: `{ key: value }` (true) vs `{key: value}` (false)."
},
"kopytko.format.associativeArrayCommaSpacing": {
"type": "string",
"enum": [
"preserve",
"after",
"before",
"both",
"none"
],
"enumDescriptions": [
"Keep existing spacing around commas.",
"Space after comma only: `{ a: 1, b: 2 }`.",
"Space before comma only: `{ a: 1 ,b: 2 }`.",
"Space on both sides: `{ a: 1 , b: 2 }`.",
"No spaces around commas: `{ a: 1,b: 2 }`."
],
"default": "preserve",
"markdownDescription": "Spaces around commas separating key-value pairs in inline associative arrays `{}`. Only applies to commas on the same line as `{` and `}` — multi-line AAs are not affected."
},
"kopytko.format.arrayCommaSpacing": {
"type": "string",
"enum": [
"preserve",
"after",
"before",
"both",
"none"
],
"enumDescriptions": [
"Keep existing spacing around commas.",
"Space after comma only: `[\"1\", \"2\"]`.",
"Space before comma only: `[\"1\" ,\"2\"]`.",
"Space on both sides: `[\"1\" , \"2\"]`.",
"No spaces around commas: `[\"1\",\"2\"]`."
],
"default": "preserve",
"markdownDescription": "Spaces around commas separating elements in inline arrays `[]`. Applies to whichever `[]` most immediately encloses the comma — independent of `associativeArrayCommaSpacing` for nested `{}` elements, e.g. in `[{a: 1}, {b: 2}]`. Only applies to commas on the same line as `[` and `]` — multi-line arrays are not affected."
},
"kopytko.format.trailingComma": {
"type": "string",
"enum": [
"never",
"always",
"multiline"
],
"default": "never",
"description": "Trailing comma after the last item in multi-line arrays and associative arrays."
},
"kopytko.format.arrayCommaStyle": {
"type": "string",
"enum": [
"always",
"never",
"preserve"
],
"default": "preserve",
"markdownDescription": "Comma separators in multi-line arrays. BrightScript allows omitting commas when items are on separate lines.\n\n```brightscript\n' \"always\":\narr = [\n 1,\n 2,\n 3,\n]\n\n' \"never\":\narr = [\n 1\n 2\n 3\n]\n```"
},
"kopytko.format.associativeArrayCommaStyle": {
"type": "string",
"enum": [
"always",
"never",
"preserve"
],
"default": "preserve",
"markdownDescription": "Comma separators in multi-line associative arrays. BrightScript allows omitting commas when entries are on separate lines.\n\n```brightscript\n' \"always\":\nobj = {\n name: \"foo\",\n value: 42,\n}\n\n' \"never\":\nobj = {\n name: \"foo\"\n value: 42\n}\n```"
},
"kopytko.format.associativeArraySingleLineThreshold": {
"type": "integer",
"default": 0,
"minimum": 0,
"description": "Max number of keys before forcing an AA to multi-line. 0 = no limit."
},
"kopytko.format.arraySplitOpenBracket": {
"type": "boolean",
"default": false,
"markdownDescription": "When `true`, splits `[{` onto separate lines in multi-item arrays for better readability.\n\n```brightscript\n' true:\nreturn [\n {\n name: \"Component\",\n },\n otherItem()\n]\n\n' false:\nreturn [{\n name: \"Component\",\n },\n otherItem()\n]\n```"
},
"kopytko.format.associativeArrayKeySortOrder": {
"type": "string",
"enum": [
"preserve",
"alphabetical"
],
"enumDescriptions": [
"Keep entries in the order they were written.",
"Sort entries alphabetically by key (quoted and unquoted keys sort identically)."
],
"default": "preserve",
"markdownDescription": "Sort assoc-array (`{ key: value }`) entries alphabetically by key. See `kopytko.format.sortPriorityKeys`/`kopytko.format.associativeArraySortPriorityKeys` to pin specific keys first."
},
"kopytko.format.sortPriorityKeys": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"markdownDescription": "Global default priority-key list used by every sort scope (assoc arrays, XML interface fields, Kopytko template props) unless that scope's own override list is non-empty. Keys listed here always sort first, in this order (only for keys actually present); everything else follows alphabetically.\n\n**Example:**\n```json\n[\"id\", \"width\", \"height\"]\n```"
},
"kopytko.format.associativeArraySortPriorityKeys": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"markdownDescription": "Priority-key override for plain assoc-array sorting (`associativeArrayKeySortOrder`). When empty, falls back to `kopytko.format.sortPriorityKeys`."
},
"kopytko.format.kopytkoTemplateKeyOrder": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"markdownDescription": "Top-level key order enforced on detected Kopytko UI template objects — assoc arrays shaped like `{ name, props, dynamicProps, children, events }`, where a `name` key plus an `id` key inside `props`/`dynamicProps` is required for detection. Applies regardless of `associativeArrayKeySortOrder`. Nested `props`/`dynamicProps`/`events` objects are always alphabetically sorted (see `kopytkoTemplatePropsSortPriorityKeys`); `children` (an array of nested template objects) is recursed into the same way.\n\n**Empty = feature disabled.** Example:\n```json\n[\"name\", \"props\", \"dynamicProps\", \"events\", \"children\"]\n```"
},
"kopytko.format.kopytkoTemplatePropsSortPriorityKeys": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"markdownDescription": "Priority-key override for the nested `props`/`dynamicProps`/`events` objects of a detected Kopytko template object. When empty, falls back to `kopytko.format.sortPriorityKeys`. Only has an effect when `kopytkoTemplateKeyOrder` is non-empty."
},
"kopytko.format.xmlInterfaceSortOrder": {
"type": "string",
"enum": [
"preserve",
"alphabetical"
],
"enumDescriptions": [
"Keep <field>/<function> entries in document order.",
"Sort entries alphabetically — fields by their `id` attribute, functions by their `name` attribute."
],
"default": "preserve",
"markdownDescription": "Sort `<field>`/`<function>` entries inside a SceneGraph `<interface>` block alphabetically. Works through *Format Document* on `.xml` component files, and via the `kopytko-format` CLI. See `kopytko.format.xmlInterfaceGroupOrder` for field/function grouping and `kopytko.format.xmlInterfaceSortPriorityKeys` for pinning specific fields/functions first."
},
"kopytko.format.xmlInterfaceGroupOrder": {
"type": "string",
"enum": [
"preserve",
"fields-first",
"functions-first"
],
"enumDescriptions": [
"Keep the original relative interleaving of <field> and <function> entries.",
"Group all <field> entries before any <function> entries.",
"Group all <function> entries before any <field> entries."
],
"default": "preserve",
"markdownDescription": "Relative grouping of `<field>` vs `<function>` entries inside a SceneGraph `<interface>` block."
},
"kopytko.format.xmlInterfaceSortPriorityKeys": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"markdownDescription": "Priority-key override for XML interface sorting — matched against each `<field>`'s `id` attribute or `<function>`'s `name` attribute. When empty, falls back to `kopytko.format.sortPriorityKeys`."
},
"kopytko.format.spaceAroundOperators": {
"type": "boolean",
"default": true,
"description": "Spaces around binary operators (+, -, *, /, <>, and, or, mod)."
},
"kopytko.format.spaceAroundAssignment": {
"type": "boolean",
"default": true,
"description": "Spaces around = in assignments."
},
"kopytko.format.unarySpacing": {
"type": "boolean",
"default": true,
"description": "Space after unary 'not'."
},
"kopytko.format.commentStyle": {
"type": "string",
"enum": [
"'",
"rem",
"preserve"
],
"default": "preserve",
"markdownDescription": "Normalize comment markers: `'` or `rem`, or preserve existing."
},
"kopytko.format.spaceAfterCommentMarker": {
"type": "boolean",
"default": true,
"markdownDescription": "Enforce space after `'` or `rem`: `' comment` vs `'comment`."
},
"kopytko.format.commentWidth": {
"type": "integer",
"default": 0,
"minimum": 0,
"description": "Max comment line length. 0 = no limit."
},
"kopytko.format.sortImports": {
"type": "boolean",
"default": false,
"description": "Sort @import statements alphabetically (module name first, then path)."
},
"kopytko.format.emptyLineAfterImports": {
"type": "boolean",
"default": false,
"description": "Insert blank line after the last @import line, before code starts."
},
"kopytko.format.emptyLineAfterFunctionOpen": {
"type": "boolean",
"default": false,
"description": "Insert empty line after function/sub opening line."
},
"kopytko.format.emptyLineBeforeFunctionClose": {
"type": "boolean",
"default": false,
"description": "Insert empty line before end function/sub."
},
"kopytko.format.emptyLineBeforeReturn": {
"type": [
"string",
"boolean"
],
"enum": [
"always",
"not-alone",
false
],
"enumDescriptions": [
"Always add an empty line before return",
"Add an empty line only when return is NOT the sole statement in a block",
"Do not enforce empty lines before return"
],
"default": false,
"markdownDescription": "Empty line before `return` statements. `not-alone` skips the empty line when `return` is the only statement in its block (e.g. a guard clause like `if x then return`)."
},
"kopytko.format.emptyLineBeforeComment": {
"type": "boolean",
"default": false,
"description": "Enforce empty line before stand-alone comment blocks."
},
"kopytko.format.parenthesisIfCase": {
"type": "string",
"enum": [
"preserve",
"always",
"never"
],
"default": "preserve",
"description": "Wrap if-condition in parentheses: 'always' adds them, 'never' removes them."
},
"kopytko.format.elseOnNewLine": {
"type": "boolean",
"default": true,
"description": "Place 'else' on its own line."
},
"kopytko.format.forLoopSpacing": {
"type": "boolean",
"default": true,
"description": "Enforce spaces around 'to' and 'step' in for loops."
},
"kopytko.format.printStatement": {
"type": "string",
"enum": [
"warn",
"remove",
"preserve"
],
"default": "preserve",
"description": "Flag or remove print debug statements."
},
"kopytko.format.lineCommentPosition": {
"type": "string",
"enum": [
"above",
"inline",
"preserve"
],
"default": "preserve",
"description": "Move trailing comments: 'above' puts them on the line above."
},
"kopytko.format.stringConcatStyle": {
"type": "string",
"enum": [
"preserve",
"plus",
"array-join"
],
"default": "preserve",
"markdownDescription": "Normalize string concatenation style.\n\n```brightscript\n' \"plus\":\nresult = \"hello\" + \" \" + \"world\"\n\n' \"array-join\":\nresult = [\"hello\", \" \", \"world\"].join(\"\")\n```"
},
"kopytko.format.observeFieldStyle": {
"type": "string",
"enum": [
"always-scoped",
"preserve"
],
"default": "preserve",
"markdownDescription": "Enforce `observeFieldScoped` over `observeField`. Using non-scoped `observeField` can cause memory leaks.\n\n```brightscript\n' \"always-scoped\": converts\nobserveField → observeFieldScoped\n```"
},
"kopytko.format.mPrefixStyle": {
"type": "string",
"enum": [
"dot",
"bracket",
"preserve"
],
"default": "preserve",
"markdownDescription": "Normalize `m`-prefix field access style.\n\n```brightscript\n' \"dot\":\nm.fieldName\nm.top.visible\n\n' \"bracket\":\nm[\"fieldName\"]\nm.top[\"visible\"]\n```"
},
"kopytko.format.alignAssignments": {
"type": "boolean",
"default": false,
"markdownDescription": "Align `=` signs in consecutive assignment lines.\n\n```brightscript\n' true:\nname = \"app\"\nversion = \"1.0\"\ncount = 42\n\n' false:\nname = \"app\"\nversion = \"1.0\"\ncount = 42\n```"
},
"kopytko.format.fieldAccessConsistency": {
"type": "string",
"enum": [
"dot",
"method",
"preserve"
],
"default": "preserve",
"markdownDescription": "Field access consistency on nodes.\n\n```brightscript\n' \"dot\": prefers dot notation\nm.top.visible = true\nvalue = m.top.id\n\n' \"method\": prefers getField/setField\nm.top.setField(\"visible\", true)\nvalue = m.top.getField(\"id\")\n```"
},
"kopytko.format.verifySyntax": {
"type": "boolean",
"default": true,
"description": "Verify that formatted output re-parses to an equivalent AST before applying it, catching formatter bugs. Disable only to debug or skip that safety check."
},
"kopytko.deviceDiscovery.enabled": {
"type": "boolean",
"default": true,
"description": "Enable automatic Roku device discovery via SSDP."
},
"kopytko.deviceDiscovery.scanTimeout": {
"type": "number",
"default": 5000,
"description": "Timeout in milliseconds for active SSDP device scans."
},
"kopytko.deviceDiscovery.showNotifications": {
"type": "boolean",
"default": true,
"description": "Show notification messages when devices come online or go offline."
},
"kopytko.console.defaultPort": {
"type": "number",
"enum": [