Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Content assist context
Content assist context [message #59987] Fri, 17 July 2009 06:21 Go to next message
Eclipse UserFriend
Hello,

I have a question regarding the content assist context. In the generated
myDsl example, when I invoke the code completion after attr, the context
object is an instance of "Model" and not an instance of "Class" as I would
have expected.

class Name {
attr ...

}


public void completeAssignment(Assignment assignment, ContentAssistContext
contentAssistContext, ICompletionProposalAcceptor acceptor) {

//contentAssistContext.getCurrentModel() -> instanceof Model

}


However, I want to restrict the possible values based on the enclosing
class. My question is, how can I retrieve the instance of the enclosing
class?

Regards,

Sebastian
Re: Content assist context [message #60039 is a reply to message #59987] Fri, 17 July 2009 08:05 Go to previous messageGo to next message
Eclipse UserFriend
Hi Sebastian,

this is a bug. Please file a ticket.

Sorry for inconvenience,
Sebastian

--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com


Am 17.07.2009 12:21 Uhr, schrieb Sebastian Benz:
> Hello,
>
> I have a question regarding the content assist context. In the generated
> myDsl example, when I invoke the code completion after attr, the context
> object is an instance of "Model" and not an instance of "Class" as I
> would have expected.
> class Name {
> attr ...
>
> }
>
>
> public void completeAssignment(Assignment assignment,
> ContentAssistContext contentAssistContext, ICompletionProposalAcceptor
> acceptor) {
> //contentAssistContext.getCurrentModel() -> instanceof Model
>
> }
>
>
> However, I want to restrict the possible values based on the enclosing
> class. My question is, how can I retrieve the instance of the enclosing
> class?
>
> Regards,
>
> Sebastian
>
>
>
>
>
Re: Content assist context [message #60064 is a reply to message #60039] Fri, 17 July 2009 10:36 Go to previous message
Eclipse UserFriend
I filed a bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=283857

A workaround is to create a dummy rule for the attribute:

Attribute:
'attr' name=Name ':' type=[DataType] ';'?;

Name returns ecore::EString :
ID
;

Sebastian
Previous Topic:[Xtext] Update highlighting after document change
Next Topic:[Announce] TMF XTEXT 0.7.1 is available
Goto Forum:
  


Current Time: Wed Apr 30 16:10:24 EDT 2025

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

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

Back to the top