Skip to content

Fix: keep list and tuple element order in assigns - #1012

Open
RaphaelFakhri wants to merge 1 commit into
software-mansion:mainfrom
RaphaelFakhri:fix-list-tuple-element-order
Open

RaphaelFakhri wants to merge 1 commit into
software-mansion:mainfrom
RaphaelFakhri:fix-list-tuple-element-order

Conversation

@RaphaelFakhri

Copy link
Copy Markdown

Fixes #1011

Summary

  • Stop sorting list and tuple elements in TermParser.to_children/1. Elements now display in their real order, so {:ok, 5} no longer renders as {5, :ok}.
  • List diffs from TermDiffer are positional, so incremental updates now land on the right children and match a fresh render.
  • Map, struct and keyword keys stay sorted as introduced in Enhancement: Sort children in TermNode #896.

Validation

  • mix test test/app/utils/term_parser_test.exs: the two new tests fail without the fix (32 tests, 2 failures) and pass with it (32 tests, 0 failures).
  • mix test: 507 tests, 0 failures.
  • mix format --check-formatted and mix credo: no issues.

TermParser sorted list and tuple elements before building display nodes, so {:ok, 5} rendered as {5, :ok} and list diffs were applied by index to the sorted children.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Assigns view shows list and tuple elements in sorted order instead of their real order

1 participant