GNU bug report logs - #26001
js-mode: JSX indentation after fat-arrow attribute

Previous Next

Package: emacs;

Reported by: Dražen <kermit666 <at> gmail.com>

Date: Mon, 6 Mar 2017 16:19:03 UTC

Severity: minor

Merged with 24896, 30225, 32158

Found in versions 26.1, 27.0.50

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 26001 in the body.
You can then email your comments to 26001 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#26001; Package emacs. (Mon, 06 Mar 2017 16:19:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dražen <kermit666 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 06 Mar 2017 16:19:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Dražen <kermit666 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: js-mode: JSX indentation after fat-arrow attribute
Date: Mon, 06 Mar 2017 14:40:56 +0000
[Message part 1 (text/plain, inline)]
As mentioned in
https://github.com/mooz/js2-mode/issues/389#issuecomment-271869380 , there
seems to be a bug in the way js-mode (at least the folks there pointed me
at js-mode) indents JSX JavaScript.

When I'm doing a map with JSX syntax I'm getting:

render() {
    const messages = this.state.messages.map(
        message => <Message key={message.id}
        text={message.text}
        mine={message.mine} />
    );    return messages;
}

I'd ideally expect something like:

render() {
    const messages = this.state.messages.map(
        message => <Message key={message.id}
                            text={message.text}
                            mine={message.mine} />
    );    return messages;
}

It's even odder when I try to leave the argument to the arrow function in
the line above:

render() {
    const messages = this.state.messages.map(message =>
                                             <Message key={message.timestamp}
                                             text={message.text}
                                             mine={message.mine} />
                                            );    return messages;
}

For this second case, I'd hope to get:

render() {
    const messages = this.state.messages.map(message =>
        <Message key={message.timestamp}
                 text={message.text}
                 mine={message.mine} />
    );    return messages;
}

(I get such results if I wrap the return expression in parentheses)
[Message part 2 (text/html, inline)]

Forcibly Merged 24896 26001. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 06 Mar 2017 17:41:01 GMT) Full text and rfc822 format available.

Forcibly Merged 24896 26001 30225. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 23 Jan 2018 01:55:01 GMT) Full text and rfc822 format available.

Forcibly Merged 24896 26001 30225 32158. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 14 Jul 2018 16:20:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26001; Package emacs. (Wed, 05 Jun 2019 02:59:02 GMT) Full text and rfc822 format available.

Message #14 received at 26001 <at> debbugs.gnu.org (full text, mbox):

From: Jackson Ray Hamilton <jackson <at> jacksonrayhamilton.com>
To: 26001 <at> debbugs.gnu.org
Cc: kermit666 <at> gmail.com
Subject: Re: bug#26001: js-mode: JSX indentation after fat-arrow attribute
Date: Tue, 4 Jun 2019 19:57:56 -0700
Hi Dražen,

A set of changes I pushed to the Emacs master branch 2 months ago should 
resolve this issue.  (First fixed in 4b305bb185, but there were several 
commits after that when I broke/fixed it again.  The master branch is 
your best bet.)

Note that if you’re currently using js2-mode, you’ll have to use js-mode 
instead.  The fix is not currently available for JS2, except with 
js2-minor-mode.

Jackson





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#26001; Package emacs. (Wed, 05 Jun 2019 09:33:02 GMT) Full text and rfc822 format available.

Message #17 received at 26001 <at> debbugs.gnu.org (full text, mbox):

From: Dražen <kermit666 <at> gmail.com>
To: Jackson Ray Hamilton <jackson <at> jacksonrayhamilton.com>
Cc: 26001 <at> debbugs.gnu.org
Subject: Re: bug#26001: js-mode: JSX indentation after fat-arrow attribute
Date: Wed, 5 Jun 2019 11:33:05 +0200
[Message part 1 (text/plain, inline)]
Hi Jackson, great! Thanks for the update.

Cheers!

On Wed, Jun 5, 2019 at 4:57 AM Jackson Ray Hamilton <
jackson <at> jacksonrayhamilton.com> wrote:

> Hi Dražen,
>
> A set of changes I pushed to the Emacs master branch 2 months ago should
> resolve this issue.  (First fixed in 4b305bb185, but there were several
> commits after that when I broke/fixed it again.  The master branch is
> your best bet.)
>
> Note that if you’re currently using js2-mode, you’ll have to use js-mode
> instead.  The fix is not currently available for JS2, except with
> js2-minor-mode.
>
> Jackson
>
>
[Message part 2 (text/html, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 04 Jul 2019 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 270 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.