Skip to content
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

Merged
merged 6 commits into from
May 5, 2023

Conversation

JaroslavTulach
Copy link
Member

@JaroslavTulach JaroslavTulach commented May 4, 2023

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:

  • All code follows the
    Scala,
    Java,
    style guides.
  • All code has been tested:
    • Unit tests have been written where possible.

@JaroslavTulach JaroslavTulach self-assigned this May 4, 2023
@JaroslavTulach JaroslavTulach added the --bug Type: bug label May 4, 2023
@JaroslavTulach JaroslavTulach added this to the Design Partners milestone May 4, 2023
@JaroslavTulach JaroslavTulach added the CI: No changelog needed Do not require a changelog entry for this PR. label May 4, 2023
@JaroslavTulach JaroslavTulach changed the title Test to tease ChangesetBuilder.invalidated with complex line expression Let ChangesetBuilder.invalidated search even container elements May 4, 2023
private def invalidated(
tree: Tree,
edit: Location,
onlyLeafs: Boolean
Copy link
Contributor

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?

Copy link
Member Author

@JaroslavTulach JaroslavTulach May 5, 2023

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.

@JaroslavTulach JaroslavTulach requested a review from 4e6 May 5, 2023 05:18
@JaroslavTulach JaroslavTulach merged commit a842130 into develop May 5, 2023
@JaroslavTulach JaroslavTulach deleted the wip/jtulach/BooleanDefaulted_6221 branch May 5, 2023 09:46
Procrat added a commit that referenced this pull request May 10, 2023
* 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)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
--bug Type: bug CI: No changelog needed Do not require a changelog entry for this PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When picking a Boolean value via the dropdown doesn't recalculate correctly.
2 participants