elixir-editors / elixir-editors/emacs-elixir
Incorrect indentation in try/rescue blocks.
- Dominant language
- Emacs Lisp
- Stars
- 454
- Forks
- 93
- PR merge metrics
- No merged PRs in 30d
Description
For example:
```elixir
defp compute_temperature(json) do
try do
temp = (json["main"]["temp"] - 273.15) |> Float.round(1)
{:ok, temp}
raise ArgumentError, message: "invalid argument foo"
rescue
error ->
IO.puts "Error! in #{__MODULE__} #{inspect error}"
:error
end
end
```
The final `:error` should have the same indentation as the `IO.puts` statement. However, elixir-mode indents it as follows:
```elixir
defp compute_temperature(json) do
try do
temp = (json["main"]["temp"] - 273.15) |> Float.round(1)
{:ok, temp}
raise ArgumentError, message: "invalid argument foo"
rescue
error ->
IO.puts "Error! in #{__MODULE__} #{inspect error}"
:error
end
end
```
Notice that the final `:error` is incorrectly indented.
Contributor guide
Assessment
This issue has not been assessed yet.