[XText] Possibility to read the order of a node [message #44463] |
Tue, 19 May 2009 04:10  |
Eclipse User |
|
|
|
Hi all,
is it possible to get the order (or position) where a node is located? I
need this for completion proposals.
Example:
RootModel: type name ( att1="s" cs="Attr"){
table tabname1 (attname=myatt1);
table tabname2 (attname=myatt2){ [1]
column col1 (att1 att2 . . att3 att4=value); [2]
};
};
If the cursor is at position [1] then the node name is "tabname2".
If the cursor is at position [2] then the node name is "col1". What I
want is that inside a table node (at every position) I know the right
container node name (i.e., "tabname2" if inside tabname2).
How can I achieve this?
Greets,
Ralf.
|
|
|
|
Re: [XText] Possibility to read the order of a node [message #44735 is a reply to message #44623] |
Thu, 21 May 2009 10:52  |
Eclipse User |
|
|
|
Hi Alex,
I think you are talking about this one:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=276619 ? The bug will be
fixed asap.
Regards,
Sebastian
Am 20.05.2009 8:21 Uhr, schrieb Alexander Nittka:
> This is an issue which seems to have made it from oAW to TMF Xtext. See
> http://www.openarchitectureware.org/forum/viewtopic.php?foru m=29&showtopic=10652&highlight=context
> for an example grammar (oAW Xtext - here it is analogous).
>
> The name of the function completeNode_children implies that there is a
> safe way to access the container "Node" whose feature is to be
> completed. Given the parameters (EObject model, Assignment assignment,
> ContentAssistContext context, ICompletionProposalAcceptor acceptor) it
> is not EObject model. In both cases model is of Type Node, but in the
> first case (after the brace) model is the actual parent node (wa are
> after), in the second cases model is the sibling node, not the container.
>
> The question is: is there a unique and safe (best practice) way to
> access the container node (without testing if the last parse node is a
> brace). Maybe model is not the correct starting point, but assignment or
> context.
>
|
|
|
Powered by
FUDForum. Page generated in 0.05389 seconds