fork of https://github.com/tree-sitter/tree-sitter-graph
1# Changelog
2
3All notable changes to this project will be documented in this file.
4
5The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
8## v0.12.0 -- 2024-12-12
9
10Upgraded the `tree-sitter` dependency to version 0.24.
11
12## v0.11.3 -- 2024-05-29
13
14### Library
15
16#### Fixed
17
18- Excerpts shown as part of errors now use formatting that works both in light and dark mode.
19
20## v0.11.2 -- 2024-03-08
21
22### DSL
23
24#### Added
25
26- Support adding an edge multiple times, or setting an attribute multiple times with the same value. Previously these would raise runtime errors.
27
28## v0.11.1 -- 2024-03-06
29
30Updated the `tree-sitter` dependency to include the required minimal patch version.
31
32## v0.11.0 -- 2023-07-17
33
34### Library
35
36#### Added
37
38- Store a debug attribute for the matched syntax node, providing information about the syntactic category of the match that gave rise to the graph node.
39
40## v0.10.5 -- 2023-06-26
41
42#### Fixed
43
44- A panic that sometimes occurred in lazy execution mode.
45
46## v0.10.4 -- 2023-06-02
47
48### Library
49
50#### Added
51
52- Several errors include more context in the error message: Duplicate errors report both statements using source snippets. Edge statements report which argument (the source or the sink) triggered an evluation error.
53
54#### Fixed
55
56- Ensure that edge attribute statements are executed after edges are created, to prevent non-deterministic ordering bugs in lazy execution mode.
57
58## v0.10.3 -- 2023-06-01
59
60### DSL
61
62#### Added
63
64- Scoped variables can be inherited by child nodes by specifying `inherit .var_name` as part of the source. Using `@node.var_name` will either use the value set on the node itself, or otherwise the one set on the closest enclosing node.
65
66## v0.10.2 -- 2023-05-25
67
68### Library
69
70#### Added
71
72- Edge debug information now contains the TSG location of the `edge` statement if `ExecutionConfig::location_attr` is set.
73
74#### Changed
75
76- The TSG location in the debug information is formatted more explicitly as `line XX column YY` instead of `(XX, YY)`.
77
78## v0.10.1 -- 2023-05-15
79
80### Library
81
82#### Added
83
84- The `ast::File::try_visit_matches` method can be used to execute the stanza query matching without executing the stanza bodies.
85
86## v0.10.0 -- 2023-05-10
87
88### DSL
89
90#### Changed
91
92- Unused captures in patterns are now considered errors, unless they start with an underscore.
93
94### Library
95
96#### Fixed
97
98- Some execution errors were not always reported in lazy execution mode, depending on whether variables were used or not. This has been fixed to behave more consistently, so that errors are always reported regardless of variable use.
99
100### CLI
101
102#### Added
103
104- Errors from setting a scoped variable twice on the same node are now reported with source snippets for both statements involved.
105
106## v0.9.2 -- 2023-04-14
107
108### Library
109
110#### Added
111
112- The `parse_error::Excerpt` type, which is used to show source excerpts, is now public.
113
114## v0.9.1 -- 2023-04-03
115
116### CLI
117
118#### Added
119
120- Errors from parsing and checking the TSG file are now displayed with source excerpts.
121
122## v0.9.0 -- 2023-03-31
123
124### Library
125
126#### Changed
127
128- The method `ParseError::display(source: &str, verbose: bool)` has been replaced by two methods `ParseError::display(path: &path, source: &str)` and `ParseError::display_pretty(path: &Path, source: &str)`.
129
130### CLI
131
132#### Changed
133
134- Parse errors are now displayed with the same excerpt style as execution errors.
135
136## 0.8.0 -- 2023-03-29
137
138### Library
139
140#### Fixed
141
142- Fix error formatting panic with strict execution.
143
144#### Changed
145
146- The traits stored in `Functions` must now implement `Send` and `Sync` to ensure they can be shared more easily in concurrent situations.
147
148## 0.7.0 -- 2022-10-18
149
150### DSL
151
152#### Added
153
154- Global variables can be given default string values using `global NAME = "STRING"` syntax.
155- Function `eq` to compare two values for equality.
156- Function `format` to format strings.
157- Function `concat` to concatenate lists.
158- Function `join` to join a list of values using an optional separator.
159
160#### Removed
161
162- References to undefined variables now result in errors, instead of assuming its an undeclared global variable.
163
164### Library
165
166#### Fixed
167
168- Query errors now report the correct column for errors on the first row of a query.
169
170#### Added
171
172- The `Variables` type has additional methods `is_empty` and `iter`.
173
174#### Changed
175
176- References to `ExecutionConfig` passed to `File::execute*` are not required to be mutable anymore.
177
178## 0.6.1 -- 2022-09-06
179
180### Library
181
182#### Fixed
183
184- Cancellation errors during execution are now propagated all the way up, instead of being wrapped in other errors.
185
186#### Added
187
188- The `ExecutionError` type now supports formatting errors with excerpts from the program and TSG source by using the `.display_pretty` method.
189
190#### Changed
191
192- `Variables::nested` does now accept a non-mutable reference.
193
194### CLI
195
196#### Added
197
198- Execution errors now include excerpts from the program and TSG source when printed.
199
200## 0.6.0 -- 20220-08-23
201
202### Library
203
204#### Added
205
206- Cancellation of `ast::File` execution is now supported by passing an implementation of the `CancellationFlag` trait.
207 The `NoCancellation` type provides a noop implementation.
208
209#### Fixed
210
211- Fixed bug in `Identifier` so `ast::File` instances can be safely shared between threads.
212
213#### Changed
214
215- Functions are not passed as mutable anymore, so that they can safely used concurrently and reused between executions.
216- `ast::File::execute` requires an extra `CancellationFlag` parameter. Use `&NoCancellation` if no cancellation is required.
217
218### CLI
219
220#### Added
221
222- Global variables can be provided by passing `--global VAR=VAL` flags. Only string values are supported.
223
224## 0.5.1 -- 2022-05-11
225
226### DSL
227
228- Reference the new VS Code extension in the README.
229
230## 0.5.0 -- 2022-05-09
231
232### DSL
233
234#### Fixed
235
236- Report query errors with correct source locations.
237
238### Library
239
240#### Changed
241
242- In JSON output, all values are represented as objects with a `type` field
243 indicating the value type, and additional value fields that vary per type.
244
245### CLI
246
247#### Added
248
249- Flag `--output`/`-o` to set JSON output path.
250
251## 0.4.0 -- 2022-03-21
252
253### DSL
254
255#### Added
256
257- Global variable declarations.
258- Attribute shorthands.
259- List and set comprehensions.
260
261#### Deprecated
262
263- Use of undeclared global variables.
264
265### Library
266
267#### Added
268
269- Module `parse_error` for finding and displaying `tree-sitter` parse errors.
270- Option in `ExecutionConfig` to automatically add debug graph node attributes that describe the source location and variable name of the originating `node` statement in the DSL source.
271
272#### Changed
273
274- Calls to `execute` will fail with a runtime error if declared global variables are missing in the global environment.
275- Calls to `execute` will not fail early on parse trees with errors. Errors may occur during query execution if matched parts of the tree are missing.
276- The seperate arguments to `execute` are replaced by a single `ExecutionConfig` argument, which makes it easier to add optional arguments without breaking all use sites.
277
278#### Removed
279
280- The `execute_lazy` method has been removed. Lazy evalaution is enabled by setting the `lazy` flag in the `ExecutionConfig`.
281
282### CLI
283
284#### Added
285
286- Flag `--allow-parse-errors` that allows running against input files with parse errors.
287
288#### Changed
289
290- Improved formatting of parse error messages.
291
292## 0.3.0 - 2022-02-08
293
294### DSL
295
296#### Added
297
298- Loop statement to iterate over list values.
299- Conditional statement to check optional and boolean values.
300- Boolean functions `and`, `or`, and `not`.
301- Lazy evaluation strategy that does not rely on textual stanza order.
302
303#### Changed
304
305- Variables are now scoped in blocks, and will not escape or overwrite variables defined in enclosing blocks.
306- Fix nested function calls, which would lose their arguments.
307- Fix nested `scan` statements, which would lose outer captures after the inner statement.
308- Construct capture values based in query quantifiers, e.g., create a list for `@cap*` or an optional value for `@cap?`.
309- Rename `child-index` to the more accurate `named-child-index`
310
311#### Removed
312
313- The `scan` statement cannot be applied to values that are not local to the stanza, i.e., values that depend on scoped variables.
314
315### Library
316
317#### Added
318
319- Method `File::execute_lazy` to use lazy evaluation strategy.
320- Methods `File::execute_into` and `File::execute_lazy_into` to use an existing graph instance, instead of creating a new one.
321- Various `Value::into_*` and `Value::as_*` methods.
322
323#### Changed
324
325- The method `Graph::display_with` is renamed to `Graph::pretty_print`.
326
327#### Deprecated
328
329- The method `File::parse` is deprecated because it it not sound anymore, and should be replaced by the `File::from_str` method.
330- The method `Value::into_syntax_node` is deprecated, and should be replaced by explicit graph indexing.
331
332#### Removed
333
334- The `Context` object for string interning is removed, along with the `ctx` parameters of methods.
335
336### CLI
337
338#### Added
339
340- JSON output mode for the resulting graph, controlled by the `--json` flag.
341- A `--lazy` flag to use the lazy evaluation strategy.
342- A `--quiet` flag to suppress graph output.