Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Curried arrow function break formatting unless there's space after the => operator. #545

Open
@dshepsis

Description

@dshepsis

Prerequisites

Description

[Description of the issue]

Steps to Reproduce

  1. Make a JS file w/ a curried arrow function. For example:
var a = 3;
//Hello
/* Hello */

const curriedFunction = (x)=>(y)=>{
  console.log(x * y * z);
}

var b = 4;
//Hello
/* Hello*/
for (let i = 0; i < 2; ++i) {
  console.log(i);
}
var c = 4;
function foo() {
  console.log("broke");
}
var d = 5;
const unbreak = ()=>{
  console.log("unbroke");
}
var e = 3;
  1. Set the language to JavaScript if not set already

Expected behavior: Normal formatting behavior. The function body is formatted as a function body, and the lines following the function body are normal, as though the function weren't there.

Actual behavior: The code following the first arrow becomes weirdly formatted. Keywords are uncolored. Numbers are given a red-background error highlighting. And so on. See this screenshot: Image of above code as it appears Atom

Versions

Atom : 1.22.1
Electron: 1.6.15
Chrome : 56.0.2924.87
Node : 7.4.0

apm 1.18.8
npm 3.10.10
node 6.9.5 ia32
python
git 2.11.0.windows.3
visual studio

Additional Information

I do have CSS styling on comments (so they're slightly yellowish instead of gray), however I was still able to reproduce this issue in safe mode and with all of my configuration in a backup folder, so it's probably unrelated.

I do have atom-ide-ui and ide-typescript, if that matters at all.

This is only my second bug report with an atom package, so if I've made any mistakes in reporting, please don't hesitate to alert me.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions