Fuco1 / flow-js2-mode

[UNMAINTAINED] Support for flow for js2-mode
GNU General Public License v3.0
46 stars 3 forks source link

Function type with void return type causes syntax error #17

Open strayer opened 6 years ago

strayer commented 6 years ago
grafik

The errors at the end of line 3 and 4 are "syntax error". This seems to be only happening with void return types, as can be seen in line 1 and 2.

strayer commented 6 years ago

Whoops, I think this may be a duplicate of #6. Feel free to close this if I'm correct.

Fuco1 commented 6 years ago

@Strayer It seems it might be the same as #6 yea. I currently have no good ideas on how to fix it :/

strayer commented 6 years ago

I'd love to help, but after looking at the source code of flow-js2-mode I'm more confused as before ;) I really should get into elisp developmentā€¦ won't be of any help like this :/

I guess the correct way would be to extend js2-mode or rjsx-mode to allow more customization in these cases, but I don't know either of these projects, so maybe I'm wrong.

I'll gladly throw a small donation to you if you're interested in investing the work to fix this!

Fuco1 commented 6 years ago

Yes you might be right. I think this project has reached the limits of what we can achieve without adding direct support for extensions into js2-mode itself. The advice system does not allow for arbitrary extension points, only beginning or end of functions.