Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Bug in codecompletion?
Bug in codecompletion? [message #51740] Tue, 16 June 2009 06:14
Michael Baedorf is currently offline Michael BaedorfFriend
Messages: 3
Registered: July 2009
Junior Member
I've a question concerning the codecompletion feature respectively
deriving from TerminalsProposalProvider.
My model looks like
Application Library {
Module media {

Entity Library {
String name
}

abstract Entity Media {
String title
}

Entity Book extends Media {
String isbn
}

ValueObject Engagement {
String role
}

}

}
I defined a dsl like this
...
Model :
app=Application;

Application :
"Application" name=ID "{"
"basePackage" "=" basePackage=JavaIdentifier
(modules+=Module)*
"}";


Module :
"Module" name=ID "{"
(services+=Service)*
(domainObjects+=DomainObject)*
"}";

Attribute :
type=Type name=ID;


DomainObject :
Entity | ValueObject;

Service :
"Service" name=ID "{"
"}";


Entity :
(abstract?="abstract")? "Entity" name=ID ("extends" extends=[Entity])?
"{"
(attributes+=Attribute)+
"}"
;

ValueObject :
(abstract?="abstract")? "ValueObject" name=ID ("extends"
extends=[ValueObject])? "{"
(attributes+=Attribute)+
"}"
;
...

Now I'd like to add codecompletion for the service name:
public void completeService_Name(Service service, Assignment assignment,
ContentAssistContext context, ICompletionProposalAcceptor
acceptor) {
super.completeService_Name(service, assignment, context, acceptor);
...
ICompletionProposal completionProposal =
createServiceNameDefaultProposal(service, context);
acceptor.accept(completionProposal);
}
I noticed two things:
1. Codecompletion is only available if Service is followed by a
ValueObject.
2. Without only user input the service name is type of the following
object(ValueObject, Entity).

Are these bugs or are there any mistakes implementing the codecompletion?
Previous Topic:Importing a grammar which inturn has imported a Metamodel
Next Topic:[Xtext] AST processing during linking question
Goto Forum:
  


Current Time: Fri Jul 19 10:23:07 GMT 2024

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

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

Back to the top