flow-js2-mode icon indicating copy to clipboard operation
flow-js2-mode copied to clipboard

Function type with void return type causes syntax error

Open strayer opened this issue 7 years ago • 4 comments

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 avatar May 29 '18 07:05 strayer

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

strayer avatar May 29 '18 07:05 strayer

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

Fuco1 avatar May 29 '18 10:05 Fuco1

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!

strayer avatar May 29 '18 11:05 strayer

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.

Fuco1 avatar May 29 '18 13:05 Fuco1