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.9.2 -- 2023-04-14 9 10### Library 11 12#### Added 13 14- The `parse_error::Excerpt` type, which is used to show source excerpts, is now public. 15 16## v0.9.1 -- 2023-04-03 17 18### CLI 19 20#### Added 21 22- Errors from parsing and checking the TSG file are now displayed with source excerpts. 23 24## v0.9.0 -- 2023-03-31 25 26### Library 27 28#### Changed 29 30- 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)`. 31 32### CLI 33 34#### Changed 35 36- Parse errors are now displayed with the same excerpt style as execution errors. 37 38## 0.8.0 -- 2023-03-29 39 40### Library 41 42#### Fixed 43 44- Fix error formatting panic with strict execution. 45 46#### Changed 47 48- The traits stored in `Functions` must now implement `Send` and `Sync` to ensure they can be shared more easily in concurrent situations. 49 50## 0.7.0 -- 2022-10-18 51 52### DSL 53 54#### Added 55 56- Global variables can be given default string values using `global NAME = "STRING"` syntax. 57- Function `eq` to compare two values for equality. 58- Function `format` to format strings. 59- Function `concat` to concatenate lists. 60- Function `join` to join a list of values using an optional separator. 61 62#### Removed 63 64- References to undefined variables now result in errors, instead of assuming its an undeclared global variable. 65 66### Library 67 68#### Fixed 69 70- Query errors now report the correct column for errors on the first row of a query. 71 72#### Added 73 74- The `Variables` type has additional methods `is_empty` and `iter`. 75 76#### Changed 77 78- References to `ExecutionConfig` passed to `File::execute*` are not required to be mutable anymore. 79 80## 0.6.1 -- 2022-09-06 81 82### Library 83 84#### Fixed 85 86- Cancellation errors during execution are now propagated all the way up, instead of being wrapped in other errors. 87 88#### Added 89 90- The `ExecutionError` type now supports formatting errors with excerpts from the program and TSG source by using the `.display_pretty` method. 91 92#### Changed 93 94- `Variables::nested` does now accept a non-mutable reference. 95 96### CLI 97 98#### Added 99 100- Execution errors now include excerpts from the program and TSG source when printed. 101 102## 0.6.0 -- 20220-08-23 103 104### Library 105 106#### Added 107 108- Cancellation of `ast::File` execution is now supported by passing an implementation of the `CancellationFlag` trait. 109 The `NoCancellation` type provides a noop implementation. 110 111#### Fixed 112 113- Fixed bug in `Identifier` so `ast::File` instances can be safely shared between threads. 114 115#### Changed 116 117- Functions are not passed as mutable anymore, so that they can safely used concurrently and reused between executions. 118- `ast::File::execute` requires an extra `CancellationFlag` parameter. Use `&NoCancellation` if no cancellation is required. 119 120### CLI 121 122#### Added 123 124- Global variables can be provided by passing `--global VAR=VAL` flags. Only string values are supported. 125 126## 0.5.1 -- 2022-05-11 127 128### DSL 129 130- Reference the new VS Code extension in the README. 131 132## 0.5.0 -- 2022-05-09 133 134### DSL 135 136#### Fixed 137 138- Report query errors with correct source locations. 139 140### Library 141 142#### Changed 143 144- In JSON output, all values are represented as objects with a `type` field 145 indicating the value type, and additional value fields that vary per type. 146 147### CLI 148 149#### Added 150 151- Flag `--output`/`-o` to set JSON output path. 152 153## 0.4.0 -- 2022-03-21 154 155### DSL 156 157#### Added 158 159- Global variable declarations. 160- Attribute shorthands. 161- List and set comprehensions. 162 163#### Deprecated 164 165- Use of undeclared global variables. 166 167### Library 168 169#### Added 170 171- Module `parse_error` for finding and displaying `tree-sitter` parse errors. 172- 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. 173 174#### Changed 175 176- Calls to `execute` will fail with a runtime error if declared global variables are missing in the global environment. 177- 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. 178- 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. 179 180#### Removed 181 182- The `execute_lazy` method has been removed. Lazy evalaution is enabled by setting the `lazy` flag in the `ExecutionConfig`. 183 184### CLI 185 186#### Added 187 188- Flag `--allow-parse-errors` that allows running against input files with parse errors. 189 190#### Changed 191 192- Improved formatting of parse error messages. 193 194## 0.3.0 - 2022-02-08 195 196### DSL 197 198#### Added 199 200- Loop statement to iterate over list values. 201- Conditional statement to check optional and boolean values. 202- Boolean functions `and`, `or`, and `not`. 203- Lazy evaluation strategy that does not rely on textual stanza order. 204 205#### Changed 206 207- Variables are now scoped in blocks, and will not escape or overwrite variables defined in enclosing blocks. 208- Fix nested function calls, which would lose their arguments. 209- Fix nested `scan` statements, which would lose outer captures after the inner statement. 210- Construct capture values based in query quantifiers, e.g., create a list for `@cap*` or an optional value for `@cap?`. 211- Rename `child-index` to the more accurate `named-child-index` 212 213#### Removed 214 215- The `scan` statement cannot be applied to values that are not local to the stanza, i.e., values that depend on scoped variables. 216 217### Library 218 219#### Added 220 221- Method `File::execute_lazy` to use lazy evaluation strategy. 222- Methods `File::execute_into` and `File::execute_lazy_into` to use an existing graph instance, instead of creating a new one. 223- Various `Value::into_*` and `Value::as_*` methods. 224 225#### Changed 226 227- The method `Graph::display_with` is renamed to `Graph::pretty_print`. 228 229#### Deprecated 230 231- The method `File::parse` is deprecated because it it not sound anymore, and should be replaced by the `File::from_str` method. 232- The method `Value::into_syntax_node` is deprecated, and should be replaced by explicit graph indexing. 233 234#### Removed 235 236- The `Context` object for string interning is removed, along with the `ctx` parameters of methods. 237 238### CLI 239 240#### Added 241 242- JSON output mode for the resulting graph, controlled by the `--json` flag. 243- A `--lazy` flag to use the lazy evaluation strategy. 244- A `--quiet` flag to suppress graph output.