dart-atom / dart

A Dart plugin for Atom.
http://dart-atom.github.io/dart/
BSD 3-Clause "New" or "Revised" License
154 stars 44 forks source link

"async" keyword in arrow notation is incorrect #1187

Open sumanthratna opened 5 years ago

sumanthratna commented 5 years ago

Suppose I have the function:

void fetchActive() async =>
      _myPrivateVar = await API.fetchPrivateVar();

The async keyword is highlighted in blue as if it is a function name. However, when using:

void fetchActive() async {
      _myPrivateVar = await API.fetchPrivateVar();
}

The async keyword is highlighted correctly in purple. Interestingly, the same issue occurs in GitHub's markdown, so perhaps I'm missing something?

Note: I am using Flutter, but I don't think it should make a difference.

EDIT: making a change to this regex might fix things.