Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » JVM inferred objects and content assist(JVM mapped objects not shown in the content assist proposals)
JVM inferred objects and content assist [message #877982] Mon, 28 May 2012 08:39 Go to next message
Christian Mauceri is currently offline Christian MauceriFriend
Messages: 22
Registered: May 2012
Location: Paris
Junior Member
I have followed the 5 steps described in the post : "Five simple steps to your JVM language". Everything work fine but when I test the editor the content assist window proposes only original java types but not the inferred ones.

However the inferred types once written do not cause any errors unless they are not imported.
The AbstractMyDSLProposalProvider seems correct and I can see the inferred types elsewhere : in MyDSLJavaValidator for instance.


Here are the relevant parts of the grammar:


BClass :
modifiers=ClassModifiers ('class' | isInterface='interface') name=ID
extensions?=Extends?
implementations?=Implements?
properties+=Property*
'{'
members+=Member*
'}';

Member:
modifiers=MemberModifiers type=JvmTypeReference name=ID
('('
parameter+=(Parameter)*
')')?
domain?=Domain?
properties+=Property*
';' |
'public' name=ID
('('
parameter+=(Parameter)*
')')?
domain?=Domain?
properties+=Property*
';'
;


and the infer method


def dispatch void infer(BClass bclass,
IAcceptor<JvmDeclaredType> acceptor,
boolean isPrelinkingPhase) {

acceptor.accept(bclass.toClass(bclass.fullyQualifiedName) [
documentation = bclass.documentation
for (member : bclass.members) {
if(member.parameter == null) {
members += member.toField(member.name, member.type)
members += member.toSetter(member.name, member.type)
members += member.toGetter(member.name, member.type)
} else if(member.type == null) {
members += member.toConstructor(member.name) [
for (p : member.parameter) {
parameters += p.toParameter(p.name, p.type)
}
documentation = member.documentation
//body = member.body
]
} else {
members += member.toMethod(member.name, member.type) [
for (p : member.parameter) {
parameters += p.toParameter(p.name, p.type)
}
documentation = member.documentation
//body = member.body
]
}
}
])
}

Any idea ?


Re: JVM inferred objects and content assist [message #878114 is a reply to message #877982] Mon, 28 May 2012 15:22 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi,

sounds like https://bugs.eclipse.org/bugs/show_bug.cgi?id=350823

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: JVM inferred objects and content assist [message #878186 is a reply to message #878114] Mon, 28 May 2012 19:19 Go to previous messageGo to next message
Christian Mauceri is currently offline Christian MauceriFriend
Messages: 22
Registered: May 2012
Location: Paris
Junior Member
Hi Christian, thanks for the link but I am not sure it is the same problem : indeed as far as I understand if I save the editor content I should then see the objects, right ? It is not the case here, I never see the inferred objects, but maybe I miss what the "resources get saved" means. If there is a way to get the resources saved, it would be just fine for me, but it is important to have the inferred types shown in the content assist window in a way or in other...
Christian (my first name too Smile )
Re: JVM inferred objects and content assist [message #878214 is a reply to message #878186] Mon, 28 May 2012 20:52 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi,

its actually meant that the file is saved (e.g crtl + s)
this will lead that java classes are created by the jvmmodelgenerator (along the inferred model)
=> they will be proposed.

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: JVM inferred objects and content assist [message #878256 is a reply to message #878214] Mon, 28 May 2012 23:34 Go to previous message
Christian Mauceri is currently offline Christian MauceriFriend
Messages: 22
Registered: May 2012
Location: Paris
Junior Member
Yes, that's what I thought but I hoped there were some mysterious other spells I did not know because when I save my files nothing happens.
Is it possible to make a clever change in the abstractProposalProvider or in the scope management to make them appear ?
Thanks anyway for your quick replies.
Christian.

[Updated on: Mon, 28 May 2012 23:37]

Report message to a moderator

Previous Topic:IOConsole Listener
Next Topic:Can't get 5 minute tutorial to build
Goto Forum:
  


Current Time: Fri Mar 29 00:17:42 GMT 2024

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

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

Back to the top