all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Randy Taylor <dev@rjt.dev>
To: Yuan Fu <casouri@gmail.com>
Cc: 62109@debbugs.gnu.org
Subject: bug#62109: 29.0.60; rust-ts-mode missing indentation for patterns
Date: Sat, 11 Mar 2023 02:03:13 +0000	[thread overview]
Message-ID: <EiWkQPwRiSaBAwp2dZwXnqFlCxQ3fiMNJ1OhOF0uf9J_vyc5BrU9FF4N1FRZqWYtqu1lXN0UHdc1TOIvtJO5HHzmkJk-JLpJ7ZMNkiAxFm8=@rjt.dev> (raw)
In-Reply-To: <2E6E52D0-723C-4CC0-8FE2-AE291E9048B6@gmail.com>

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

On Friday, March 10th, 2023 at 17:32, Yuan Fu <casouri@gmail.com> wrote:
> 
> X-Debbugs-CC: dev@rjt.dev
> 
> Try this snippet:
> 
> fn main() {
> match &cli.command {
> Commands::Run {
> a,
> b,
> c,
> d,
> } => todo!(),
> 
> }
> }
> 
> 
> The a, b, c, d don’t have corresponding indentation rules. I can add
> some myself, but I’m not sure where to add and what’s the best rule to
> add.
> 
> Yuan
> 

Thanks for the report, I've attached a patch fixing it.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-missing-indentation-rule-for-rust-ts-mode.patch --]
[-- Type: text/x-patch; name=0001-Add-missing-indentation-rule-for-rust-ts-mode.patch, Size: 1100 bytes --]

From 419ea4dad329cb464c19ef071d326cc6420888ac Mon Sep 17 00:00:00 2001
From: Randy Taylor <dev@rjt.dev>
Date: Fri, 10 Mar 2023 20:56:04 -0500
Subject: [PATCH] Add missing indentation rule for rust-ts-mode

* lisp/progmodes/rust-ts-mode.el (rust-ts-mode--indent-rules): Add
missing rule.
---
 lisp/progmodes/rust-ts-mode.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/progmodes/rust-ts-mode.el b/lisp/progmodes/rust-ts-mode.el
index 696c2633231..a07a6649dc2 100644
--- a/lisp/progmodes/rust-ts-mode.el
+++ b/lisp/progmodes/rust-ts-mode.el
@@ -91,6 +91,7 @@ rust-ts-mode--indent-rules
      ((parent-is "let_declaration") parent-bol rust-ts-mode-indent-offset)
      ((parent-is "macro_definition") parent-bol rust-ts-mode-indent-offset)
      ((parent-is "parameters") parent-bol rust-ts-mode-indent-offset)
+     ((parent-is "struct_pattern") parent-bol rust-ts-mode-indent-offset)
      ((parent-is "token_tree") parent-bol rust-ts-mode-indent-offset)
      ((parent-is "use_list") parent-bol rust-ts-mode-indent-offset)))
   "Tree-sitter indent rules for `rust-ts-mode'.")
-- 
2.39.2


  reply	other threads:[~2023-03-11  2:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10 22:32 bug#62109: 29.0.60; rust-ts-mode missing indentation for patterns Yuan Fu
2023-03-11  2:03 ` Randy Taylor [this message]
2023-03-11  2:04   ` Randy Taylor
2023-03-11 23:53     ` Yuan Fu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='EiWkQPwRiSaBAwp2dZwXnqFlCxQ3fiMNJ1OhOF0uf9J_vyc5BrU9FF4N1FRZqWYtqu1lXN0UHdc1TOIvtJO5HHzmkJk-JLpJ7ZMNkiAxFm8=@rjt.dev' \
    --to=dev@rjt.dev \
    --cc=62109@debbugs.gnu.org \
    --cc=casouri@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.