Hi,
I'm trying to implement a ProposalProvider for a grammar which contains a list of elements (my actual problem is a bit more complicated so I tried to bring it down to a small example).
My grammer looks like:
Model:
values+=DataEntry+
;
DataEntry:
"(" attrs += DataAttrStringValue ("," attrs += DataAttrStringValue)* ")"
;
DataAttrStringValue:
value=STRING
;
So a valid input would be:
("France", "Paris")
("Germany", "Berlin")
I would like to implement now a ProposalProvider which offers different proposals depending on the position in the list (e.g. in the example, if the user is in the first column, I would like to offer a list of country names, and in the second column a list of city names). Therefor I tried
public void completeDataAttrStringValue_Value(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
System.out.println("completeDataAttrStringValue_Value with model " + model);
}
but the passed model object is not a DataAttrStringValue but a DataEntry, making it impossible for me to get the current position in the DataEntry.
Is there any way to achieve this with the ProposalProvider? At the moment I'm really stuck and would really appreciate any help.
Best regards
Florian