Skip to content

Fix Liquid capture sorting#135

Merged
thecrypticace merged 2 commits intomainfrom
fix/liquid-capture-sorting
Mar 22, 2023
Merged

Fix Liquid capture sorting#135
thecrypticace merged 2 commits intomainfrom
fix/liquid-capture-sorting

Conversation

@thecrypticace
Copy link
Copy Markdown
Contributor

The current approach doesn't uniformly change all sources in all AST nodes. This results in weird behavior where only the first or last tag may end up sorted.

Because we're somewhat relying on implementation details here (the use of .source + .position across various nodes rather than the values embedded in the AST) we want to make sure all changes for all classes are applied across all traversed instances of the source text in the AST.

Fixes #130 (for real this time)

@thecrypticace thecrypticace merged commit 3ebd6d0 into main Mar 22, 2023
bradlc added a commit that referenced this pull request Mar 29, 2023
bradlc added a commit that referenced this pull request Mar 29, 2023
thecrypticace added a commit that referenced this pull request Mar 30, 2023
thecrypticace added a commit that referenced this pull request Mar 31, 2023
* Revert "Revert "Fix Liquid `capture` sorting (#135)" (#140)"

This reverts commit 2aabc3c.

* Fix off-by-1 error when String nodes don’t have quotes

* Refactor

* Add tests

* Simplify test cases

* Update changelog
bronisMateusz pushed a commit to bronisMateusz/prettier-plugin-tailwindcss-drupal that referenced this pull request Apr 16, 2025
* Collect all changes to Liquid sources before applying them

* Add tests
bronisMateusz pushed a commit to bronisMateusz/prettier-plugin-tailwindcss-drupal that referenced this pull request Apr 16, 2025
bronisMateusz pushed a commit to bronisMateusz/prettier-plugin-tailwindcss-drupal that referenced this pull request Apr 16, 2025
…indlabs#143)

* Revert "Revert "Fix Liquid `capture` sorting (tailwindlabs#135)" (tailwindlabs#140)"

This reverts commit 13dac2b.

* Fix off-by-1 error when String nodes don’t have quotes

* Refactor

* Add tests

* Simplify test cases

* Update changelog
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.

Class ordering not working in Liquid Capture

1 participant