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