Subject: Re: bug#76704: 30.1; Indentation of braces on separate line in js-ts-mode

From: Vincenzo Pupillo <[email-masked]>
Date: Mon, 07 Apr 2025 11:39:25 +0200

Ciao Fabian,

In data lunedì 7 aprile 2025 09:33:26 Ora legale dell’Europa centrale, Fabian 
Brosda ha scritto:
> Hi Vincenzo,
> 
> thanks for the new patch.  The results look very good and I couldn't
> find any example, which gives unexpected indentation in js-ts-mode now.
> 
> Regarding the use of js-switch-indent-offset for js-mode, the results
> are still different, depending on the brace being on the same line or
> not.  Should I open a separate bug report for this?

whith js-switch-indent-offset = 2 and js-indent-offset = 4, with js-mode the 
result is:

function switch_test(a)
{
    switch (a) {
      case 1:
          x;
          break;
      case 2:
          y;
          break;
      default:
          z;
          break;
    }

    switch (a)
    {
        case 1:
        x;
        break;
        case 2:
        y;
        break;
        default:
        z;
        break;
    }
}

js-ts-mode the result is:

function switch_test(a)
{
    switch (a) {
      case 1:
          x;
          break;
      case 2:
          y;
          break;
      default:
          z;
          break;
    }

    switch (a)
    {
      case 1:
          x;
          break;
      case 2:
          y;
          break;
      default:
          z;
          break;
    }
}

For me the js-ts mode is correct, but I am not an expert. 
@Daniel WDYT?

Vincenzo

> 
> Again thanks for your time and the prompt updates.
> 
> Fabian