sourceror

Utilities to manipulate Elixir source code

APACHE-2.0 License

Downloads
1.5M
Stars
315
Committers
10
sourceror - v0.11

Published by doorgan over 2 years ago

1. Enhancements

  • [Sourceror.Zipper] Added skip (Thanks to @NickNeck)
  • [Sourceror.Zipper] Added a direction to zip (Thanks to @NickNeck)

2. Bug fixes

  • [Sourceror] Comments are no longer misplaced for :__block__ nodes
    with trailing comments
  • [Sourceror] Blocks with trailing comments are no longer force-formatted with
    parenthesis.
sourceror - v0.10

Published by doorgan over 2 years ago

1. Enhancements

  • [Sourceror.Zipper] Added traverse_while (Thanks to @NickNeck)
  • [Sourceror.Zipper] traverse now traverses subtrees if given a non top
    zipper (Thanks to @NickNeck)
sourceror - v0.9.0

Published by doorgan almost 3 years ago

v0.9.0 (2021-12-04)

1. Enhancements

  • [Sourceror] to_string/2 now supports options for Code.quoted_to_algebra, like locals_without_parens
  • [Sourceror] get_range/2 no longer considers comments when calculating the range. This can be enabled by passing the include_comments: true option
  • [Sourceror.Patch] Introduced Sourceror.Patch with utilities to generate patches for the most common rewriting operations
  • [Sourceror.Identifier] Sourceror.Identifier is now public
sourceror - v0.8.10

Published by doorgan almost 3 years ago

v0.8.10 (2021-12-04)

1. Bug fixes

  • [Sourceror] Fixed comment spacing on binary operators
  • [Sourceror] Take comment end of line counts into account to
sourceror - v0.8.9

Published by doorgan almost 3 years ago

v0.8.9 (2021-12-02)

Enhancements

  • [Sourceror] Updated internal normalizer to match latest Elixir 1.13 version

1. Bug fixes

  • [Sourceror] Fixed an issue that caused comments in lists to be misplaced
sourceror - v0.8.8

Published by doorgan almost 3 years ago

Changelog for Sourceror v0.8.8

1. Bug fixes

  • [Sourceror] Fixed issues that caused comments to be misplaced.
  • [Sourceror] Updated internal normalizer to match latest Elixir 1.13 version.
sourceror - v0.8.7

Published by doorgan about 3 years ago

Changelog for Sourceror v0.8.7 (2021-10-23)

1. Bug fixes

  • [Sourceror] Fixed an issue that caused newlines to be wrongly removed.
sourceror - v0.8.6

Published by doorgan about 3 years ago

Changelog for Sourceror v0.8 (2021-10-23)

1. Bug fixes

  • [Sourceror] Fixed an issue that caused comments in pipelines to be misplaced.
sourceror - v0.8.5

Published by doorgan about 3 years ago

Changelog for Sourceror v0.8.5

1. Bug fixes

  • [Sourceror] Fixed issue that prevented keyword lists from preserving their
    original format in tuples.
sourceror - v0.8.4

Published by doorgan about 3 years ago

Changelog for Sourceror v0.8.4

1. Bug fixes

  • [Sourceror] get_range/1 now properly handles naked AST lists, like the ones
    coming from partial keyword lists, or stabs like a -> b.
sourceror - v0.8.3

Published by doorgan about 3 years ago

v0.8.3

1. Bug fixes

  • [Sourceror] get_range/1 now handles partial keyword list syntax instead of crashing.
sourceror - v0.8.2

Published by doorgan about 3 years ago

1. Bug fixes

  • [Sourceror.Zipper] down/1 now correctly uses nil as the right siblings if the branch node has a single child.
sourceror -

Published by doorgan over 3 years ago

v0.8.1

1. Bug fixes

  • [Sourceror] Sourceror.get_range/1 now correctly calculates the range when
    there is a comment in the same line as the node.
sourceror -

Published by doorgan over 3 years ago

v0.8

1. Enhancements

  • [Sourceror] Added Sourceror.patch_string/2
  • [Sourceror] Added the format: :splicing option to Sourceror.to_string/2

2. Bug fixes

  • [Sourceror] Now Sourceror.to_string/2 won't produce invalid Elixir code
    when a keyword list element is at the beginning of a non-keyword list.
  • [Sourceror] Now Sourceror.get_range/1 will take the leading comments into
    account when calculating the range.
sourceror -

Published by doorgan over 3 years ago

v0.7.2

1. Bug Fixes

  • [Sourceror] - get_range/1 now returns the correct ranges for 2-tuples from
    keyword lists.
sourceror -

Published by doorgan over 3 years ago

v0.7.1

1. Bug Fixes

  • [Sourceror] - get_range/1 now returns the correct ranges for sigils and
    interpolations.
sourceror -

Published by doorgan over 3 years ago

v0.7.0

1. Enhancements

  • [Sourceror.Zipper] - Added a Zipper implementation for the Elixir AST based
    on Huet's paper.
sourceror -

Published by doorgan over 3 years ago

v0.6.1

1. Bug fixes

  • [Sourceror] - to_string no longer escape the escaped sequences twice.
  • [Sourceror] - Backported a bugfix in the Elixir normalizer related to
    parenthesis in calls with do blocks.
sourceror -

Published by doorgan over 3 years ago

This release introduces some breaking changes, as the way comments are
handled by the library has been fundamentally changed.

v0.6.0

1. Enhancements

  • [Sourceror] - to_string no longer requires line number corrections to
    produce properly formatted code.
  • [Sourceror] - Added prewalk/2 and prewalk/3.
  • [Sourceror] - parse_string won't warn on unnecesary quotes.
  • [Sourceror.TraversalState] - Sourceror.PostwalkState was renamed to
    Sourceror.TraversalState to make it more generic for other kinds of
    traversals.

2. Removals

  • [Sourceror] - get_line_span was removed in favor of using get_range and
    calculating the difference from the range start and end lines.
  • [Sourceror.TraversalState] - line_correction field was removed as it is no
    longer needed.

3. Bug fixes

  • [Sourceror] - get_range now properly returns ranges that map a node to
    it's actual start and end positions in the original source code.

v0.5.0

The changelog for v0.5 releases can be found in the v0.5.0
tag
.

sourceror -

Published by doorgan over 3 years ago

v0.5.0

1. Enhancements

  • [Sourceror] - Add Sourceror.prepend_comments/2 and Sourceror.append_comments/2.