Albatarm / autocomplete

3 stars 0 forks source link

Autocompletion for calculator lang2 stopped to work after complex expression in parentesis #1

Open eschava opened 7 years ago

eschava commented 7 years ago

Expression (1)+ has candidates [TAN, LN, Ident, Number, LOG, COS, ACOS, LPAREN, SIN, ASIN, ATAN]

but expression (1+1)+ has empty set of candidates

Another related thing: Expression (1 has candidates [DIV, TIMES, E, LT, POW, RPAREN, EQ, GT, PLUS, MINUS] (with RPAREN)

but expression (1+1 has only [DIV, TIMES, E, POW, PLUS, MINUS] (w/o RPAREN)

Albatarm commented 7 years ago

It is not surprising me, I stopped working on it for the moment. I think it is not suffisant for production. Have you find a fix ?

eschava commented 7 years ago

No, that ATN tree walking is kind of miracle for me But I see that "lang" autocompletion uses another approach. Is there any article describing both ways?

Albatarm commented 7 years ago

Langs that are herited from AbstractLangEx are old version. With this article http://www.soft-gems.net/index.php/tools/47-universal-code-completion-using-antlr , i made langs herited from AbstractLang that normally work better.

eschava commented 7 years ago

You can check next implementations of auto-completion libraries for antlr to find required code https://github.com/mike-lischke/antlr4-c3 (TypeScript) https://github.com/ftomassetti/antlr4-c3-kotlin (Kotlin)

Albatarm commented 7 years ago

Thanks for the links, I will check it ;)