I was studying the class ParserBasedContentAssistContextFactory.StatefulFactory and I notice that it get the text directly from editor instead of rootNode.
There is a reason about that?
From my tests, everything seams working correctly if I replace lines like
String completeInput = viewer.getDocument().get(0, lastCompleteNode.getOffset());
with the equivalent
INode rootNode = resource.getParseResult().getRootNode();
String completeText = ((RootNode)rootNode).getCompleteContent();
String completeInput = completeText.substring(0, lastCompleteNode.getOffset());
RootNode.getCompleteContent() is already used in a lot of places to get the text related to one or more INode.
Moreover using the text in the rootNode makes a little easier handle c-like inclusion (that is what I'm working on)
Any comment and/or suggestion is appreciated.