ignatov/intellij-erlang

Syntax error on `maybe' function in editor

kpy3 opened this issue · 1 comments

kpy3 commented

With adding support of new maybe syntax editor start threat functions named maybe as error:

image
kvakvs commented

Some of work to fix this must be done at the parse stage, i.e. can't really strap a condition after when AST is finished.
Ideas to fix this

  • parse maybe as atom before Erlang 25
  • Or to parse it as keyword but allow it in function head where the name goes
  • And also must not parse maybe in function body as maybe-expression if before Erlang 25

Some things i do not have experience of doing in IntelliJ/GrammarKit

P.S. it works if i make parser parse 'maybe' as ERL_ATOM_NAME instead of ERL_MAYBE, but now i need to access current project and current SDK somehow.