all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Yuan Fu <casouri@gmail.com>
To: Randy Taylor <dev@rjt.dev>
Cc: 62109-done@debbugs.gnu.org
Subject: bug#62109: 29.0.60; rust-ts-mode missing indentation for patterns
Date: Sat, 11 Mar 2023 15:53:21 -0800	[thread overview]
Message-ID: <5559DA03-EC90-4878-9DA6-30A034AF0E9F@gmail.com> (raw)
In-Reply-To: <bFMpXX3CSN6cc0g_d14I3IGsp0uT13NghHx02O1PhvptjCvDFv708bZ5CR_Dsl2xmFI82ZAFVyeLygxbsbMEXMrfrDGBdGHNzZHnIKE7Eyg=@rjt.dev>

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



> On Mar 10, 2023, at 6:04 PM, Randy Taylor <dev@rjt.dev> wrote:
> 
> On Friday, March 10th, 2023 at 21:03, Randy Taylor <dev@rjt.dev> wrote:
>> 
>> 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.
> 
> Sorry, forgot to include the bug #. Same patch with the bug # this time!
> 

[-- Attachment #2: 0001-Add-missing-indentation-rule-for-rust-ts-mode-Bug-62.patch --]
[-- Type: application/octet-stream, Size: 1138 bytes --]

From 16522d2626d3ec5d9de70d3a90ecd137258ed98f 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 (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


[-- Attachment #3: Type: text/plain, Size: 40 bytes --]



Brilliant, thanks! I applied it.

Yuan

      reply	other threads:[~2023-03-11 23:53 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
2023-03-11  2:04   ` Randy Taylor
2023-03-11 23:53     ` Yuan Fu [this message]

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=5559DA03-EC90-4878-9DA6-30A034AF0E9F@gmail.com \
    --to=casouri@gmail.com \
    --cc=62109-done@debbugs.gnu.org \
    --cc=dev@rjt.dev \
    /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.