bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#67246: 30.0.50; elixir-ts-mode uses faces inconsistently


From: Wilhelm Kirschbaum
Subject: bug#67246: 30.0.50; elixir-ts-mode uses faces inconsistently
Date: Mon, 04 Dec 2023 19:50:06 +0200
User-agent: mu4e 1.9.3; emacs 30.0.50


Andrey Listopadov <andreyorst@gmail.com> writes:

Dmitry Gutov <dmitry@gutov.dev> writes:

On 27/11/2023 19:59, Wilhelm Kirschbaum wrote:
Here is a patch to address numerous issues flagged on Elixir slack, Github and in this thread.  It will not be perfect, but since the changes are pretty large I want to get this in and then we can pick on
specific issues afterwards if that makes sense?

Thank you. No problem, pushed to master.

Thanks! The code now seems to be properly highlighted. I've just tested the update and noticed that putting the `do' keyword on a separate line
breaks indentation. Here's an example:

defmodule Foo
  do # case A
  @moduledoc """
  Test module.
  """

  defp a(x), do: a(x, 0)

  defp a(x, y),
       do: a(x, 0, 0) # case B

  defp a(x, y, z)
do # case C
  x + y + z
end
  end

I have intentionally introduced incorrect indentation before the first `do' keyword (case A), but the matching `end' keyword was indented automatically when I called `indent-region' on the whole buffer. The case B seems to be indented incorrectly, the default formatter would
indent such `do:' by just two spaces after the parent `defp'.

The third case C is similar to case A, except the indentation was provided by Emacs, meaning, after pressing the RET key before the `do' keyword, Emacs had put the keyword at the BOL. If there are no `do' after the closing parenthesis, the automatic indentation is correct.

I'm not sure if these problems were introduced by the changes, or were present before, and if I should send a separeate bug report for them, as
this isn't strictly related to highlighting, just with the
tree-sitter-based indentation.

The indention should be another issue imo. The changes in this thread
would not impact indentation.

Indentation is probably slightly more complicated than fontification, but planning to take some time in a couple of weeks to fix some issues.

Wilhelm





reply via email to

[Prev in Thread] Current Thread [Next in Thread]