Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Getting text in StatefulFactory
Getting text in StatefulFactory [message #929121] Mon, 01 October 2012 08:37
Nicola Serreli is currently offline Nicola SerreliFriend
Messages: 26
Registered: July 2009
Junior Member
Hi,

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.

best regards,
Nicola
Previous Topic:parsed CompleteOCL file doesn't resolve cross reference to the ecore referenced file
Next Topic:A warning on the performance of syntactic predicates in Xtext
Goto Forum:
  


Current Time: Tue Apr 23 09:55:37 GMT 2024

Powered by FUDForum. Page generated in 0.02654 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top