ignatov/intellij-erlang

Incorrect `end` highlighted for "fun Mod:Name/Arity"

gustawlippa opened this issue · 2 comments

Please see the issue here:
image
This is the correct end for this fun, and it works when the cursor is on it:
image
However, what is worst, when we highlight the end, the wrong fun is highlighted:
image

This is not a huge issue, but may be pretty confusing with nested funs, or different indentation.
I don't know anything about plugin development, so I'm not sure where the issue comes from.

The explanation is in the parser output. Parser produces ERL_FUN_EXPRESSION which also contains 'fun' keyword (but shouldn't) then 'fun' will be matched with 'end' keyword by the matching token highlighter. Solution is to not output 'fun' in the token stream, or rename it, if it is recognized as ERL_FUN_EXPRESSION. I will see what can be done about this.

Great, thanks for the reply, I must admit I even forgot I filed this issue. I would love to help, although I have no idea how, and I'm not familiar with developing IntelliJ plugins.