-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let ChangesetBuilder.invalidated search even container elements #6548
Conversation
engine/runtime/src/main/scala/org/enso/compiler/context/ChangesetBuilder.scala
Outdated
Show resolved
Hide resolved
engine/runtime/src/test/scala/org/enso/compiler/test/context/ChangesetBuilderTest.scala
Show resolved
Hide resolved
engine/runtime/src/test/scala/org/enso/compiler/test/context/ChangesetBuilderTest.scala
Outdated
Show resolved
Hide resolved
engine/runtime/src/test/scala/org/enso/compiler/test/context/ChangesetBuilderTest.scala
Outdated
Show resolved
Hide resolved
engine/runtime/src/main/scala/org/enso/compiler/context/ChangesetBuilder.scala
Outdated
Show resolved
Hide resolved
private def invalidated( | ||
tree: Tree, | ||
edit: Location, | ||
onlyLeafs: Boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and why do we need this parameter now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without f867313 the "should module with undefined literal" test fails:
$ git show f867313 | patch -p1 -R
$ sbt runtime/testOnly *ChangesetBuilderTest
[info] - should module with undefined literal *** FAILED ***
[info] Set(b1c393b2-67be-488b-b46d-2adba21bca6d, c05a82f3-9dea-49fb-81ce-8dfa5703e5ac)
did not contain the same elements as
List(c05a82f3-9dea-49fb-81ce-8dfa5703e5ac) (ChangesetBuilderTest.scala:368)
The additional b1c393b2-67be-488b-b46d-2adba21bca6d
id represents 1 + undefined
text. The fillInHoles
function associates the space between +
and undefined
to b1c393b2-67be-488b-b46d-2adba21bca6d
- as the edit replaces undefined
with 42
it touches the space on the boundary and as such we get two change sets. To keep the original behavior we first work on "leafs" only as before and only when they find nothing, we try harder with non-leaf elements.
--- engine/runtime/src/test/scala/org/enso/compiler/test/context/ChangesetBuilderTest.scala
+++ engine/runtime/src/test/scala/org/enso/compiler/test/context/ChangesetBuilderTest.scala
@@ -366,6 +366,7 @@ class ChangesetBuilderTest extends CompilerTest {
.originalName
invalidated(ir, code, edit) should contain theSameElementsAs Seq(
+ UUID.fromString("b1c393b2-67be-488b-b46d-2adba21bca6d"),
undefinedName.getId
)
invalidatedAll(ir, code, edit) should contain theSameElementsAs Seq(
Alternative is to modify the test and ignore or accept the additional result.
Co-authored-by: Dmitry Bushev <[email protected]>
* develop: (28 commits) Add tests for Date.until, Date.next and Date.previous. (#6606) Improve `Non_Unique_Primary_Key` error, split file format detection into read/write, improve SQLite format detection (#6604) tokenize_to_columns or parse_to_columns results in a single column we shouldn't add the 1 (#6607) Fix node editing race condition (#6594) Add format to the in-memory Column (#6538) Fix dashboard issues (part 2) (#6511) Fix visualisation type selector artifacts rendered after node preview visualisation was closed. (#6575) Revert typescript CI Lint changes (#6602) Fix the Engine version check in GUI (#6570) Show error pop-up when failing to rename a project (#6366) Small changes from Book Club issues (#6533) "at_least_one" flag for tokenize_to_rows (#6539) Benchmark Engine job runs only engine, not Enso benchmarks (#6534) Catch 5813 and avoid crash (#6585) Fix opening links in desktop IDE (#6507) Identify SyntaxError exception and avoid printing a stack trace (#6574) Fix dashboard issues (#6502) Let ChangesetBuilder.invalidated search even container elements (#6548) Fix #5075: stop panning on full-screen visualisation (#6530) Only `Join_Kind.Inner` removes the common-named columns (#6564) ...
Pull Request Description
Will fix #6221 by making sure IR element with UUID is found even it is not a leaf.
Important Notes
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
style guides.