unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#26001: js-mode: JSX indentation after fat-arrow attribute
@ 2017-03-06 14:40 Dražen
  2019-06-05  2:57 ` Jackson Ray Hamilton
  0 siblings, 1 reply; 3+ messages in thread
From: Dražen @ 2017-03-06 14:40 UTC (permalink / raw)
  To: 26001

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

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)

[-- Attachment #2: Type: text/html, Size: 20159 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#26001: js-mode: JSX indentation after fat-arrow attribute
  2017-03-06 14:40 bug#26001: js-mode: JSX indentation after fat-arrow attribute Dražen
@ 2019-06-05  2:57 ` Jackson Ray Hamilton
  2019-06-05  9:33   ` Dražen
  0 siblings, 1 reply; 3+ messages in thread
From: Jackson Ray Hamilton @ 2019-06-05  2:57 UTC (permalink / raw)
  To: 26001; +Cc: kermit666

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






^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#26001: js-mode: JSX indentation after fat-arrow attribute
  2019-06-05  2:57 ` Jackson Ray Hamilton
@ 2019-06-05  9:33   ` Dražen
  0 siblings, 0 replies; 3+ messages in thread
From: Dražen @ 2019-06-05  9:33 UTC (permalink / raw)
  To: Jackson Ray Hamilton; +Cc: 26001

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

Hi Jackson, great! Thanks for the update.

Cheers!

On Wed, Jun 5, 2019 at 4:57 AM Jackson Ray Hamilton <
jackson@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
>
>

[-- Attachment #2: Type: text/html, Size: 950 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-06-05  9:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-06 14:40 bug#26001: js-mode: JSX indentation after fat-arrow attribute Dražen
2019-06-05  2:57 ` Jackson Ray Hamilton
2019-06-05  9:33   ` Dražen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).