tree_sitter_language_pack 1.8.1-aarch64-linux → 1.9.0.pre.rc.1-aarch64-linux
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/tree_sitter_language_pack/native.rb +2 -38
- data/lib/tree_sitter_language_pack/version.rb +2 -2
- data/lib/tree_sitter_language_pack.rb +1 -1
- data/lib/ts_pack_core_rb.so +0 -0
- data/sig/types.rbs +20 -209
- metadata +16 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 37ded7522def6ef0f3b74bd2136539ec971cbff1f7adff5835e7d84f08bfeeee
|
|
4
|
+
data.tar.gz: 82373efb5a45823b87bec5b8efe2a81a787c180d06ac43ffb3de4c75afd64ded
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 30202794edabfc3509f854e00dee6c741507fc4a188e9f542136845dd91124a68c7e2f1c24e4018f7132cd37a6811352a9554ef3d6b69e49898d58250c5f08b8
|
|
7
|
+
data.tar.gz: 3127462b66f4765eb2cce05671e85e71a7058bfb7931997ed648987c571bfa1d520c0d615b74992930a5b62e0c25fc490692e72c563370cbedce61f0fc870938
|
|
@@ -1,46 +1,10 @@
|
|
|
1
1
|
# This file is auto-generated by alef — DO NOT EDIT.
|
|
2
|
-
# alef:hash:
|
|
2
|
+
# alef:hash:7c2ad6574f6e1041a85475b2fb60302a621b00af3af9ae49ceacb610d7676405
|
|
3
3
|
# To regenerate: alef generate
|
|
4
4
|
# To verify freshness: alef verify --exit-code
|
|
5
5
|
# Issues & docs: https://github.com/kreuzberg-dev/alef
|
|
6
6
|
# frozen_string_literal: true
|
|
7
7
|
|
|
8
8
|
require 'json'
|
|
9
|
+
require 'sorbet-runtime'
|
|
9
10
|
require 'ts_pack_core_rb'
|
|
10
|
-
|
|
11
|
-
# Add accessor methods to Hash-based internally-tagged enum instances
|
|
12
|
-
class Hash
|
|
13
|
-
# Support internally-tagged enum accessors like format.excel, format.email, etc.
|
|
14
|
-
# Also support direct field access like format.sheet_count
|
|
15
|
-
# rubocop:disable Metrics/CyclomaticComplexity
|
|
16
|
-
def method_missing(method_name, *args, &)
|
|
17
|
-
# Try symbol key first (how Magnus converts JSON keys)
|
|
18
|
-
return self[method_name] if key?(method_name)
|
|
19
|
-
|
|
20
|
-
# Try string key
|
|
21
|
-
return self[method_name.to_s] if key?(method_name.to_s)
|
|
22
|
-
|
|
23
|
-
# Check if this hash has a 'format_type' field (indicating an internally-tagged enum)
|
|
24
|
-
format_type = self[:format_type] || self['format_type']
|
|
25
|
-
return super unless format_type
|
|
26
|
-
|
|
27
|
-
# If the method name matches the format_type (snake_case), extract and return the variant's wrapped data
|
|
28
|
-
# Internally-tagged enums store variant data in the '_0' field (from alef's struct variant conversion)
|
|
29
|
-
# This allows format.excel to return the ExcelMetadata hash with sheet_count, sheet_names, etc.
|
|
30
|
-
snake_case_method = method_name.to_s.downcase
|
|
31
|
-
return self[:_0] || self['_0'] || self if snake_case_method == format_type.to_s.downcase
|
|
32
|
-
|
|
33
|
-
super
|
|
34
|
-
end
|
|
35
|
-
# rubocop:enable Metrics/CyclomaticComplexity
|
|
36
|
-
|
|
37
|
-
def respond_to_missing?(method_name, include_private = false)
|
|
38
|
-
return true if key?(method_name) || key?(method_name.to_s)
|
|
39
|
-
|
|
40
|
-
format_type = self[:format_type] || self['format_type']
|
|
41
|
-
return false unless format_type
|
|
42
|
-
|
|
43
|
-
snake_case_method = method_name.to_s.downcase
|
|
44
|
-
snake_case_method == format_type.to_s.downcase || super
|
|
45
|
-
end
|
|
46
|
-
end
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# This file is auto-generated by alef — DO NOT EDIT.
|
|
2
|
-
# alef:hash:
|
|
2
|
+
# alef:hash:f59a823c8d8df1cdf7d69cf9c267cfb7bc2b517fae98b3ce9c6ad6705aa819a2
|
|
3
3
|
# To regenerate: alef generate
|
|
4
4
|
# To verify freshness: alef verify --exit-code
|
|
5
5
|
# Issues & docs: https://github.com/kreuzberg-dev/alef
|
|
6
6
|
# frozen_string_literal: true
|
|
7
7
|
|
|
8
8
|
module TreeSitterLanguagePack
|
|
9
|
-
VERSION = '1.
|
|
9
|
+
VERSION = '1.9.0.pre.rc.1'
|
|
10
10
|
end
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# This file is auto-generated by alef — DO NOT EDIT.
|
|
2
|
-
# alef:hash:
|
|
2
|
+
# alef:hash:dce0f2e0284f3f3b1b08ac2169c6eeef5ef1360cae2c75f8de2ea6411168295c
|
|
3
3
|
# To regenerate: alef generate
|
|
4
4
|
# To verify freshness: alef verify --exit-code
|
|
5
5
|
# Issues & docs: https://github.com/kreuzberg-dev/alef
|
data/lib/ts_pack_core_rb.so
CHANGED
|
Binary file
|
data/sig/types.rbs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# This file is auto-generated by alef — DO NOT EDIT.
|
|
2
|
-
# alef:hash:
|
|
2
|
+
# alef:hash:1d153369b7f668c63ef3a8277fe5de7e97f9d2457252de1b05aedb9fe0ab44fc
|
|
3
3
|
# To regenerate: alef generate
|
|
4
4
|
# To verify freshness: alef verify --exit-code
|
|
5
5
|
# Issues & docs: https://github.com/kreuzberg-dev/alef
|
|
@@ -8,12 +8,10 @@ module TreeSitterLanguagePack
|
|
|
8
8
|
|
|
9
9
|
VERSION: String
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
#
|
|
14
|
-
# Represents both byte offsets (for slicing) and human-readable line/column
|
|
15
|
-
# positions (for display and diagnostics).
|
|
11
|
+
type json_value = Hash[String, untyped] | Array[untyped] | String | Integer | Float | bool | nil
|
|
12
|
+
type JsonValue = json_value
|
|
16
13
|
|
|
14
|
+
class Span
|
|
17
15
|
attr_accessor start_byte: Integer?
|
|
18
16
|
attr_accessor end_byte: Integer?
|
|
19
17
|
attr_accessor start_line: Integer?
|
|
@@ -21,29 +19,10 @@ module TreeSitterLanguagePack
|
|
|
21
19
|
attr_accessor end_line: Integer?
|
|
22
20
|
attr_accessor end_column: Integer?
|
|
23
21
|
|
|
24
|
-
def initialize: (start_byte: Integer, end_byte: Integer, start_line: Integer, start_column: Integer, end_line: Integer, end_column: Integer) -> void
|
|
22
|
+
def initialize: (?start_byte: Integer, ?end_byte: Integer, ?start_line: Integer, ?start_column: Integer, ?end_line: Integer, ?end_column: Integer) -> void
|
|
25
23
|
end
|
|
26
24
|
|
|
27
25
|
class ProcessResult
|
|
28
|
-
# Complete analysis result from processing a source file.
|
|
29
|
-
#
|
|
30
|
-
# Contains metrics, structural analysis, imports/exports, comments,
|
|
31
|
-
# docstrings, symbols, diagnostics, and optionally chunked code segments.
|
|
32
|
-
# Fields are populated based on the `ProcessConfig` flags.
|
|
33
|
-
#
|
|
34
|
-
# # Fields
|
|
35
|
-
#
|
|
36
|
-
# - `language` - The language used for parsing
|
|
37
|
-
# - `metrics` - Always computed: line counts, byte sizes, error counts
|
|
38
|
-
# - `structure` - Functions, classes, structs (when `config.structure = true`)
|
|
39
|
-
# - `imports` - Import statements (when `config.imports = true`)
|
|
40
|
-
# - `exports` - Export statements (when `config.exports = true`)
|
|
41
|
-
# - `comments` - Comments (when `config.comments = true`)
|
|
42
|
-
# - `docstrings` - Docstrings (when `config.docstrings = true`)
|
|
43
|
-
# - `symbols` - Symbol definitions (when `config.symbols = true`)
|
|
44
|
-
# - `diagnostics` - Parse errors (when `config.diagnostics = true`)
|
|
45
|
-
# - `chunks` - Chunked code segments (when `config.chunk_max_size` is set)
|
|
46
|
-
|
|
47
26
|
attr_accessor language: String?
|
|
48
27
|
attr_accessor metrics: FileMetrics?
|
|
49
28
|
attr_accessor structure: Array[StructureItem]?
|
|
@@ -55,12 +34,10 @@ module TreeSitterLanguagePack
|
|
|
55
34
|
attr_accessor diagnostics: Array[Diagnostic]?
|
|
56
35
|
attr_accessor chunks: Array[CodeChunk]?
|
|
57
36
|
|
|
58
|
-
def initialize: (language: String, metrics: FileMetrics, structure: Array[StructureItem], imports: Array[ImportInfo], exports: Array[ExportInfo], comments: Array[CommentInfo], docstrings: Array[DocstringInfo], symbols: Array[SymbolInfo], diagnostics: Array[Diagnostic], chunks: Array[CodeChunk]) -> void
|
|
37
|
+
def initialize: (?language: String, ?metrics: FileMetrics, ?structure: Array[StructureItem], ?imports: Array[ImportInfo], ?exports: Array[ExportInfo], ?comments: Array[CommentInfo], ?docstrings: Array[DocstringInfo], ?symbols: Array[SymbolInfo], ?diagnostics: Array[Diagnostic], ?chunks: Array[CodeChunk]) -> void
|
|
59
38
|
end
|
|
60
39
|
|
|
61
40
|
class FileMetrics
|
|
62
|
-
# Aggregate metrics for a source file.
|
|
63
|
-
|
|
64
41
|
attr_accessor total_lines: Integer?
|
|
65
42
|
attr_accessor code_lines: Integer?
|
|
66
43
|
attr_accessor comment_lines: Integer?
|
|
@@ -70,12 +47,10 @@ module TreeSitterLanguagePack
|
|
|
70
47
|
attr_accessor error_count: Integer?
|
|
71
48
|
attr_accessor max_depth: Integer?
|
|
72
49
|
|
|
73
|
-
def initialize: (total_lines: Integer, code_lines: Integer, comment_lines: Integer, blank_lines: Integer, total_bytes: Integer, node_count: Integer, error_count: Integer, max_depth: Integer) -> void
|
|
50
|
+
def initialize: (?total_lines: Integer, ?code_lines: Integer, ?comment_lines: Integer, ?blank_lines: Integer, ?total_bytes: Integer, ?node_count: Integer, ?error_count: Integer, ?max_depth: Integer) -> void
|
|
74
51
|
end
|
|
75
52
|
|
|
76
53
|
class StructureItem
|
|
77
|
-
# A structural item (function, class, struct, etc.) in source code.
|
|
78
|
-
|
|
79
54
|
attr_accessor kind: StructureKind?
|
|
80
55
|
attr_accessor name: String?
|
|
81
56
|
attr_accessor visibility: String?
|
|
@@ -86,89 +61,73 @@ module TreeSitterLanguagePack
|
|
|
86
61
|
attr_accessor signature: String?
|
|
87
62
|
attr_accessor body_span: Span?
|
|
88
63
|
|
|
89
|
-
def initialize: (kind: StructureKind, ?name: String, ?visibility: String, span: Span, children: Array[StructureItem], decorators: Array[String], ?doc_comment: String, ?signature: String, ?body_span: Span) -> void
|
|
64
|
+
def initialize: (?kind: StructureKind, ?name: String, ?visibility: String, ?span: Span, ?children: Array[StructureItem], ?decorators: Array[String], ?doc_comment: String, ?signature: String, ?body_span: Span) -> void
|
|
90
65
|
end
|
|
91
66
|
|
|
92
67
|
class CommentInfo
|
|
93
|
-
# A comment extracted from source code.
|
|
94
|
-
|
|
95
68
|
attr_accessor text: String?
|
|
96
69
|
attr_accessor kind: CommentKind?
|
|
97
70
|
attr_accessor span: Span?
|
|
98
71
|
attr_accessor associated_node: String?
|
|
99
72
|
|
|
100
|
-
def initialize: (text: String, kind: CommentKind, span: Span, ?associated_node: String) -> void
|
|
73
|
+
def initialize: (?text: String, ?kind: CommentKind, ?span: Span, ?associated_node: String) -> void
|
|
101
74
|
end
|
|
102
75
|
|
|
103
76
|
class DocstringInfo
|
|
104
|
-
# A docstring extracted from source code.
|
|
105
|
-
|
|
106
77
|
attr_accessor text: String?
|
|
107
78
|
attr_accessor format: DocstringFormat?
|
|
108
79
|
attr_accessor span: Span?
|
|
109
80
|
attr_accessor associated_item: String?
|
|
110
81
|
attr_accessor parsed_sections: Array[DocSection]?
|
|
111
82
|
|
|
112
|
-
def initialize: (text: String, format: DocstringFormat, span: Span, ?associated_item: String, parsed_sections: Array[DocSection]) -> void
|
|
83
|
+
def initialize: (?text: String, ?format: DocstringFormat, ?span: Span, ?associated_item: String, ?parsed_sections: Array[DocSection]) -> void
|
|
113
84
|
end
|
|
114
85
|
|
|
115
86
|
class DocSection
|
|
116
|
-
# A section within a docstring (e.g., Args, Returns, Raises).
|
|
117
|
-
|
|
118
87
|
attr_accessor kind: String?
|
|
119
88
|
attr_accessor name: String?
|
|
120
89
|
attr_accessor description: String?
|
|
121
90
|
|
|
122
|
-
def initialize: (kind: String, ?name: String, description: String) -> void
|
|
91
|
+
def initialize: (?kind: String, ?name: String, ?description: String) -> void
|
|
123
92
|
end
|
|
124
93
|
|
|
125
94
|
class ImportInfo
|
|
126
|
-
# An import statement extracted from source code.
|
|
127
|
-
|
|
128
95
|
attr_accessor source: String?
|
|
129
96
|
attr_accessor items: Array[String]?
|
|
130
97
|
attr_accessor alias: String?
|
|
131
98
|
attr_accessor is_wildcard: bool?
|
|
132
99
|
attr_accessor span: Span?
|
|
133
100
|
|
|
134
|
-
def initialize: (source: String, items: Array[String], ?alias: String, is_wildcard: bool, span: Span) -> void
|
|
101
|
+
def initialize: (?source: String, ?items: Array[String], ?alias: String, ?is_wildcard: bool, ?span: Span) -> void
|
|
135
102
|
end
|
|
136
103
|
|
|
137
104
|
class ExportInfo
|
|
138
|
-
# An export statement extracted from source code.
|
|
139
|
-
|
|
140
105
|
attr_accessor name: String?
|
|
141
106
|
attr_accessor kind: ExportKind?
|
|
142
107
|
attr_accessor span: Span?
|
|
143
108
|
|
|
144
|
-
def initialize: (name: String, kind: ExportKind, span: Span) -> void
|
|
109
|
+
def initialize: (?name: String, ?kind: ExportKind, ?span: Span) -> void
|
|
145
110
|
end
|
|
146
111
|
|
|
147
112
|
class SymbolInfo
|
|
148
|
-
# A symbol (variable, function, type, etc.) extracted from source code.
|
|
149
|
-
|
|
150
113
|
attr_accessor name: String?
|
|
151
114
|
attr_accessor kind: SymbolKind?
|
|
152
115
|
attr_accessor span: Span?
|
|
153
116
|
attr_accessor type_annotation: String?
|
|
154
117
|
attr_accessor doc: String?
|
|
155
118
|
|
|
156
|
-
def initialize: (name: String, kind: SymbolKind, span: Span, ?type_annotation: String, ?doc: String) -> void
|
|
119
|
+
def initialize: (?name: String, ?kind: SymbolKind, ?span: Span, ?type_annotation: String, ?doc: String) -> void
|
|
157
120
|
end
|
|
158
121
|
|
|
159
122
|
class Diagnostic
|
|
160
|
-
# A diagnostic (syntax error, missing node, etc.) from parsing.
|
|
161
|
-
|
|
162
123
|
attr_accessor message: String?
|
|
163
124
|
attr_accessor severity: DiagnosticSeverity?
|
|
164
125
|
attr_accessor span: Span?
|
|
165
126
|
|
|
166
|
-
def initialize: (message: String, severity: DiagnosticSeverity, span: Span) -> void
|
|
127
|
+
def initialize: (?message: String, ?severity: DiagnosticSeverity, ?span: Span) -> void
|
|
167
128
|
end
|
|
168
129
|
|
|
169
130
|
class CodeChunk
|
|
170
|
-
# A chunk of source code with rich metadata.
|
|
171
|
-
|
|
172
131
|
attr_accessor content: String?
|
|
173
132
|
attr_accessor start_byte: Integer?
|
|
174
133
|
attr_accessor end_byte: Integer?
|
|
@@ -176,12 +135,10 @@ module TreeSitterLanguagePack
|
|
|
176
135
|
attr_accessor end_line: Integer?
|
|
177
136
|
attr_accessor metadata: ChunkContext?
|
|
178
137
|
|
|
179
|
-
def initialize: (content: String, start_byte: Integer, end_byte: Integer, start_line: Integer, end_line: Integer, metadata: ChunkContext) -> void
|
|
138
|
+
def initialize: (?content: String, ?start_byte: Integer, ?end_byte: Integer, ?start_line: Integer, ?end_line: Integer, ?metadata: ChunkContext) -> void
|
|
180
139
|
end
|
|
181
140
|
|
|
182
141
|
class ChunkContext
|
|
183
|
-
# Metadata for a single chunk of source code.
|
|
184
|
-
|
|
185
142
|
attr_accessor language: String?
|
|
186
143
|
attr_accessor chunk_index: Integer?
|
|
187
144
|
attr_accessor total_chunks: Integer?
|
|
@@ -192,50 +149,25 @@ module TreeSitterLanguagePack
|
|
|
192
149
|
attr_accessor docstrings: Array[DocstringInfo]?
|
|
193
150
|
attr_accessor has_error_nodes: bool?
|
|
194
151
|
|
|
195
|
-
def initialize: (language: String, chunk_index: Integer, total_chunks: Integer, node_types: Array[String], context_path: Array[String], symbols_defined: Array[String], comments: Array[CommentInfo], docstrings: Array[DocstringInfo], has_error_nodes: bool) -> void
|
|
152
|
+
def initialize: (?language: String, ?chunk_index: Integer, ?total_chunks: Integer, ?node_types: Array[String], ?context_path: Array[String], ?symbols_defined: Array[String], ?comments: Array[CommentInfo], ?docstrings: Array[DocstringInfo], ?has_error_nodes: bool) -> void
|
|
196
153
|
end
|
|
197
154
|
|
|
198
155
|
class PackConfig
|
|
199
|
-
# Configuration for the tree-sitter language pack.
|
|
200
|
-
#
|
|
201
|
-
# Controls cache directory and which languages to pre-download.
|
|
202
|
-
# Can be loaded from a TOML file, constructed programmatically,
|
|
203
|
-
# or passed as a dict/object from language bindings.
|
|
204
|
-
#
|
|
205
|
-
# # Example
|
|
206
|
-
#
|
|
207
|
-
# ```no_run
|
|
208
|
-
# use tree_sitter_language_pack::PackConfig;
|
|
209
|
-
#
|
|
210
|
-
# let config = PackConfig {
|
|
211
|
-
# cache_dir: None,
|
|
212
|
-
# languages: Some(vec!["python".to_string(), "rust".to_string()]),
|
|
213
|
-
# groups: None,
|
|
214
|
-
# };
|
|
215
|
-
# ```
|
|
216
|
-
|
|
217
156
|
attr_accessor cache_dir: String?
|
|
218
157
|
attr_accessor languages: Array[String]?
|
|
219
158
|
attr_accessor groups: Array[String]?
|
|
220
159
|
|
|
221
160
|
def initialize: (?cache_dir: String, ?languages: Array[String], ?groups: Array[String]) -> void
|
|
222
|
-
def self.from_toml_file: (String path) -> PackConfig
|
|
223
|
-
def self.discover: () -> PackConfig?
|
|
224
161
|
end
|
|
225
162
|
|
|
226
163
|
class Point
|
|
227
|
-
# A source position — row + column, zero-indexed.
|
|
228
|
-
|
|
229
164
|
attr_reader row: Integer
|
|
230
165
|
attr_reader column: Integer
|
|
231
166
|
|
|
232
167
|
def initialize: (row: Integer, column: Integer) -> void
|
|
233
|
-
def self.from: (Point p) -> Point
|
|
234
168
|
end
|
|
235
169
|
|
|
236
170
|
class ByteRange
|
|
237
|
-
# A byte range — start (inclusive) to end (exclusive).
|
|
238
|
-
|
|
239
171
|
attr_reader start: Integer
|
|
240
172
|
attr_reader end: Integer
|
|
241
173
|
|
|
@@ -243,20 +175,6 @@ module TreeSitterLanguagePack
|
|
|
243
175
|
end
|
|
244
176
|
|
|
245
177
|
class Parser
|
|
246
|
-
# A tree-sitter parser configured for one language at a time.
|
|
247
|
-
#
|
|
248
|
-
# # Example
|
|
249
|
-
#
|
|
250
|
-
# ```no_run
|
|
251
|
-
# use tree_sitter_language_pack::Parser;
|
|
252
|
-
#
|
|
253
|
-
# let mut parser = Parser::new();
|
|
254
|
-
# parser.set_language("python")?;
|
|
255
|
-
# let tree = parser.parse("def hello(): pass").expect("parse failed");
|
|
256
|
-
# assert_eq!(tree.root_node().kind(), "module");
|
|
257
|
-
# # Ok::<(), tree_sitter_language_pack::Error>(())
|
|
258
|
-
# ```
|
|
259
|
-
|
|
260
178
|
def set_language: (String name) -> void
|
|
261
179
|
def parse: (String source) -> Tree?
|
|
262
180
|
def parse_bytes: (String source) -> Tree?
|
|
@@ -265,18 +183,11 @@ module TreeSitterLanguagePack
|
|
|
265
183
|
end
|
|
266
184
|
|
|
267
185
|
class Tree
|
|
268
|
-
# A parsed syntax tree. Cheap to clone (refcount bump).
|
|
269
|
-
|
|
270
186
|
def root_node: () -> Node
|
|
271
187
|
def walk: () -> TreeCursor
|
|
272
188
|
end
|
|
273
189
|
|
|
274
190
|
class Node
|
|
275
|
-
# A single syntax node within a [`Tree`].
|
|
276
|
-
#
|
|
277
|
-
# Nodes hold a strong reference to their parent tree so they remain valid
|
|
278
|
-
# regardless of how the tree is moved or stored at the FFI boundary.
|
|
279
|
-
|
|
280
191
|
def clone: () -> Node
|
|
281
192
|
def kind: () -> String
|
|
282
193
|
def kind_id: () -> Integer
|
|
@@ -301,8 +212,6 @@ module TreeSitterLanguagePack
|
|
|
301
212
|
end
|
|
302
213
|
|
|
303
214
|
class TreeCursor
|
|
304
|
-
# A cursor for traversing a [`Tree`].
|
|
305
|
-
|
|
306
215
|
def node: () -> Node
|
|
307
216
|
def goto_first_child: () -> bool
|
|
308
217
|
def goto_parent: () -> bool
|
|
@@ -311,25 +220,6 @@ module TreeSitterLanguagePack
|
|
|
311
220
|
end
|
|
312
221
|
|
|
313
222
|
class ProcessConfig
|
|
314
|
-
# Configuration for the `process()` function.
|
|
315
|
-
#
|
|
316
|
-
# Controls which analysis features are enabled and whether chunking is performed.
|
|
317
|
-
#
|
|
318
|
-
# # Examples
|
|
319
|
-
#
|
|
320
|
-
# ```
|
|
321
|
-
# use tree_sitter_language_pack::ProcessConfig;
|
|
322
|
-
#
|
|
323
|
-
# // Defaults: structure + imports + exports enabled
|
|
324
|
-
# let config = ProcessConfig::new("python");
|
|
325
|
-
#
|
|
326
|
-
# // With chunking
|
|
327
|
-
# let config = ProcessConfig::new("python").with_chunking(1000);
|
|
328
|
-
#
|
|
329
|
-
# // Everything enabled
|
|
330
|
-
# let config = ProcessConfig::new("python").all();
|
|
331
|
-
# ```
|
|
332
|
-
|
|
333
223
|
attr_accessor language: String?
|
|
334
224
|
attr_accessor structure: bool?
|
|
335
225
|
attr_accessor imports: bool?
|
|
@@ -340,7 +230,7 @@ module TreeSitterLanguagePack
|
|
|
340
230
|
attr_accessor diagnostics: bool?
|
|
341
231
|
attr_accessor chunk_max_size: Integer?
|
|
342
232
|
|
|
343
|
-
def initialize: (language: String, structure: bool, imports: bool, exports: bool, comments: bool, docstrings: bool, symbols: bool, diagnostics: bool, ?chunk_max_size: Integer) -> void
|
|
233
|
+
def initialize: (?language: String, ?structure: bool, ?imports: bool, ?exports: bool, ?comments: bool, ?docstrings: bool, ?symbols: bool, ?diagnostics: bool, ?chunk_max_size: Integer) -> void
|
|
344
234
|
def with_chunking: (Integer max_size) -> ProcessConfig
|
|
345
235
|
def all: () -> ProcessConfig
|
|
346
236
|
def minimal: () -> ProcessConfig
|
|
@@ -348,124 +238,43 @@ module TreeSitterLanguagePack
|
|
|
348
238
|
end
|
|
349
239
|
|
|
350
240
|
class LanguageRegistry
|
|
351
|
-
# Thread-safe registry of tree-sitter language parsers.
|
|
352
|
-
#
|
|
353
|
-
# Manages both statically compiled and dynamically loaded language grammars.
|
|
354
|
-
# Use [`LanguageRegistry::new()`] for the default registry, or access the
|
|
355
|
-
# global instance via the module-level convenience functions
|
|
356
|
-
# (`get_language`, `available_languages`, etc.).
|
|
357
|
-
#
|
|
358
|
-
# # Example
|
|
359
|
-
#
|
|
360
|
-
# ```no_run
|
|
361
|
-
# use tree_sitter_language_pack::{LanguageRegistry, ProcessConfig};
|
|
362
|
-
#
|
|
363
|
-
# let registry = LanguageRegistry::new();
|
|
364
|
-
# let langs = registry.available_languages();
|
|
365
|
-
# println!("Available: {:?}", langs);
|
|
366
|
-
#
|
|
367
|
-
# let config = ProcessConfig::new("python").all();
|
|
368
|
-
# let result = registry.process("def hello(): pass", &config).unwrap();
|
|
369
|
-
# println!("Structure: {:?}", result.structure);
|
|
370
|
-
# ```
|
|
371
|
-
|
|
372
|
-
def add_extra_libs_dir: (String dir) -> void
|
|
373
241
|
def get_language: (String name) -> Language
|
|
374
242
|
def available_languages: () -> Array[String]
|
|
375
243
|
def has_language: (String name) -> bool
|
|
376
244
|
def language_count: () -> Integer
|
|
377
245
|
def process: (String source, ProcessConfig config) -> ProcessResult
|
|
378
|
-
def self.with_libs_dir: (String libs_dir) -> LanguageRegistry
|
|
379
246
|
def self.default: () -> LanguageRegistry
|
|
380
247
|
end
|
|
381
248
|
|
|
382
|
-
class ParserManifest
|
|
383
|
-
# Manifest describing available parser downloads for a specific version.
|
|
384
|
-
|
|
385
|
-
attr_reader version: String
|
|
386
|
-
attr_reader platforms: Hash[String, PlatformBundle]
|
|
387
|
-
attr_reader languages: Hash[String, LanguageInfo]
|
|
388
|
-
attr_reader groups: Hash[String, Array[String]]
|
|
389
|
-
|
|
390
|
-
def initialize: (version: String, platforms: Hash[String, PlatformBundle], languages: Hash[String, LanguageInfo], groups: Hash[String, Array[String]]) -> void
|
|
391
|
-
end
|
|
392
|
-
|
|
393
|
-
class PlatformBundle
|
|
394
|
-
attr_reader url: String
|
|
395
|
-
attr_reader sha256: String
|
|
396
|
-
attr_reader size: Integer
|
|
397
|
-
|
|
398
|
-
def initialize: (url: String, sha256: String, size: Integer) -> void
|
|
399
|
-
end
|
|
400
|
-
|
|
401
|
-
class LanguageInfo
|
|
402
|
-
attr_reader group: String
|
|
403
|
-
attr_reader size: Integer
|
|
404
|
-
|
|
405
|
-
def initialize: (group: String, size: Integer) -> void
|
|
406
|
-
end
|
|
407
|
-
|
|
408
249
|
class DownloadManager
|
|
409
|
-
# Manages downloading and caching of pre-built parser shared libraries.
|
|
410
|
-
|
|
411
|
-
def cache_dir: () -> String
|
|
412
250
|
def installed_languages: () -> Array[String]
|
|
413
|
-
def ensure_languages: (Array[String] names) -> void
|
|
414
|
-
def ensure_group: (String group) -> void
|
|
415
|
-
def lib_path: (String name) -> String
|
|
416
|
-
def fetch_manifest: () -> ParserManifest
|
|
417
251
|
def download_all_best_effort: () -> Integer
|
|
418
252
|
def clean_cache: () -> void
|
|
419
253
|
def self.new: (String version) -> DownloadManager
|
|
420
254
|
def self.with_cache_dir: (String version, String cache_dir) -> DownloadManager
|
|
421
|
-
def self.default_cache_dir: (String version) -> String
|
|
422
255
|
end
|
|
423
256
|
|
|
424
257
|
class Language
|
|
425
258
|
end
|
|
426
259
|
|
|
427
260
|
class StructureKind
|
|
428
|
-
# The kind of structural item found in source code.
|
|
429
|
-
#
|
|
430
|
-
# Categorizes top-level and nested declarations such as functions, classes,
|
|
431
|
-
# structs, enums, traits, and more. Use [`Other`](StructureKind::Other) for
|
|
432
|
-
# language-specific constructs that do not fit a standard category.
|
|
433
261
|
end
|
|
434
262
|
|
|
435
263
|
class CommentKind
|
|
436
|
-
# The kind of a comment found in source code.
|
|
437
|
-
#
|
|
438
|
-
# Distinguishes between single-line comments, block (multi-line) comments,
|
|
439
|
-
# and documentation comments.
|
|
440
264
|
type value = :line | :block | :doc
|
|
441
265
|
end
|
|
442
266
|
|
|
443
267
|
class DocstringFormat
|
|
444
|
-
# The format of a docstring extracted from source code.
|
|
445
|
-
#
|
|
446
|
-
# Identifies the docstring convention used, which varies by language
|
|
447
|
-
# (e.g., Python triple-quoted strings, JSDoc, Rustdoc `///` comments).
|
|
448
268
|
end
|
|
449
269
|
|
|
450
270
|
class ExportKind
|
|
451
|
-
# The kind of an export statement found in source code.
|
|
452
|
-
#
|
|
453
|
-
# Covers named exports, default exports, and re-exports from other modules.
|
|
454
271
|
type value = :named | :default | :re_export
|
|
455
272
|
end
|
|
456
273
|
|
|
457
274
|
class SymbolKind
|
|
458
|
-
# The kind of a symbol definition found in source code.
|
|
459
|
-
#
|
|
460
|
-
# Categorizes symbol definitions such as variables, constants, functions,
|
|
461
|
-
# classes, types, interfaces, enums, and modules.
|
|
462
275
|
end
|
|
463
276
|
|
|
464
277
|
class DiagnosticSeverity
|
|
465
|
-
# Severity level of a diagnostic produced during parsing.
|
|
466
|
-
#
|
|
467
|
-
# Used to classify parse errors, warnings, and informational messages
|
|
468
|
-
# found in the syntax tree.
|
|
469
278
|
type value = :error | :warning | :info
|
|
470
279
|
end
|
|
471
280
|
|
|
@@ -503,6 +312,8 @@ module TreeSitterLanguagePack
|
|
|
503
312
|
|
|
504
313
|
def self.download_all: () -> Integer
|
|
505
314
|
|
|
315
|
+
def self.download_group: (String name) -> Integer
|
|
316
|
+
|
|
506
317
|
def self.manifest_languages: () -> Array[String]
|
|
507
318
|
|
|
508
319
|
def self.downloaded_languages: () -> Array[String]
|
metadata
CHANGED
|
@@ -1,14 +1,28 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tree_sitter_language_pack
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.9.0.pre.rc.1
|
|
5
5
|
platform: aarch64-linux
|
|
6
6
|
authors:
|
|
7
7
|
- Kreuzberg Team
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
-
dependencies:
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: sorbet-runtime
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - "~>"
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '0.5'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - "~>"
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '0.5'
|
|
12
26
|
description: Pre-compiled tree-sitter grammars for 305 programming languages
|
|
13
27
|
executables: []
|
|
14
28
|
extensions: []
|