gandm / language-babel

ES2017, flow, React JSX and GraphQL grammar and transpilation for ATOM
https://atom.io/packages/language-babel
MIT License
476 stars 83 forks source link

[Flow] Type representation for function params differs when are setted in multiple lines #361

Closed lgraziani2712 closed 7 years ago

lgraziani2712 commented 7 years ago

When params are in one line:

image

When are in multiple lines:

image

Thank you :)

gandm commented 7 years ago

Thanks. Fixed 2.59.1

lgraziani2712 commented 7 years ago

Hello @gandm. I'm still experiencing this issue.

Tested on v2.59.1 and v2.60.0.

gandm commented 7 years ago

Seems OK for me image

lgraziani2712 commented 7 years ago

Edit: Array<number> needs to be always in light blue when it's a type definition. Instead, it's colored like it is part of the code.

gandm commented 7 years ago

OK I misunderstood your original issue. I thought you were saying that the multi-line was correct. I missed the second Array being different.

lgraziani2712 commented 7 years ago

Sorry I didn't explain it well.

I'll do next time :)

gandm commented 7 years ago

OK I've reverted to my prior handling of this plus a few minor tweaks.

The bad news is I don't think I'll be able to fix the issue in your second gif above. I have no way of knowing that const a=( is a arrow function's parameters until I get to the =>, by which time it is too late. In the first example I can determine that in probability a const a=(value, is an arrow function because of the , It could of course be a comma separated expression list but is more unlikely ( I feel).

lgraziani2712 commented 7 years ago

Oh, OK good to know.

Thank you @gandm!

lgraziani2712 commented 7 years ago

I can confirm that with the new update this is fixed.

Congrats @gandm !! 😊🎉

gandm commented 7 years ago

@lgraziani2712 Thanks. It's not quite right (not scoped as function parameters) but it's the best I can do.