I need to create a code editor for my own simple language:
className.MethodName (parameterName = 2, ...)
I created the appropriate grammar and auto-generated parser using the ANTLR tool. Now I would like to have autocomplete for classes, methods, variables and parameter names. This list must be context sensitive, i.e. for class. "it should display methods for" class.Method ("Parameters". I was going to parse the text and display a list depending on which node the cursor is in. The problem is that for incomplete code like "aaa.bbb (" parser creates an error instead of the syntax tree Any idea how to solve this problem? Maybe I'm wrong and I shouldn’t parse the code to display autocomplete?
Andrey
source
share