unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#63110: 30.0.50; [PATCH] Improve call indentation for elixir-ts-mode
@ 2023-04-27 10:29 Wilhelm Kirschbaum
  2023-04-29  9:17 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: Wilhelm Kirschbaum @ 2023-04-27 10:29 UTC (permalink / raw)
  To: 63110

[-- Attachment #1: Type: text/plain, Size: 99 bytes --]


Improves indentation for call's when the first argument is on the 
same
line as the call itself.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Improve call indentation for elixir-ts-mode --]
[-- Type: text/x-patch, Size: 2066 bytes --]

From 3a03e1ba99d8d28b302f0130f07bed17ae2a0d06 Mon Sep 17 00:00:00 2001
From: Wilhelm H Kirschbaum <wkirschbaum@gmail.com>
Date: Thu, 27 Apr 2023 12:13:25 +0200
Subject: [PATCH] Improve call indentation for elixir-ts-mode

* lisp/progmodes/elixir-ts-mode.el
(elixir-ts--indent-rules): Change match order.

* test/lisp/progmodes/elixir-ts-mode-resources/indent.erts:
Add test case.
---
 lisp/progmodes/elixir-ts-mode.el                   |  2 +-
 .../progmodes/elixir-ts-mode-resources/indent.erts | 14 +++++++++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/elixir-ts-mode.el b/lisp/progmodes/elixir-ts-mode.el
index 47f53043af3..7175fe4bff8 100644
--- a/lisp/progmodes/elixir-ts-mode.el
+++ b/lisp/progmodes/elixir-ts-mode.el
@@ -257,7 +257,6 @@ elixir-ts--indent-rules
        ((node-is "^stab_clause$") parent-bol ,offset)
        ((query ,elixir-ts--capture-operator-parent) grand-parent 0)
        ((node-is "^when$") parent 0)
-       ((node-is "^keywords$") parent-bol ,offset)
        ((parent-is "^body$")
         (lambda (node parent _)
           (save-excursion
@@ -272,6 +271,7 @@ elixir-ts--indent-rules
         ,'elixir-ts--argument-indent-anchor
         ,'elixir-ts--argument-indent-offset)
        ;; Handle incomplete maps when parent is ERROR.
+       ((node-is "^keywords$") parent-bol ,offset)
        ((n-p-gp "^binary_operator$" "ERROR" nil) parent-bol 0)
        ;; When there is an ERROR, just indent to prev-line.
        ((parent-is "ERROR") prev-line ,offset)
diff --git a/test/lisp/progmodes/elixir-ts-mode-resources/indent.erts b/test/lisp/progmodes/elixir-ts-mode-resources/indent.erts
index 4eb6e768b96..1f855d3c977 100644
--- a/test/lisp/progmodes/elixir-ts-mode-resources/indent.erts
+++ b/test/lisp/progmodes/elixir-ts-mode-resources/indent.erts
@@ -193,7 +193,19 @@ tuple = {
 }
 =-=-=
 
-Name: Spec and method
+Name: Call with keywords
+
+=-=
+def foo() do
+  bar(:one,
+      :two,
+      one: 1,
+      two: 2
+  )
+end
+=-=-=
+
+Name: Call with @spec
 
 =-=
 @spec foobar(
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#63110: 30.0.50; [PATCH] Improve call indentation for elixir-ts-mode
  2023-04-27 10:29 bug#63110: 30.0.50; [PATCH] Improve call indentation for elixir-ts-mode Wilhelm Kirschbaum
@ 2023-04-29  9:17 ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2023-04-29  9:17 UTC (permalink / raw)
  To: Wilhelm Kirschbaum; +Cc: 63110-done

> From: Wilhelm Kirschbaum <wkirschbaum@gmail.com>
> Date: Thu, 27 Apr 2023 12:29:58 +0200
> 
> Improves indentation for call's when the first argument is on the
> same line as the call itself.

Thanks, installed.  Closing the bug.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-04-29  9:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-27 10:29 bug#63110: 30.0.50; [PATCH] Improve call indentation for elixir-ts-mode Wilhelm Kirschbaum
2023-04-29  9:17 ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).