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