Subject: Re: bug#62109: 29.0.60; rust-ts-mode missing indentation for patterns

From: Randy Taylor <[email-masked]>
Date: Sat, 11 Mar 2023 02:04:59 +0000

On Friday, March 10th, 2023 at 21:03, Randy Taylor <[email-masked]> wrote:
> 
> On Friday, March 10th, 2023 at 17:32, Yuan Fu [email-masked] wrote:
> 
> > X-Debbugs-CC: [email-masked]
> > 
> > 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.

Sorry, forgot to include the bug #. Same patch with the bug # this time!

From 16522d2626d3ec5d9de70d3a90ecd137258ed98f Mon Sep 17 00:00:00 2001
From: Randy Taylor <[email-masked]>
Date: Fri, 10 Mar 2023 20:56:04 -0500
Subject: [PATCH] Add missing indentation rule for rust-ts-mode (Bug#62109)

* 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