Subject: bug#70023: closed (Re: bug#70023: [PATCH] Add typescript-ts-mode indentation for interface bodies)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 30 Jun 2024 05:57:02 +0000

Your bug report

#70023: [PATCH] Add typescript-ts-mode indentation for interface bodies

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
70023: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=70023
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#70023: [PATCH] Add typescript-ts-mode indentation for interface bodies
From: Stefan Kangas <[email-masked]>
To: Theodor Thornhill <[email-masked]>
Cc: Noah Peart <[email-masked]>, [email-masked]
Date: Sat, 29 Jun 2024 22:55:42 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

Theodor Thornhill <[email-masked]> writes:

> Noah Peart <[email-masked]> writes:
>
>> Tags: patch
>>
>> Adds missing indentation for typescript interfaces.
>>
>> Currently, there is no indentation for property signatures in typescript
>> interfaces.
>>
>> To reproduce, call `M-x (my-test-typescript-indent)`
>>
>>     (defun my-test-typescript-indent ()
>>       (interactive)
>>       (typescript-ts-mode)
>>       (setq-local typescript-ts-mode-indent-offset 4)
>>       (indent-region (point-min) (point-max)))
>>
>
> [...]
>
> Pushed in bcf6dd6e266222a293e359430afdf3a2dc18369c. I also added a test
> confirming the behavior.
>
> As a small aside, this node type was added very recently. Until now we
> had a rule for it in 'object'

I'm therefore closing this bug report.

Subject: [PATCH] Add typescript-ts-mode indentation for interface bodies
From: Noah Peart <[email-masked]>
To: [email-masked]
Date: Tue, 26 Mar 2024 23:20:18 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

Tags: patch

Adds missing indentation for typescript interfaces.

Currently, there is no indentation for property signatures in typescript
interfaces.

To reproduce, call `M-x (my-test-typescript-indent)`

    (defun my-test-typescript-indent ()
      (interactive)
      (typescript-ts-mode)
      (setq-local typescript-ts-mode-indent-offset 4)
      (indent-region (point-min) (point-max)))

in buffer with the following typescript code:

    interface Foo {
    foo: string;   // no matching indent rule
    bar?: boolean; // no matching indent rule
    }

In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.33, cairo version 1.16.0) of 2024-03-24 built on noah-X580VD
Repository revision: c5de73a95a6ecefe46fe1ac07da8e83032be7f5b
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101004
System Description: Ubuntu 22.04.4 LTS

Configured using:
 'configure --prefix=/usr/local --with-modules --with-tree-sitter
--with-threads --with-x-toolkit=gtk3 --with-xwidgets --with-gnutls
--with-json --with-mailutils --with-jpeg --with-png --with-rsvg
--with-tiff --with-xml2 --with-xpm --with-imagemagick CC=gcc-12
CXX=gcc-12'
From a39f2364973998318b56d91cb2801a06b237b88a Mon Sep 17 00:00:00 2001
From: Noah Peart <[email-masked]>
Date: Tue, 26 Mar 2024 22:44:48 -0700
Subject: [PATCH] Add typescript-ts-mode indentation for interface bodies

* lisp/progmodes/typescript-ts-mode.el
(typescript-ts-mode--indent-rules): Add indentation rule for
interface bodies.
---
 lisp/progmodes/typescript-ts-mode.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el
index ea4f6417c5a..ab1d76ab20e 100644
--- a/lisp/progmodes/typescript-ts-mode.el
+++ b/lisp/progmodes/typescript-ts-mode.el
@@ -124,6 +124,7 @@ typescript-ts-mode--indent-rules
      ((parent-is "object_type") parent-bol typescript-ts-mode-indent-offset)
      ((parent-is "enum_body") parent-bol typescript-ts-mode-indent-offset)
      ((parent-is "class_body") parent-bol typescript-ts-mode-indent-offset)
+     ((parent-is "interface_body") parent-bol typescript-ts-mode-indent-offset)
      ((parent-is "arrow_function") parent-bol typescript-ts-mode-indent-offset)
      ((parent-is "parenthesized_expression") parent-bol typescript-ts-mode-indent-offset)
      ((parent-is "binary_expression") parent-bol typescript-ts-mode-indent-offset)
-- 
2.34.1