Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Primitive void cannot be a dependency.(Primitive void cannot be a dependency causing unknown errors in content assist)
Primitive void cannot be a dependency. [message #1720324] Sun, 17 January 2016 07:31 Go to next message
Jia Poh Kow is currently offline Jia Poh KowFriend
Messages: 25
Registered: November 2015
Junior Member
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 10:56 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14669
Registered: July 2009
Senior Member
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);
}

????


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Primitive void cannot be a dependency. [message #1720332 is a reply to message #1720328] Sun, 17 January 2016 16:02 Go to previous messageGo to next message
Jia Poh Kow is currently offline Jia Poh KowFriend
Messages: 25
Registered: November 2015
Junior Member
Oh,

So you meant this part of code should not be put in the xtend file??
this snippet is actually from the documentation 7.2.2 Sample implementation.
Can you give me a clue where should I put this to if it is not xtend code >< ??

Thank you.
Re: Primitive void cannot be a dependency. [message #1720333 is a reply to message #1720332] Sun, 17 January 2016 16:09 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14669
Registered: July 2009
Senior Member
if you want to have xtend code you have to convert the code from java to xtend.
this is what i did for you.

please file a bug against the docs


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Primitive void cannot be a dependency. [message #1720334 is a reply to message #1720333] Sun, 17 January 2016 16:51 Go to previous messageGo to next message
Jia Poh Kow is currently offline Jia Poh KowFriend
Messages: 25
Registered: November 2015
Junior Member
Bug filed.

Can you give me an idea on how to make a information pop up on the dsl syntax??
I saw that eclipse has this function by its own whenever mouse over to the syntax. Can we do the same too for the dsl we had made??

Besides, I also noticed that there is a F2 for focus in the dsl...can it be used to make for the help file for that syntax also??
or what keyword should i look for??

Thank you very much.
Re: Primitive void cannot be a dependency. [message #1720336 is a reply to message #1720334] Sun, 17 January 2016 18:01 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14669
Registered: July 2009
Senior Member
hi

am not sure. xtext has hovers by default (on the "name" place of object) e.g.

entity Person {

}

you will get the popup when hovering "Person"

https://christiandietrich.wordpress.com/2011/07/16/hover-support-in-xtext-2-0-tutorial/

if you want to hover into non "name" paces you may digg into

org.eclipse.xtext.ui.editor.hover.html.DefaultEObjectHoverProvider.hasHover(EObject)
org.eclipse.xtext.ui.editor.hover.AbstractEObjectHover.getXtextElementAt(XtextResource, int)


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Primitive void cannot be a dependency. [message #1720747 is a reply to message #1720336] Wed, 20 January 2016 15:54 Go to previous messageGo to next message
Jia Poh Kow is currently offline Jia Poh KowFriend
Messages: 25
Registered: November 2015
Junior Member
Hi Christian,

thank you for your resources...
I understand that there should be a default hover according to the blog.

However, I cannot get my default hover...

So, is there anything else needed in order to get the default hover??
or default hover should exist once project is created...**I tried to create a totally new project...but there are no default hover seen**

Any idea on what is happening??
Thanks =)

[Updated on: Wed, 20 January 2016 15:55]

Report message to a moderator

Re: Primitive void cannot be a dependency. [message #1720752 is a reply to message #1720747] Wed, 20 January 2016 16:36 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14669
Registered: July 2009
Senior Member
how does the grammar for your "Hover-Thing" look like? does it have a Name Attribute? do you hover the Name?

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:AbstractMyDslProposalProvider
Next Topic:How does xtext handle deleting generated files?
Goto Forum:
  


Current Time: Sat Apr 27 00:11:42 GMT 2024

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

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

Back to the top