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

Support diffs in pattern matching added in Elixir 1.10.0 #1762

Merged
merged 2 commits into from
Apr 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
129 changes: 68 additions & 61 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,212 +2,219 @@

## Table of Contents

* [v11.6.1](#v1161)
* [Bug Fixes](#bug-fixes)
* [v11.6.0](#v1160)
* [Enhancements](#enhancements)
* [Bug Fixes](#bug-fixes)
* [Bug Fixes](#bug-fixes-1)
* [v11.5.0](#v1150)
* [Enhancements](#enhancements-1)
* [Bug Fixes](#bug-fixes-1)
* [Bug Fixes](#bug-fixes-2)
* [v11.4.0](#v1140)
* [Enhancements](#enhancements-2)
* [v11.3.0](#v1130)
* [Enhancements](#enhancements-3)
* [Bug Fixes](#bug-fixes-2)
* [Bug Fixes](#bug-fixes-3)
* [v11.2.0](#v1120)
* [Enhancements](#enhancements-4)
* [Bug Fixes](#bug-fixes-3)
* [Bug Fixes](#bug-fixes-4)
* [v11.1.0](#v1110)
* [Enhancements](#enhancements-5)
* [Bug Fixes](#bug-fixes-4)
* [v11.0.1](#v1101)
* [Bug Fixes](#bug-fixes-5)
* [v11.0.1](#v1101)
* [Bug Fixes](#bug-fixes-6)
* [v11.0.0](#v1100)
* [Enhancements](#enhancements-6)
* [Bug Fixes](#bug-fixes-6)
* [Bug Fixes](#bug-fixes-7)
* [Incompatible Changes](#incompatible-changes)
* [v10.6.0](#v1060)
* [Enhancements](#enhancements-7)
* [Bug Fixes](#bug-fixes-7)
* [v10.5.1](#v1051)
* [Bug Fixes](#bug-fixes-8)
* [v10.5.1](#v1051)
* [Bug Fixes](#bug-fixes-9)
* [v10.5.0](#v1050)
* [Enhancements](#enhancements-8)
* [Bug Fixes](#bug-fixes-9)
* [Bug Fixes](#bug-fixes-10)
* [v10.4.0](#v1040)
* [Enhancements](#enhancements-9)
* [Bug Fixes](#bug-fixes-10)
* [Bug Fixes](#bug-fixes-11)
* [v10.3.0](#v1030)
* [Enhancements](#enhancements-10)
* [Bug Fixes](#bug-fixes-11)
* [Bug Fixes](#bug-fixes-12)
* [v10.2.0](#v1020)
* [Enhancements](#enhancements-11)
* [Bug Fixes](#bug-fixes-12)
* [Bug Fixes](#bug-fixes-13)
* [v10.1.0](#v1010)
* [Enhancements](#enhancements-12)
* [Bug Fixes](#bug-fixes-13)
* [v10.0.1](#v1001)
* [Bug Fixes](#bug-fixes-14)
* [v10.0.1](#v1001)
* [Bug Fixes](#bug-fixes-15)
* [v10.0.0](#v1000)
* [Enhancements](#enhancements-13)
* [Bug Fixes](#bug-fixes-15)
* [Bug Fixes](#bug-fixes-16)
* [Incompatible Changes](#incompatible-changes-1)
* [v9.0.0](#v900)
* [Enhancements](#enhancements-14)
* [Bug Fixes](#bug-fixes-16)
* [Bug Fixes](#bug-fixes-17)
* [Incompatible Changs](#incompatible-changs)
* [v8.1.0](#v810)
* [Enhancements](#enhancements-15)
* [Bug Fixes](#bug-fixes-17)
* [Bug Fixes](#bug-fixes-18)
* [v8.0.0](#v800)
* [Enhancements](#enhancements-16)
* [Bug Fixes](#bug-fixes-18)
* [Bug Fixes](#bug-fixes-19)
* [Incompatible Changes](#incompatible-changes-2)
* [v7.5.0](#v750)
* [Enhancements](#enhancements-17)
* [Bug Fixes](#bug-fixes-19)
* [Bug Fixes](#bug-fixes-20)
* [v7.4.0](#v740)
* [Enhancements](#enhancements-18)
* [Bug Fixes](#bug-fixes-20)
* [Bug Fixes](#bug-fixes-21)
* [v7.3.0](#v730)
* [Enhancements](#enhancements-19)
* [Bug Fixes](#bug-fixes-21)
* [v7.2.1](#v721)
* [Bug Fixes](#bug-fixes-22)
* [v7.2.1](#v721)
* [Bug Fixes](#bug-fixes-23)
* [v7.2.0](#v720)
* [Enhancements](#enhancements-20)
* [Bug Fixes](#bug-fixes-23)
* [Bug Fixes](#bug-fixes-24)
* [v7.1.0](#v710)
* [Enhancements](#enhancements-21)
* [Bug Fixes](#bug-fixes-24)
* [Bug Fixes](#bug-fixes-25)
* [v7.0.0](#v700)
* [Enhancements](#enhancements-22)
* [Bug Fixes](#bug-fixes-25)
* [Bug Fixes](#bug-fixes-26)
* [Incompatible Changes](#incompatible-changes-3)
* [v6.7.0](#v670)
* [Enhancements](#enhancements-23)
* [Bug Fixes](#bug-fixes-26)
* [Bug Fixes](#bug-fixes-27)
* [v6.6.0](#v660)
* [Enhancements](#enhancements-24)
* [Bug Fixes](#bug-fixes-27)
* [v6.5.1](#v651)
* [Bug Fixes](#bug-fixes-28)
* [v6.5.1](#v651)
* [Bug Fixes](#bug-fixes-29)
* [v6.5.0](#v650)
* [Enhancements](#enhancements-25)
* [Bug Fixes](#bug-fixes-29)
* [Bug Fixes](#bug-fixes-30)
* [v6.4.0](#v640)
* [Enhancements](#enhancements-26)
* [Bug Fixes](#bug-fixes-30)
* [Bug Fixes](#bug-fixes-31)
* [v6.3.0](#v630)
* [Enhancements](#enhancements-27)
* [Bug Fixes](#bug-fixes-31)
* [Bug Fixes](#bug-fixes-32)
* [v6.2.0](#v620)
* [Enhancements](#enhancements-28)
* [Bug Fixes](#bug-fixes-32)
* [v6.1.1](#v611)
* [Bug Fixes](#bug-fixes-33)
* [v6.1.1](#v611)
* [Bug Fixes](#bug-fixes-34)
* [v6.1.0](#v610)
* [Enhancements](#enhancements-29)
* [Bug Fixes](#bug-fixes-34)
* [Bug Fixes](#bug-fixes-35)
* [v6.0.0](#v600)
* [Enhancements](#enhancements-30)
* [Bug Fixes](#bug-fixes-35)
* [Bug Fixes](#bug-fixes-36)
* [Incompatible Changes](#incompatible-changes-4)
* [v5.1.0](#v510)
* [Enhancements](#enhancements-31)
* [Bug Fixes](#bug-fixes-36)
* [Bug Fixes](#bug-fixes-37)
* [v5.0.0](#v500)
* [Enhancements](#enhancements-32)
* [Bug Fixes](#bug-fixes-37)
* [Bug Fixes](#bug-fixes-38)
* [Incompatible Changes](#incompatible-changes-5)
* [v4.7.0](#v470)
* [Enhancements](#enhancements-33)
* [Bug Fixes](#bug-fixes-38)
* [Bug Fixes](#bug-fixes-39)
* [v4.6.0](#v460)
* [Enhancements](#enhancements-34)
* [Bug Fixes](#bug-fixes-39)
* [Bug Fixes](#bug-fixes-40)
* [v4.5.0](#v450)
* [Enhancements](#enhancements-35)
* [v4.4.0](#v440)
* [Enhancements](#enhancements-36)
* [Bug Fixes](#bug-fixes-40)
* [Bug Fixes](#bug-fixes-41)
* [v4.3.0](#v430)
* [Enhancements](#enhancements-37)
* [Bug Fixes](#bug-fixes-41)
* [Bug Fixes](#bug-fixes-42)
* [v4.2.0](#v420)
* [Enhancements](#enhancements-38)
* [Bug Fixes](#bug-fixes-42)
* [Bug Fixes](#bug-fixes-43)
* [v4.1.0](#v410)
* [Enhancements](#enhancements-39)
* [Bug Fixes](#bug-fixes-43)
* [Bug Fixes](#bug-fixes-44)
* [v4.0.0](#v400)
* [Enhancements](#enhancements-40)
* [Bug Fixes](#bug-fixes-44)
* [Bug Fixes](#bug-fixes-45)
* [Incompatible Changes](#incompatible-changes-6)
* [v3.0.1](#v301)
* [Bug Fixes](#bug-fixes-45)
* [Bug Fixes](#bug-fixes-46)
* [v3.0.0](#v300)
* [Enhancements](#enhancements-41)
* [Bug Fixes](#bug-fixes-46)
* [Bug Fixes](#bug-fixes-47)
* [Incompatible Changes](#incompatible-changes-7)
* [v2.2.0](#v220)
* [Enhancement](#enhancement)
* [Bug Fixes](#bug-fixes-47)
* [Bug Fixes](#bug-fixes-48)
* [v2.1.0](#v210)
* [Enhancement](#enhancement-1)
* [Bug Fixes](#bug-fixes-48)
* [Bug Fixes](#bug-fixes-49)
* [v2.0.0](#v200)
* [Enhancements](#enhancements-42)
* [Bug Fixes](#bug-fixes-49)
* [Bug Fixes](#bug-fixes-50)
* [Incompatible Changes](#incompatible-changes-8)
* [v1.2.1](#v121)
* [Enhancements](#enhancements-43)
* [Bug Fixes](#bug-fixes-50)
* [Bug Fixes](#bug-fixes-51)
* [v1.2.0](#v120)
* [Enhancements](#enhancements-44)
* [Bug Fixes](#bug-fixes-51)
* [Bug Fixes](#bug-fixes-52)
* [v1.1.0](#v110)
* [Enhancements](#enhancements-45)
* [v1.0.0](#v100)
* [Enhancements](#enhancements-46)
* [Bug Fixes](#bug-fixes-52)
* [Bug Fixes](#bug-fixes-53)
* [Incompatible Fixes](#incompatible-fixes)
* [v0.3.5](#v035)
* [Enhancements](#enhancements-47)
* [Bug Fixes](#bug-fixes-53)
* [Bug Fixes](#bug-fixes-54)
* [v0.3.4](#v034)
* [Enhancements](#enhancements-48)
* [v0.3.3](#v033)
* [Enhancements](#enhancements-49)
* [v0.3.2](#v032)
* [Bug Fixes](#bug-fixes-54)
* [Bug Fixes](#bug-fixes-55)
* [v0.3.1](#v031)
* [Enhancements](#enhancements-50)
* [v0.3.0](#v030)
* [Enhancements](#enhancements-51)
* [Incompatible Changes](#incompatible-changes-9)
* [v0.2.1](#v021)
* [Enhancements](#enhancements-52)
* [Bug Fixes](#bug-fixes-55)
* [Bug Fixes](#bug-fixes-56)
* [v0.2.0](#v020)
* [Enhancements](#enhancements-53)
* [Incompatible Changes](#incompatible-changes-10)
* [v0.1.4](#v014)
* [Enhancements](#enhancements-54)
* [Bug Fixes](#bug-fixes-56)
* [v0.1.3](#v013)
* [Bug Fixes](#bug-fixes-57)
* [v0.1.3](#v013)
* [Bug Fixes](#bug-fixes-58)
* [v0.1.2](#v012)
* [Enhancements](#enhancements-55)
* [v0.1.1](#v011)
* [Bug Fixes](#bug-fixes-58)
* [Bug Fixes](#bug-fixes-59)
* [v0.1.0](#v010)
* [Enhancements](#enhancements-56)
* [Bug Fixes](#bug-fixes-59)
* [Bug Fixes](#bug-fixes-60)
* [v0.0.3](#v003)
* [Enhancements](#enhancements-57)
* [v0.0.2](#v002)
* [Enhancements](#enhancements-58)
* [Bug Fixes](#bug-fixes-60)
* [Bug Fixes](#bug-fixes-61)

## v11.6.1
### Bug Fixes
* [#1762](https://github.com/KronicDeth/intellij-elixir/pull/1762) - [@KronicDeth](https://github.com/KronicDeth)
* Support diffs in pattern matching added in Elixir `1.10.0` in the ExUnit formatter. Ports [elixir-lang/elixir@98c6bba436cc4833363295e5fedd3f819504d79d](https://github.com/elixir-lang/elixir/commit/98c6bba436cc4833363295e5fedd3f819504d79d).

## v11.6.0
### Enhancements
Expand Down
14 changes: 14 additions & 0 deletions resources/META-INF/changelog.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
<html>
<body>
<h1>v11.6.1</h1>
<ul>
<li>
<p>Bug Fixes</p>
<ul>
<li>
Support diffs in pattern matching added in Elixir <code>1.10.0</code> in the ExUnit formatter. Ports
<a href="https://github.com/elixir-lang/elixir/commit/98c6bba436cc4833363295e5fedd3f819504d79d">
elixir-lang/elixir@<tt>98c6bba</tt>
</a>.
</li>
</ul>
</li>
</ul>
<h1>v11.6.0</h1>
<ul>
<li>
Expand Down
19 changes: 15 additions & 4 deletions resources/exunit/1.6.0/team_city_ex_unit_formatting.ex
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,23 @@ defmodule TeamCityExUnitFormatting do
"#{head}#{Enum.map(tail, &String.capitalize/1)}"
end

@colors [
diff_delete: :red,
diff_delete_whitespace: IO.ANSI.color_background(2, 0, 0),
diff_insert: :green,
diff_insert_whitespace: IO.ANSI.color_background(0, 2, 0)
]

defp colorize(escape, string) do
[escape, string, :reset]
|> IO.ANSI.format_fragment(true)
|> IO.iodata_to_binary()
end

defp colorize_doc(escape, doc) do
Inspect.Algebra.color(doc, escape, %Inspect.Opts{syntax_colors: @colors})
end

# Must escape certain characters
# see: https://confluence.jetbrains.com/display/TCD9/Build+Script+Interaction+with+TeamCity
defp escape_output(s) when not is_binary(s), do: escape_output("#{s}")
Expand Down Expand Up @@ -290,13 +301,13 @@ defmodule TeamCityExUnitFormatting do

defp formatter(:location_info, msg), do: colorize([:bright, :black], msg)

defp formatter(:diff_delete, msg), do: colorize(:red, msg)
defp formatter(:diff_delete, doc), do: colorize_doc(:diff_delete, doc)

defp formatter(:diff_delete_whitespace, msg), do: colorize(IO.ANSI.color_background(2, 0, 0), msg)
defp formatter(:diff_delete_whitespace, doc), do: colorize_doc(:diff_delete_whitespace, doc)

defp formatter(:diff_insert, msg), do: colorize(:green, msg)
defp formatter(:diff_insert, doc), do: colorize_doc(:diff_insert, doc)

defp formatter(:diff_insert_whitespace, msg), do: colorize(IO.ANSI.color_background(0, 2, 0), msg)
defp formatter(:diff_insert_whitespace, doc), do: colorize_doc(:diff_insert_whitespace, doc)

defp formatter(:blame_diff, msg), do: colorize(:red, msg)

Expand Down