Primitive void cannot be a dependency. [message #1720324] |
Sun, 17 January 2016 02:31  |
Eclipse User |
|
|
|
Hi all,
I read the documentation and was currently working according to the sample found in the topic 7.2 - content assist.
Sample is provided in the documentation. However when i copy paste the sample to the src-folder of the ui project called ProposalProvider.xtend , it gave me an error
Primitive void cannot be a dependency
at the void word.
Below is my code:
public class FypProposalProvider extends AbstractFypProposalProvider {
public void completeModel_StringDescription (
Model model,
Assignment assignment,
ContentAssistContext context,
ICompletionProposalAcceptor acceptor) {
// call implementation in superclass
super.completeModel_StringDescription(
model,
assignment,
context,
acceptor);
// compute the plain proposal
String proposal = "Description for model #" + model.getIntAttribute();
// convert it to a valid STRING-terminal
proposal = getValueConverter().toString(proposal, "STRING");
// create the completion proposal
// the result may be null as the createCompletionProposal(..) methods
// check for valid prefixes
// and terminal token conflicts
ICompletionProposal completionProposal =
createCompletionProposal(proposal, context);
// register the proposal, the acceptor handles null-values gracefully
acceptor.accept(completionProposal);
}
}
I am not sure whether it is an error or I did miss out anything.
Appreciate your help.
Thank you.
|
|
|
Re: Primitive void cannot be a dependency. [message #1720328 is a reply to message #1720324] |
Sun, 17 January 2016 05:56   |
Eclipse User |
|
|
|
Hi,
the code you paste ist java code not xtend code. how does your xtend version of the code look like? something like
override void completeModel_StringDescription (
Model model,
Assignment assignment,
ContentAssistContext context,
ICompletionProposalAcceptor acceptor) {
// call implementation in superclass
super.completeModel_StringDescription(
model,
assignment,
context,
acceptor);
// compute the plain proposal
var String proposal = "Description for model #" + model.getIntAttribute();
// convert it to a valid STRING-terminal
proposal = getValueConverter().toString(proposal, "STRING");
// create the completion proposal
// the result may be null as the createCompletionProposal(..) methods
// check for valid prefixes
// and terminal token conflicts
val ICompletionProposal completionProposal =
createCompletionProposal(proposal, context);
// register the proposal, the acceptor handles null-values gracefully
acceptor.accept(completionProposal);
}
????
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07514 seconds