janus-llm 4.3.1__py3-none-any.whl → 4.3.5__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. janus/__init__.py +1 -1
  2. janus/__main__.py +1 -1
  3. janus/_tests/evaluator_tests/EvalReadMe.md +85 -0
  4. janus/_tests/evaluator_tests/incose_tests/incose_large_test.json +39 -0
  5. janus/_tests/evaluator_tests/incose_tests/incose_small_test.json +17 -0
  6. janus/_tests/evaluator_tests/inline_comment_tests/mumps_inline_comment_test.m +71 -0
  7. janus/_tests/test_cli.py +3 -2
  8. janus/cli/aggregate.py +135 -0
  9. janus/cli/cli.py +111 -0
  10. janus/cli/constants.py +43 -0
  11. janus/cli/database.py +289 -0
  12. janus/cli/diagram.py +178 -0
  13. janus/cli/document.py +174 -0
  14. janus/cli/embedding.py +122 -0
  15. janus/cli/llm.py +187 -0
  16. janus/cli/partition.py +125 -0
  17. janus/cli/self_eval.py +149 -0
  18. janus/cli/translate.py +183 -0
  19. janus/converter/__init__.py +1 -1
  20. janus/converter/_tests/test_translate.py +2 -0
  21. janus/converter/converter.py +129 -93
  22. janus/converter/document.py +21 -14
  23. janus/converter/evaluate.py +20 -13
  24. janus/converter/translate.py +3 -3
  25. janus/embedding/collections.py +1 -1
  26. janus/language/alc/_tests/alc.asm +3779 -0
  27. janus/language/binary/_tests/hello.bin +0 -0
  28. janus/language/block.py +47 -12
  29. janus/language/file.py +1 -1
  30. janus/language/mumps/_tests/mumps.m +235 -0
  31. janus/language/treesitter/_tests/languages/fortran.f90 +416 -0
  32. janus/language/treesitter/_tests/languages/ibmhlasm.asm +16 -0
  33. janus/language/treesitter/_tests/languages/matlab.m +225 -0
  34. janus/llm/models_info.py +9 -1
  35. janus/metrics/_tests/asm_test_file.asm +10 -0
  36. janus/metrics/_tests/mumps_test_file.m +6 -0
  37. janus/metrics/_tests/test_treesitter_metrics.py +1 -1
  38. janus/metrics/prompts/clarity.txt +8 -0
  39. janus/metrics/prompts/completeness.txt +16 -0
  40. janus/metrics/prompts/faithfulness.txt +10 -0
  41. janus/metrics/prompts/hallucination.txt +16 -0
  42. janus/metrics/prompts/quality.txt +8 -0
  43. janus/metrics/prompts/readability.txt +16 -0
  44. janus/metrics/prompts/usefulness.txt +16 -0
  45. janus/parsers/code_parser.py +4 -4
  46. janus/parsers/doc_parser.py +12 -9
  47. janus/parsers/parser.py +7 -0
  48. janus/parsers/partition_parser.py +6 -4
  49. janus/parsers/reqs_parser.py +8 -5
  50. janus/parsers/uml.py +5 -4
  51. janus/prompts/prompt.py +2 -2
  52. janus/prompts/templates/README.md +30 -0
  53. janus/prompts/templates/basic_aggregation/human.txt +6 -0
  54. janus/prompts/templates/basic_aggregation/system.txt +1 -0
  55. janus/prompts/templates/basic_refinement/human.txt +14 -0
  56. janus/prompts/templates/basic_refinement/system.txt +1 -0
  57. janus/prompts/templates/diagram/human.txt +9 -0
  58. janus/prompts/templates/diagram/system.txt +1 -0
  59. janus/prompts/templates/diagram_with_documentation/human.txt +15 -0
  60. janus/prompts/templates/diagram_with_documentation/system.txt +1 -0
  61. janus/prompts/templates/document/human.txt +10 -0
  62. janus/prompts/templates/document/system.txt +1 -0
  63. janus/prompts/templates/document_cloze/human.txt +11 -0
  64. janus/prompts/templates/document_cloze/system.txt +1 -0
  65. janus/prompts/templates/document_cloze/variables.json +4 -0
  66. janus/prompts/templates/document_cloze/variables_asm.json +4 -0
  67. janus/prompts/templates/document_inline/human.txt +13 -0
  68. janus/prompts/templates/eval_prompts/incose/human.txt +32 -0
  69. janus/prompts/templates/eval_prompts/incose/system.txt +1 -0
  70. janus/prompts/templates/eval_prompts/incose/variables.json +3 -0
  71. janus/prompts/templates/eval_prompts/inline_comments/human.txt +49 -0
  72. janus/prompts/templates/eval_prompts/inline_comments/system.txt +1 -0
  73. janus/prompts/templates/eval_prompts/inline_comments/variables.json +3 -0
  74. janus/prompts/templates/micromanaged_mumps_v1.0/human.txt +23 -0
  75. janus/prompts/templates/micromanaged_mumps_v1.0/system.txt +3 -0
  76. janus/prompts/templates/micromanaged_mumps_v2.0/human.txt +28 -0
  77. janus/prompts/templates/micromanaged_mumps_v2.0/system.txt +3 -0
  78. janus/prompts/templates/micromanaged_mumps_v2.1/human.txt +29 -0
  79. janus/prompts/templates/micromanaged_mumps_v2.1/system.txt +3 -0
  80. janus/prompts/templates/multidocument/human.txt +15 -0
  81. janus/prompts/templates/multidocument/system.txt +1 -0
  82. janus/prompts/templates/partition/human.txt +22 -0
  83. janus/prompts/templates/partition/system.txt +1 -0
  84. janus/prompts/templates/partition/variables.json +4 -0
  85. janus/prompts/templates/pseudocode/human.txt +7 -0
  86. janus/prompts/templates/pseudocode/system.txt +7 -0
  87. janus/prompts/templates/refinement/fix_exceptions/human.txt +19 -0
  88. janus/prompts/templates/refinement/fix_exceptions/system.txt +1 -0
  89. janus/prompts/templates/refinement/format/code_format/human.txt +12 -0
  90. janus/prompts/templates/refinement/format/code_format/system.txt +1 -0
  91. janus/prompts/templates/refinement/format/requirements_format/human.txt +14 -0
  92. janus/prompts/templates/refinement/format/requirements_format/system.txt +1 -0
  93. janus/prompts/templates/refinement/hallucination/human.txt +13 -0
  94. janus/prompts/templates/refinement/hallucination/system.txt +1 -0
  95. janus/prompts/templates/refinement/reflection/human.txt +15 -0
  96. janus/prompts/templates/refinement/reflection/incose/human.txt +26 -0
  97. janus/prompts/templates/refinement/reflection/incose/system.txt +1 -0
  98. janus/prompts/templates/refinement/reflection/incose_deduplicate/human.txt +16 -0
  99. janus/prompts/templates/refinement/reflection/incose_deduplicate/system.txt +1 -0
  100. janus/prompts/templates/refinement/reflection/system.txt +1 -0
  101. janus/prompts/templates/refinement/revision/human.txt +16 -0
  102. janus/prompts/templates/refinement/revision/incose/human.txt +16 -0
  103. janus/prompts/templates/refinement/revision/incose/system.txt +1 -0
  104. janus/prompts/templates/refinement/revision/incose_deduplicate/human.txt +17 -0
  105. janus/prompts/templates/refinement/revision/incose_deduplicate/system.txt +1 -0
  106. janus/prompts/templates/refinement/revision/system.txt +1 -0
  107. janus/prompts/templates/refinement/uml/alc_fix_variables/human.txt +15 -0
  108. janus/prompts/templates/refinement/uml/alc_fix_variables/system.txt +2 -0
  109. janus/prompts/templates/refinement/uml/fix_connections/human.txt +15 -0
  110. janus/prompts/templates/refinement/uml/fix_connections/system.txt +2 -0
  111. janus/prompts/templates/requirements/human.txt +13 -0
  112. janus/prompts/templates/requirements/system.txt +2 -0
  113. janus/prompts/templates/retrieval/language_docs/human.txt +10 -0
  114. janus/prompts/templates/retrieval/language_docs/system.txt +1 -0
  115. janus/prompts/templates/simple/human.txt +16 -0
  116. janus/prompts/templates/simple/system.txt +3 -0
  117. janus/refiners/format.py +49 -0
  118. janus/refiners/refiner.py +113 -4
  119. janus/utils/enums.py +127 -112
  120. janus/utils/logger.py +2 -0
  121. {janus_llm-4.3.1.dist-info → janus_llm-4.3.5.dist-info}/METADATA +7 -7
  122. janus_llm-4.3.5.dist-info/RECORD +210 -0
  123. {janus_llm-4.3.1.dist-info → janus_llm-4.3.5.dist-info}/WHEEL +1 -1
  124. janus_llm-4.3.5.dist-info/entry_points.txt +3 -0
  125. janus/cli.py +0 -1488
  126. janus_llm-4.3.1.dist-info/RECORD +0 -115
  127. janus_llm-4.3.1.dist-info/entry_points.txt +0 -3
  128. {janus_llm-4.3.1.dist-info → janus_llm-4.3.5.dist-info}/LICENSE +0 -0
janus/utils/enums.py CHANGED
@@ -12,52 +12,59 @@ class EmbeddingType(Enum):
12
12
 
13
13
  CUSTOM_SPLITTERS: Set[str] = {"mumps", "binary", "ibmhlasm"}
14
14
 
15
+ # NOTE: When adding a new language, make sure to update the LANGUAGES dict below.
16
+ # - The `comment` key is the single-line comment character used in the language.
17
+ # - The `suffixes` key is a list of file suffixes for the language. The first suffix will
18
+ # be used as the default file extension when translating to that language.
19
+ # - The `url` key is the URL to the tree-sitter grammar for the language.
20
+ # - The `example` key is an example of code in the language.
21
+
15
22
  LANGUAGES: Dict[str, Dict[str, Any]] = {
16
23
  "ada": {
17
24
  "comment": "--",
18
- "suffix": "adb",
25
+ "suffixes": ["adb", "ads"],
19
26
  "url": "https://github.com/briot/tree-sitter-ada",
20
27
  "example": 'put_line("Hello, World!");\n',
21
28
  },
22
29
  "agda": {
23
30
  "comment": "--",
24
- "suffix": "agda",
31
+ "suffixes": ["agda"],
25
32
  "url": "https://github.com/tree-sitter/tree-sitter-agda",
26
33
  "example": 'postulate HelloWorld : String;\nHelloWorld = "Hello, World!";\n',
27
34
  },
28
35
  "x86asm": {
29
36
  "comment": "//",
30
- "suffix": "s",
37
+ "suffixes": ["asm", "s"],
31
38
  "url": "https://github.com/bearcove/tree-sitter-x86asm",
32
39
  "example": "mov rax, 60\nxor rdi, rdi\n",
33
40
  },
34
41
  "bash": {
35
42
  "comment": "#",
36
- "suffix": "sh",
43
+ "suffixes": ["sh", "bash"],
37
44
  "url": "https://github.com/tree-sitter/tree-sitter-bash",
38
45
  "example": 'echo "Hello world"\n',
39
46
  },
40
47
  "binary": {
41
48
  "comment": None,
42
- "suffix": "bin",
49
+ "suffixes": ["bin"],
43
50
  "url": "https://github.com/tree-sitter/tree-sitter-c",
44
51
  "example": "04 00 00 00 cd 48 65 6c 6c 6f 2c 20 77 6f 72 6c 64",
45
52
  },
46
53
  "beancount": {
47
54
  "comment": ";",
48
- "suffix": "beancount",
55
+ "suffixes": ["beancount"],
49
56
  "url": "https://github.com/zwpaper/tree-sitter-beancount",
50
57
  "example": '2023-01-01 custom "Hello, World!"\n',
51
58
  },
52
59
  "bigquery": {
53
60
  "comment": "--",
54
- "suffix": "sql",
61
+ "suffixes": ["bq", "sql"],
55
62
  "url": "https://github.com/takegue/tree-sitter-sql-bigquery",
56
63
  "example": 'SELECT "Hello, World!" AS message;\n',
57
64
  },
58
65
  "c": {
59
66
  "comment": "//",
60
- "suffix": "c",
67
+ "suffixes": ["c", "h"],
61
68
  "url": "https://github.com/tree-sitter/tree-sitter-c",
62
69
  "example": (
63
70
  '#include <stdio.h>\n\nint main() {\n printf("Hello, World!\\n");\n'
@@ -68,7 +75,7 @@ LANGUAGES: Dict[str, Dict[str, Any]] = {
68
75
  },
69
76
  "capnp": {
70
77
  "comment": "#",
71
- "suffix": "capnp",
78
+ "suffixes": ["capnp"],
72
79
  "url": "https://github.com/amaanq/tree-sitter-capnp",
73
80
  "example": (
74
81
  "using Capnp;\n\nstruct HelloWorld @0x1234 {\n greeting @0 :Text;\n}\n"
@@ -76,7 +83,7 @@ LANGUAGES: Dict[str, Dict[str, Any]] = {
76
83
  },
77
84
  "cmake": {
78
85
  "comment": "#",
79
- "suffix": "cmake",
86
+ "suffixes": ["cmake", "CMakeLists.txt"],
80
87
  "url": "https://github.com/uyha/tree-sitter-cmake",
81
88
  "example": (
82
89
  "cmake_minimum_required(VERSION 3.0)\nproject(HelloWorld)\n\n"
@@ -85,13 +92,13 @@ LANGUAGES: Dict[str, Dict[str, Any]] = {
85
92
  },
86
93
  "comment": {
87
94
  "comment": "#",
88
- "suffix": "comment",
95
+ "suffixes": ["comment"],
89
96
  "url": "https://github.com/stsewd/tree-sitter-comment",
90
97
  "example": "# This is a comment\n",
91
98
  },
92
99
  "cobol": {
93
100
  "comment": "*",
94
- "suffix": "cbl",
101
+ "suffixes": ["cob", "cbl", "cpy"],
95
102
  "url": "https://github.com/yutaro-sakamoto/tree-sitter-cobol",
96
103
  "example": (
97
104
  " IDENTIFICATION DIVISION.\n"
@@ -105,13 +112,13 @@ LANGUAGES: Dict[str, Dict[str, Any]] = {
105
112
  },
106
113
  "commonlisp": {
107
114
  "comment": ";;",
108
- "suffix": "lisp",
115
+ "suffixes": ["lisp", "lsp", "cl"],
109
116
  "url": "https://github.com/theHamsta/tree-sitter-commonlisp",
110
117
  "example": '(format t "Hello, World!~%")\n',
111
118
  },
112
119
  "config": {
113
120
  "comment": "#",
114
- "suffix": None,
121
+ "suffixes": ["conf", "ini", "cfg"],
115
122
  "url": "https://github.com/metio/tree-sitter-ssh-client-config",
116
123
  "example": (
117
124
  "# Configuration for SSH Client\nHost my_server\n"
@@ -120,13 +127,13 @@ LANGUAGES: Dict[str, Dict[str, Any]] = {
120
127
  },
121
128
  "css": {
122
129
  "comment": "/*",
123
- "suffix": "css",
130
+ "suffixes": ["css"],
124
131
  "url": "https://github.com/tree-sitter/tree-sitter-css",
125
132
  "example": 'body {\n content: "Hello, World!";\n}\n',
126
133
  },
127
134
  "cuda": {
128
135
  "comment": "//",
129
- "suffix": "cu",
136
+ "suffixes": ["cu", "cuh"],
130
137
  "url": "https://github.com/theHamsta/tree-sitter-cuda",
131
138
  "example": (
132
139
  '#include <iostream>\n\n__global__ void hello() {\n printf("Hello, '
@@ -136,7 +143,7 @@ LANGUAGES: Dict[str, Dict[str, Any]] = {
136
143
  },
137
144
  "d": {
138
145
  "comment": "//",
139
- "suffix": "d",
146
+ "suffixes": ["d"],
140
147
  "url": "https://github.com/gdamore/tree-sitter-d",
141
148
  "example": (
142
149
  'import std.stdio;\n\nvoid main() {\n writeln("Hello, World!");\n}\n'
@@ -144,37 +151,37 @@ LANGUAGES: Dict[str, Dict[str, Any]] = {
144
151
  },
145
152
  "dart": {
146
153
  "comment": "//",
147
- "suffix": "dart",
154
+ "suffixes": ["dart"],
148
155
  "url": "https://github.com/UserNobody14/tree-sitter-dart",
149
156
  "example": "void main() {\n print('Hello, World!');\n}\n",
150
157
  },
151
158
  "dockerfile": {
152
159
  "comment": "#",
153
- "suffix": "Dockerfile",
160
+ "suffixes": ["Dockerfile", "dockerfile"],
154
161
  "url": "https://github.com/camdencheek/tree-sitter-dockerfile",
155
162
  "example": "FROM ubuntu\n\nRUN echo 'Hello, World!'\n",
156
163
  },
157
164
  "dot": {
158
165
  "comment": "//",
159
- "suffix": "dot",
166
+ "suffixes": ["dot"],
160
167
  "url": "https://github.com/rydesun/tree-sitter-dot",
161
168
  "example": 'graph HelloWorld {\n label="Hello, World!"\n}\n',
162
169
  },
163
170
  "elisp": {
164
171
  "comment": ";;",
165
- "suffix": "el",
172
+ "suffixes": ["el"],
166
173
  "url": "https://github.com/Wilfred/tree-sitter-elisp",
167
174
  "example": '(message "Hello, World!")\n',
168
175
  },
169
176
  "elixir": {
170
177
  "comment": "#",
171
- "suffix": "ex",
178
+ "suffixes": ["ex", "exs"],
172
179
  "url": "https://github.com/elixir-lang/tree-sitter-elixir",
173
180
  "example": 'IO.puts "Hello, World!"\n',
174
181
  },
175
182
  "elm": {
176
183
  "comment": "--",
177
- "suffix": "elm",
184
+ "suffixes": ["elm"],
178
185
  "url": "https://github.com/elm-tooling/tree-sitter-elm",
179
186
  "example": (
180
187
  'import Browser\n\nmain = Browser.sandbox { init = "Hello, World!" }\n'
@@ -182,13 +189,13 @@ LANGUAGES: Dict[str, Dict[str, Any]] = {
182
189
  },
183
190
  "eno": {
184
191
  "comment": "#",
185
- "suffix": "eno",
192
+ "suffixes": ["eno"],
186
193
  "url": "https://github.com/eno-lang/tree-sitter-eno",
187
194
  "example": "message: Hello, World!\n",
188
195
  },
189
196
  "erlang": {
190
197
  "comment": "%",
191
- "suffix": "erl",
198
+ "suffixes": ["erl", "hrl"],
192
199
  "url": "https://github.com/WhatsApp/tree-sitter-erlang",
193
200
  "example": (
194
201
  "-module(hello).\n-export([world/0]).\n\nworld() ->\n"
@@ -197,25 +204,25 @@ LANGUAGES: Dict[str, Dict[str, Any]] = {
197
204
  },
198
205
  "fennel": {
199
206
  "comment": ";",
200
- "suffix": "fnl",
207
+ "suffixes": ["fnl"],
201
208
  "url": "https://github.com/travonted/tree-sitter-fennel",
202
209
  "example": '(print "Hello, World!")\n',
203
210
  },
204
211
  "fish": {
205
212
  "comment": "#",
206
- "suffix": "fish",
213
+ "suffixes": ["fish"],
207
214
  "url": "https://github.com/ram02z/tree-sitter-fish",
208
215
  "example": 'echo "Hello, World!"\n',
209
216
  },
210
217
  "formula": {
211
218
  "comment": ";",
212
- "suffix": "formula",
219
+ "suffixes": ["rb"],
213
220
  "url": "https://github.com/siraben/tree-sitter-formula",
214
221
  "example": "A1: Hello, World!\n",
215
222
  },
216
223
  "fortran": {
217
224
  "comment": "!",
218
- "suffix": "f90",
225
+ "suffixes": ["f90", "f95", "f77", "for"],
219
226
  "url": "https://github.com/stadelmanma/tree-sitter-fortran",
220
227
  "example": (
221
228
  "program HelloWorld\n print *, 'Hello, World!'\nend program HelloWorld\n"
@@ -225,31 +232,31 @@ LANGUAGES: Dict[str, Dict[str, Any]] = {
225
232
  },
226
233
  "gitattributes": {
227
234
  "comment": "#",
228
- "suffix": "gitattributes",
235
+ "suffixes": ["gitattributes"],
229
236
  "url": "https://github.com/ObserverOfTime/tree-sitter-gitattributes",
230
237
  "example": "* text=auto\n",
231
238
  },
232
239
  "gitignore": {
233
240
  "comment": "#",
234
- "suffix": "gitignore",
241
+ "suffixes": ["gitignore"],
235
242
  "url": "https://github.com/shunsambongi/tree-sitter-gitignore",
236
243
  "example": "*.log\n",
237
244
  },
238
245
  "gleam": {
239
246
  "comment": "//",
240
- "suffix": "gleam",
247
+ "suffixes": ["gleam"],
241
248
  "url": "https://github.com/gleam-lang/tree-sitter-gleam",
242
249
  "example": 'pub fn main() {\n io.print("Hello, World!")\n}\n',
243
250
  },
244
251
  "glsl": {
245
252
  "comment": "//",
246
- "suffix": "glsl",
253
+ "suffixes": ["glsl", "vert", "frag"],
247
254
  "url": "https://github.com/theHamsta/tree-sitter-glsl",
248
255
  "example": "void main() {\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\n}\n",
249
256
  },
250
257
  "go": {
251
258
  "comment": "//",
252
- "suffix": "go",
259
+ "suffixes": ["go"],
253
260
  "url": "https://github.com/tree-sitter/tree-sitter-go",
254
261
  "example": (
255
262
  'package main\n\nimport "fmt"\n\nfunc main() {\n'
@@ -258,31 +265,31 @@ LANGUAGES: Dict[str, Dict[str, Any]] = {
258
265
  },
259
266
  "graphql": {
260
267
  "comment": "#",
261
- "suffix": "graphql",
268
+ "suffixes": ["graphql", "gql"],
262
269
  "url": "https://github.com/bkegley/tree-sitter-graphql",
263
270
  "example": "query {\n hello\n}\n",
264
271
  },
265
272
  "hack": {
266
273
  "comment": "//",
267
- "suffix": "hack",
274
+ "suffixes": ["hack", "hhi"],
268
275
  "url": "https://github.com/slackhq/tree-sitter-hack",
269
276
  "example": '<?hh\n\necho "Hello, World!";\n',
270
277
  },
271
278
  "haskell": {
272
279
  "comment": "--",
273
- "suffix": "hs",
280
+ "suffixes": ["hs", "lhs"],
274
281
  "url": "https://github.com/tree-sitter/tree-sitter-haskell",
275
282
  "example": 'main :: IO ()\nmain = putStrLn "Hello, World!"\n',
276
283
  },
277
284
  "hcl": {
278
285
  "comment": "#",
279
- "suffix": "hcl",
286
+ "suffixes": ["hcl", "tf"],
280
287
  "url": "https://github.com/MichaHoffmann/tree-sitter-hcl",
281
288
  "example": 'variable "message" {\n default = "Hello, World!"\n}\n',
282
289
  },
283
290
  "html": {
284
291
  "comment": "<!--",
285
- "suffix": "html",
292
+ "suffixes": ["html", "htm"],
286
293
  "url": "https://github.com/tree-sitter/tree-sitter-html",
287
294
  "example": (
288
295
  "<html>\n<head>\n <title>Hello, World!</title>\n</head>\n<body>\n <h1>Hello"
@@ -291,7 +298,7 @@ LANGUAGES: Dict[str, Dict[str, Any]] = {
291
298
  },
292
299
  "ibmhlasm": {
293
300
  "comment": "*",
294
- "suffix": "asm",
301
+ "suffixes": ["asm"],
295
302
  "url": "https://github.com/janus-llm/tree-sitter-ibmhlasm.git",
296
303
  "branch": "metrics",
297
304
  "example": (
@@ -321,7 +328,7 @@ LANGUAGES: Dict[str, Dict[str, Any]] = {
321
328
  },
322
329
  "java": {
323
330
  "comment": "//",
324
- "suffix": "java",
331
+ "suffixes": ["java"],
325
332
  "url": "https://github.com/tree-sitter/tree-sitter-java",
326
333
  "example": (
327
334
  "public class HelloWorld {\n public static void main(String[] args) {\n"
@@ -330,43 +337,43 @@ LANGUAGES: Dict[str, Dict[str, Any]] = {
330
337
  },
331
338
  "javascript": {
332
339
  "comment": "//",
333
- "suffix": "js",
340
+ "suffixes": ["js", "mjs", "cjs"],
334
341
  "url": "https://github.com/tree-sitter/tree-sitter-javascript",
335
342
  "example": "console.log('Hello, World!');\n",
336
343
  },
337
344
  "jq": {
338
345
  "comment": "#",
339
- "suffix": "jq",
346
+ "suffixes": ["jq"],
340
347
  "url": "https://github.com/flurie/tree-sitter-jq",
341
348
  "example": ".\n",
342
349
  },
343
350
  "json": {
344
351
  "comment": "//",
345
- "suffix": "json",
352
+ "suffixes": ["json"],
346
353
  "url": "https://github.com/tree-sitter/tree-sitter-json",
347
354
  "example": '{\n "message": "Hello, World!"\n}\n',
348
355
  },
349
356
  "json5": {
350
357
  "comment": "//",
351
- "suffix": "json5",
358
+ "suffixes": ["json5"],
352
359
  "url": "https://github.com/Joakker/tree-sitter-json5",
353
360
  "example": "{\n message: 'Hello, World!'\n}\n",
354
361
  },
355
362
  "julia": {
356
363
  "comment": "#",
357
- "suffix": "jl",
364
+ "suffixes": ["jl"],
358
365
  "url": "https://github.com/tree-sitter/tree-sitter-julia",
359
366
  "example": 'println("Hello, World!")\n',
360
367
  },
361
368
  "kotlin": {
362
369
  "comment": "//",
363
- "suffix": "kt",
370
+ "suffixes": ["kt", "kts"],
364
371
  "url": "https://github.com/fwcd/tree-sitter-kotlin",
365
372
  "example": 'fun main() {\n println("Hello, World!")\n}\n',
366
373
  },
367
374
  "lalrpop": {
368
375
  "comment": "//",
369
- "suffix": "lalrpop",
376
+ "suffixes": ["lalrpop"],
370
377
  "url": "https://github.com/traxys/tree-sitter-lalrpop",
371
378
  "example": (
372
379
  "grammar Hello {\n extern {\n fn print(s: &str);\n }\n\n"
@@ -376,7 +383,7 @@ LANGUAGES: Dict[str, Dict[str, Any]] = {
376
383
  },
377
384
  "latex": {
378
385
  "comment": "%",
379
- "suffix": "tex",
386
+ "suffixes": ["tex", "sty", "cls"],
380
387
  "url": "https://github.com/latex-lsp/tree-sitter-latex",
381
388
  "example": (
382
389
  "\\documentclass{article}\n\\begin{document}\n Hello, "
@@ -385,13 +392,13 @@ LANGUAGES: Dict[str, Dict[str, Any]] = {
385
392
  },
386
393
  "lean": {
387
394
  "comment": "--",
388
- "suffix": "lean",
395
+ "suffixes": ["lean"],
389
396
  "url": "https://github.com/Julian/tree-sitter-lean",
390
397
  "example": 'def main : io io.unit := io.put_str_ln "Hello, World!"\n',
391
398
  },
392
399
  "llvm": {
393
400
  "comment": ";",
394
- "suffix": "ll",
401
+ "suffixes": ["ll"],
395
402
  "url": "https://github.com/benwilliamgraham/tree-sitter-llvm",
396
403
  "example": (
397
404
  "; ModuleID = 'hello.ll'\n\ndefine void @main() {\nentry:\n call void "
@@ -402,37 +409,37 @@ LANGUAGES: Dict[str, Dict[str, Any]] = {
402
409
  },
403
410
  "lua": {
404
411
  "comment": "--",
405
- "suffix": "lua",
412
+ "suffixes": ["lua"],
406
413
  "url": "https://github.com/Azganoth/tree-sitter-lua",
407
414
  "example": 'print("Hello, World!")\n',
408
415
  },
409
416
  "m68k": {
410
417
  "comment": ";",
411
- "suffix": "m68k",
418
+ "suffixes": ["asm"],
412
419
  "url": "https://github.com/grahambates/tree-sitter-m68k",
413
420
  "example": "moveq #0,d0\n",
414
421
  },
415
422
  "markdown": {
416
423
  "comment": "<!--",
417
- "suffix": "md",
424
+ "suffixes": ["md", "markdown"],
418
425
  "url": "https://github.com/ikatyang/tree-sitter-markdown",
419
426
  "example": "# Hello, World!\n\nThis is a Markdown document.\n",
420
427
  },
421
428
  "matlab": {
422
429
  "comment": "%",
423
- "suffix": "m",
430
+ "suffixes": ["m"],
424
431
  "url": "https://github.com/acristoffers/tree-sitter-matlab",
425
432
  "example": "fprintf('Hello, World!\\n');\n",
426
433
  },
427
434
  "meson": {
428
435
  "comment": "#",
429
- "suffix": "meson",
436
+ "suffixes": ["meson.build"],
430
437
  "url": "https://github.com/staysail/tree-sitter-meson",
431
438
  "example": "project('hello', 'c')\n\nexecutable('hello', 'hello.c')\n",
432
439
  },
433
440
  "mumps": {
434
441
  "comment": ";",
435
- "suffix": "m",
442
+ "suffixes": ["m", "mps"],
436
443
  "url": "https://github.com/janus-llm/tree-sitter-mumps",
437
444
  "example": 'WRITE "Hello, World!"',
438
445
  "functional_node_types": ["routine_definition"],
@@ -448,13 +455,13 @@ LANGUAGES: Dict[str, Dict[str, Any]] = {
448
455
  },
449
456
  "nix": {
450
457
  "comment": "#",
451
- "suffix": "nix",
458
+ "suffixes": ["nix"],
452
459
  "url": "https://github.com/cstrahan/tree-sitter-nix",
453
460
  "example": '{ message = "Hello, World!"; }\n',
454
461
  },
455
462
  "objc": {
456
463
  "comment": "//",
457
- "suffix": "m",
464
+ "suffixes": ["m", "mm", "h"],
458
465
  "url": "https://github.com/jiyee/tree-sitter-objc",
459
466
  "example": (
460
467
  "#import <Foundation/Foundation.h>\n\nint main() {\n "
@@ -464,67 +471,67 @@ LANGUAGES: Dict[str, Dict[str, Any]] = {
464
471
  },
465
472
  "ocaml": {
466
473
  "comment": "(*",
467
- "suffix": "ml",
474
+ "suffixes": ["ml", "mli"],
468
475
  "url": "https://github.com/tree-sitter/tree-sitter-ocaml",
469
476
  "example": 'print_endline "Hello, World!";;\n',
470
477
  },
471
478
  "org": {
472
479
  "comment": "#",
473
- "suffix": "org",
480
+ "suffixes": ["org"],
474
481
  "url": "https://github.com/milisims/tree-sitter-org",
475
482
  "example": "#+TITLE: Hello, World!\n\nThis is an Org mode document.\n",
476
483
  },
477
484
  "pascal": {
478
485
  "comment": "//",
479
- "suffix": "pas",
486
+ "suffixes": ["pas", "pp", "p"],
480
487
  "url": "https://github.com/Isopod/tree-sitter-pascal",
481
488
  "example": "// Hello, World!\nWRITE 'Hello, World!'\n",
482
489
  },
483
490
  "perl": {
484
491
  "comment": "#",
485
- "suffix": "pl",
492
+ "suffixes": ["pl", "pm", "t"],
486
493
  "url": "https://github.com/tree-sitter-perl/tree-sitter-perl",
487
494
  "example": "# Hello, World!\nprint 'Hello, World!\\n';\n",
488
495
  },
489
496
  "pgn": {
490
497
  "comment": "%",
491
- "suffix": "pgn",
498
+ "suffixes": ["pgn"],
492
499
  "url": "https://github.com/rolandwalker/tree-sitter-pgn",
493
500
  "example": '% Hello, World!\nWRITE "Hello, World!"\n',
494
501
  },
495
502
  "php": {
496
503
  "comment": "#",
497
- "suffix": "php",
504
+ "suffixes": ["php", "php3", "php4", "phtml"],
498
505
  "url": "https://github.com/tree-sitter/tree-sitter-php",
499
506
  "example": "<?php\n// Hello, World!\necho 'Hello, World!';\n",
500
507
  },
501
508
  "pod": {
502
509
  "comment": "=",
503
- "suffix": "pod",
510
+ "suffixes": ["pod"],
504
511
  "url": "https://github.com/tree-sitter-perl/tree-sitter-pod",
505
512
  "example": "=head1 Hello, World!\n\nHello, World!\n\n=cut\n",
506
513
  },
507
514
  "powershell": {
508
515
  "comment": "#",
509
- "suffix": "ps1",
516
+ "suffixes": ["ps1", "psm1", "psd1"],
510
517
  "url": "https://github.com/PowerShell/tree-sitter-PowerShell",
511
518
  "example": "# Hello, World!\nWrite-Host 'Hello, World!'\n",
512
519
  },
513
520
  "proto": {
514
521
  "comment": "//",
515
- "suffix": "proto",
522
+ "suffixes": ["proto"],
516
523
  "url": "https://github.com/mitchellh/tree-sitter-proto",
517
524
  "example": "// Hello, World!\nmessage HelloWorld {\n string message = 1;\n}\n",
518
525
  },
519
526
  "pseudocode": {
520
527
  "comment": "",
521
- "suffix": "txt",
528
+ "suffixes": ["pseudo"],
522
529
  "url": "",
523
530
  "example": "print Hello, World!",
524
531
  },
525
532
  "python": {
526
533
  "comment": "#",
527
- "suffix": "py",
534
+ "suffixes": ["py", "pyi"],
528
535
  "url": "https://github.com/tree-sitter/tree-sitter-python",
529
536
  "example": "# Hello, World!\nprint('Hello, World!')\n",
530
537
  "functional_node_types": ["function_definition"],
@@ -532,7 +539,7 @@ LANGUAGES: Dict[str, Dict[str, Any]] = {
532
539
  },
533
540
  "qmljs": {
534
541
  "comment": "//",
535
- "suffix": "qml",
542
+ "suffixes": ["qml", "js"],
536
543
  "url": "https://github.com/yuja/tree-sitter-qmljs",
537
544
  "example": (
538
545
  "// Hello, World!\nimport QtQuick 2.0\n\nItem {\n Text { text: "
@@ -541,61 +548,61 @@ LANGUAGES: Dict[str, Dict[str, Any]] = {
541
548
  },
542
549
  "r": {
543
550
  "comment": "#",
544
- "suffix": "r",
551
+ "suffixes": ["r", "R"],
545
552
  "url": "https://github.com/r-lib/tree-sitter-r",
546
553
  "example": "# Hello, World!\nprint('Hello, World!')\n",
547
554
  },
548
555
  "racket": {
549
556
  "comment": ";;",
550
- "suffix": "rkt",
557
+ "suffixes": ["rkt", "rktl", "scm"],
551
558
  "url": "https://github.com/6cdh/tree-sitter-racket",
552
559
  "example": ';; Hello, World!\n(displayln "Hello, World!")\n',
553
560
  },
554
561
  "rasi": {
555
562
  "comment": "#",
556
- "suffix": "rasi",
563
+ "suffixes": ["rasi"],
557
564
  "url": "https://github.com/Fymyte/tree-sitter-rasi",
558
565
  "example": "# Hello, World!\nprint('Hello, World!')\n",
559
566
  },
560
567
  "re2c": {
561
568
  "comment": "//",
562
- "suffix": "re2c",
569
+ "suffixes": ["re"],
563
570
  "url": "https://github.com/alemuller/tree-sitter-re2c",
564
571
  "example": '// Hello, World!\n{printf("Hello, World!\\n");}',
565
572
  },
566
573
  "regex": {
567
574
  "comment": "#",
568
- "suffix": "regex",
575
+ "suffixes": ["regex"],
569
576
  "url": "https://github.com/tree-sitter/tree-sitter-regex",
570
577
  "example": "# Hello, World!\n# Match 'Hello, World!' with a regex\n",
571
578
  },
572
579
  "rego": {
573
580
  "comment": "#",
574
- "suffix": "rego",
581
+ "suffixes": ["rego"],
575
582
  "url": "https://github.com/FallenAngel97/tree-sitter-rego",
576
583
  "example": '# Hello, World!\npackage hello\n\nmain = {\n "Hello, World!"\n}\n',
577
584
  },
578
585
  "rst": {
579
586
  "comment": "..",
580
- "suffix": "rst",
587
+ "suffixes": ["rst"],
581
588
  "url": "https://github.com/stsewd/tree-sitter-rst",
582
589
  "example": ".. Hello, World!\n\nHello, World!\n",
583
590
  },
584
591
  "ruby": {
585
592
  "comment": "#",
586
- "suffix": "rb",
593
+ "suffixes": ["rb"],
587
594
  "url": "https://github.com/tree-sitter/tree-sitter-ruby",
588
595
  "example": "# Hello, World!\nputs 'Hello, World!'\n",
589
596
  },
590
597
  "rust": {
591
598
  "comment": "//",
592
- "suffix": "rs",
599
+ "suffixes": ["rs"],
593
600
  "url": "https://github.com/tree-sitter/tree-sitter-rust",
594
601
  "example": '// Hello, World!\nfn main() {\n println!("Hello, World!");\n}\n',
595
602
  },
596
603
  "scala": {
597
604
  "comment": "//",
598
- "suffix": "scala",
605
+ "suffixes": ["scala"],
599
606
  "url": "https://github.com/tree-sitter/tree-sitter-scala",
600
607
  "example": (
601
608
  "// Hello, World!\nobject HelloWorld {\n def main(args: "
@@ -604,25 +611,25 @@ LANGUAGES: Dict[str, Dict[str, Any]] = {
604
611
  },
605
612
  "scheme": {
606
613
  "comment": ";;",
607
- "suffix": "scm",
614
+ "suffixes": ["scm", "ss"],
608
615
  "url": "https://github.com/6cdh/tree-sitter-scheme",
609
616
  "example": ';; Hello, World!\n(displayln "Hello, World!")\n',
610
617
  },
611
618
  "scss": {
612
619
  "comment": "//",
613
- "suffix": "scss",
620
+ "suffixes": ["scss"],
614
621
  "url": "https://github.com/serenadeai/tree-sitter-scss",
615
622
  "example": "// Hello, World!\n$variable: 'Hello, World!';\n",
616
623
  },
617
624
  "sexp": {
618
625
  "comment": ";",
619
- "suffix": "sexp",
626
+ "suffixes": ["sexp"],
620
627
  "url": "https://github.com/AbstractMachinesLab/tree-sitter-sexp",
621
628
  "example": '; Hello, World!\n(println "Hello, World!")\n',
622
629
  },
623
630
  "sfapex": {
624
631
  "comment": "//",
625
- "suffix": "cls",
632
+ "suffixes": ["cls"],
626
633
  "url": "https://github.com/aheber/tree-sitter-sfapex",
627
634
  "example": (
628
635
  "// Hello, World!\npublic class HelloWorld {\n public static void "
@@ -632,7 +639,7 @@ LANGUAGES: Dict[str, Dict[str, Any]] = {
632
639
  },
633
640
  "smali": {
634
641
  "comment": "#",
635
- "suffix": "smali",
642
+ "suffixes": ["smali"],
636
643
  "url": "https://github.com/amaanq/tree-sitter-smali",
637
644
  "example": (
638
645
  ".class public LHelloWorld;\n.super Ljava/lang/Object;\n\n.method "
@@ -645,7 +652,7 @@ LANGUAGES: Dict[str, Dict[str, Any]] = {
645
652
  },
646
653
  "sourcepawn": {
647
654
  "comment": "//",
648
- "suffix": "sp",
655
+ "suffixes": ["sp"],
649
656
  "url": "https://github.com/nilshelmig/tree-sitter-sourcepawn",
650
657
  "example": (
651
658
  "#include <sourcemod>\n\npublic Plugin:myinfo = \n{\n name = "
@@ -656,37 +663,37 @@ LANGUAGES: Dict[str, Dict[str, Any]] = {
656
663
  },
657
664
  "sparql": {
658
665
  "comment": "#",
659
- "suffix": "sparql",
666
+ "suffixes": ["sparql", "rq"],
660
667
  "url": "https://github.com/BonaBeavis/tree-sitter-sparql",
661
668
  "example": 'SELECT "Hello, World!"',
662
669
  },
663
670
  "sql": {
664
671
  "comment": "--",
665
- "suffix": "sql",
672
+ "suffixes": ["sql"],
666
673
  "url": "https://github.com/m-novikov/tree-sitter-sql",
667
674
  "example": "SELECT 'Hello, World!';",
668
675
  },
669
676
  "sqlite": {
670
677
  "comment": "--",
671
- "suffix": "sqlite",
678
+ "suffixes": ["sqlite", "db"],
672
679
  "url": "https://github.com/dhcmrlchtdj/tree-sitter-sqlite",
673
680
  "example": "SELECT 'Hello, World!';",
674
681
  },
675
682
  "svelte": {
676
683
  "comment": "<!--",
677
- "suffix": "svelte",
684
+ "suffixes": ["svelte"],
678
685
  "url": "https://github.com/Himujjal/tree-sitter-svelte",
679
686
  "example": "<script>\n console.log('Hello, World!');\n</script>\n",
680
687
  },
681
688
  "swift": {
682
689
  "comment": "//",
683
- "suffix": "swift",
690
+ "suffixes": ["swift"],
684
691
  "url": "https://github.com/alex-pinkus/tree-sitter-swift",
685
692
  "example": 'print("Hello, World!")\n',
686
693
  },
687
694
  "systemrdl": {
688
695
  "comment": "//",
689
- "suffix": "systemrdl",
696
+ "suffixes": ["rdl"],
690
697
  "url": "https://github.com/SystemRDL/tree-sitter-systemrdl",
691
698
  "example": (
692
699
  "address_space {\n reg my_register {\n address 0x0;\n "
@@ -696,19 +703,19 @@ LANGUAGES: Dict[str, Dict[str, Any]] = {
696
703
  },
697
704
  "template": {
698
705
  "comment": "<%#",
699
- "suffix": "txt",
706
+ "suffixes": ["tpl", "template"],
700
707
  "url": "https://github.com/tree-sitter/tree-sitter-embedded-template",
701
708
  "example": "<%# Hello, World! %>\nHello, World!\n",
702
709
  },
703
710
  "text": {
704
711
  "comment": "",
705
- "suffix": "txt",
712
+ "suffixes": ["txt"],
706
713
  "url": None,
707
714
  "example": "Hello, World!",
708
715
  },
709
716
  "thrift": {
710
717
  "comment": "//",
711
- "suffix": "thrift",
718
+ "suffixes": ["thrift"],
712
719
  "url": "https://github.com/duskmoon314/tree-sitter-thrift",
713
720
  "example": (
714
721
  "namespace py tutorial\n\nconst string HELLO_URL = "
@@ -719,13 +726,13 @@ LANGUAGES: Dict[str, Dict[str, Any]] = {
719
726
  },
720
727
  "toml": {
721
728
  "comment": "#",
722
- "suffix": "toml",
729
+ "suffixes": ["toml"],
723
730
  "url": "https://github.com/ikatyang/tree-sitter-toml",
724
731
  "example": 'message = "Hello, World!"\n',
725
732
  },
726
733
  "turtle": {
727
734
  "comment": "#",
728
- "suffix": "ttl",
735
+ "suffixes": ["ttl"],
729
736
  "url": "https://github.com/BonaBeavis/tree-sitter-turtle",
730
737
  "example": (
731
738
  "@prefix ex: <http://example.org/> .\n\nex:hello ex:message "
@@ -734,27 +741,29 @@ LANGUAGES: Dict[str, Dict[str, Any]] = {
734
741
  },
735
742
  "twig": {
736
743
  "comment": "{#",
737
- "suffix": "twig",
744
+ "suffixes": ["twig"],
738
745
  "url": "https://github.com/gbprod/tree-sitter-twig",
739
746
  "example": "{# Hello, World! #}\nHello, World!\n",
740
747
  },
741
748
  "typescript": {
742
749
  "comment": "//",
743
- "suffix": "ts",
750
+ "suffixes": ["ts", "tsx"],
744
751
  "url": "https://github.com/tree-sitter/tree-sitter-typescript",
745
752
  "example": "console.log('Hello, World!');\n",
746
753
  },
747
754
  "uml": {
748
755
  "comment": "'",
749
- "suffix": "uml",
756
+ "suffixes": ["uml"],
750
757
  "url": "https://github.com/lyndsysimon/tree-sitter-plantuml",
751
- "example": "@startuml\nAlice -> Bob: Authentication Request\nBob --> Alice:\
752
- Authentication Response\nAlice -> Bob: Another authentication\
753
- Request\nAlice <-- Bob: Another authentication Response\n@enduml",
758
+ "example": (
759
+ "@startuml\nAlice -> Bob: Authentication Request\nBob --> Alice: "
760
+ "Authentication Response\nAlice -> Bob: Another authentication Request\n"
761
+ "Alice <-- Bob: Another authentication Response\n@enduml"
762
+ ),
754
763
  },
755
764
  "verilog": {
756
765
  "comment": "//",
757
- "suffix": "v",
766
+ "suffixes": ["v", "vh"],
758
767
  "url": "https://github.com/tree-sitter/tree-sitter-verilog",
759
768
  "example": (
760
769
  "module HelloWorld;\n initial begin\n "
@@ -763,7 +772,7 @@ LANGUAGES: Dict[str, Dict[str, Any]] = {
763
772
  },
764
773
  "vhdl": {
765
774
  "comment": "--",
766
- "suffix": "vhdl",
775
+ "suffixes": ["vhdl", "vhd"],
767
776
  "url": "https://github.com/alemuller/tree-sitter-vhdl",
768
777
  "example": (
769
778
  "library IEEE;\nuse IEEE.STD_LOGIC_1164.ALL;\n\nentity "
@@ -774,13 +783,13 @@ LANGUAGES: Dict[str, Dict[str, Any]] = {
774
783
  },
775
784
  "vue": {
776
785
  "comment": "//",
777
- "suffix": "vue",
786
+ "suffixes": ["vue"],
778
787
  "url": "https://github.com/ikatyang/tree-sitter-vue",
779
788
  "example": "<template>\n <div>\n Hello, World!\n </div>\n</template>\n",
780
789
  },
781
790
  "wasm": {
782
791
  "comment": ";;",
783
- "suffix": "wasm",
792
+ "suffixes": ["wasm"],
784
793
  "url": "https://github.com/wasm-lsp/tree-sitter-wasm",
785
794
  "example": (
786
795
  '(module\n (func $main (export "main")\n (import "env" "puts" '
@@ -789,22 +798,28 @@ LANGUAGES: Dict[str, Dict[str, Any]] = {
789
798
  },
790
799
  "wgsl": {
791
800
  "comment": "//",
792
- "suffix": "wgsl",
801
+ "suffixes": ["wgsl"],
793
802
  "url": "https://github.com/mehmetoguzderin/tree-sitter-wgsl",
794
803
  "example": (
795
804
  "[[stage(fragment)]]\nfn main() -> [[builtin(position)]] "
796
805
  "vec4<f32> {\n return vec4<f32>(1.0, 0.0, 0.0, 1.0);\n}\n"
797
806
  ),
798
807
  },
808
+ "xml": {
809
+ "comment": "<!--",
810
+ "suffixes": ["xml"],
811
+ "url": "https://github.com/panicinc/tree-sitter-xml",
812
+ "example": ("<message>\n <text>Hello, World!</text>\n</message>\n"),
813
+ },
799
814
  "yaml": {
800
815
  "comment": "#",
801
- "suffix": "yaml",
816
+ "suffixes": ["yaml", "yml"],
802
817
  "url": "https://github.com/ikatyang/tree-sitter-yaml",
803
818
  "example": "message: Hello, World!\n",
804
819
  },
805
820
  "yang": {
806
821
  "comment": "//",
807
- "suffix": "yang",
822
+ "suffixes": ["yang"],
808
823
  "url": "https://github.com/Hubro/tree-sitter-yang",
809
824
  "example": (
810
825
  "module hello-world {\n yang-version 1.1;\n namespace "
@@ -815,7 +830,7 @@ LANGUAGES: Dict[str, Dict[str, Any]] = {
815
830
  },
816
831
  "zig": {
817
832
  "comment": ";",
818
- "suffix": "zig",
833
+ "suffixes": ["zig"],
819
834
  "url": "https://github.com/maxxnino/tree-sitter-zig",
820
835
  "example": (
821
836
  'const std = @import("std");\n\npub fn main() void {\n const '