Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Autocompletion remains empty
Autocompletion remains empty [message #558991] Wed, 15 September 2010 09:11 Go to next message
Steffen Schuette is currently offline Steffen SchuetteFriend
Messages: 26
Registered: August 2010
Junior Member
Hi,

I have a problem with autocompletion. I have two scope provider

public IScope scope_Model_cimParameters(Model m, EReference ref) {
return Scopes.scopeFor(m.getCimClassRef().getAttributes());
}

and

public IScope scope_CIMModelData_cimAttribute(CIMModelData cimModelData, EReference ref) {
return Scopes.scopeFor(((Model)cimModelData.eContainer()).getCimCla ssRef().getAttributes());
}


Both return the same list of elements for my case (I have checked that in debug mode) but the autocompletion list for the second one remains empty in the editor. Is there any other factor that has to be considered for auto completion and if so, where can I go to debug it.

When I enter the referenced element manually it is a valid reference.

Any help is (of course) very much appreciated.

Regards

feffe

[Updated on: Wed, 15 September 2010 09:14]

Report message to a moderator

Re: Autocompletion remains empty [message #558994 is a reply to message #558991] Wed, 15 September 2010 09:18 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

can you post the relevant parts of your grammar too?

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Autocompletion remains empty [message #559001 is a reply to message #558994] Wed, 15 September 2010 09:43 Go to previous messageGo to next message
Steffen Schuette is currently offline Steffen SchuetteFriend
Messages: 26
Registered: August 2010
Junior Member
Of course, sorry. Here they are:

//These are the elements that need to be referenced
CIM:
'#CIM Information'
(classes+=CIMClass)*;

CIMClass:
name=ID ':'
'Attributes:'
(attributes+=CIMClassAttribute)*
'Associations:'
(associations+=CIMClassAssociations)*;

CIMClassAttribute:
'- - 'name=ID
'- 'type=ID;

CIMClassAssociations:
'- - 'name=ID
'- 'type=ID;

//And here they are referenced
Model:
'Model ' name=ID
('CIM entity' cimClassRef=[CIMClass])?
('Parameters'
(modelParameters+=ModelParameter|'cim:'cimParameters+=[CIMCl assAttribute])*
)?

('Inputs:'
(inputs+=ModelInput|('cim:'cimInputs+=CIMModelData))*
)?;


As I said, the cimParameters+= reference of CIMClassAttribute works fine.
Re: Autocompletion remains empty [message #559006 is a reply to message #559001] Wed, 15 September 2010 10:08 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

depending on the definition of CIMModelData which you did not post the problem might be that the CIMModelData is not existing yet - so there should be an additional method:

public IScope scope_CIMModelData_cimAttribute(Model m, EReference ref) {
			return Scopes.scopeFor(m.getCimClassRef().getAttributes());
		}


~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Autocompletion remains empty [message #559007 is a reply to message #559006] Wed, 15 September 2010 10:12 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Or you change your grammar to somthing like this

('Inputs:'
((cimInputs+=CIMModelData))*
)?
;

CIMModelData: {CIMModelData}
	'cim:' cimAttribute=[CIMClassAttribute]
;


to get the CIMModelData be instantiated eager.

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Autocompletion remains empty [message #559008 is a reply to message #559006] Wed, 15 September 2010 10:14 Go to previous message
Steffen Schuette is currently offline Steffen SchuetteFriend
Messages: 26
Registered: August 2010
Junior Member
Hi,

sorry, I forgot to post CIMModelData:

CIMModelData:
cimAttribute=[CIMClassAttribute];


But your suggestion was right! You made my day!

Thanks so much!



Regards

feffe
Previous Topic:reading recursively with XPand
Next Topic:Content assist and STRING objects
Goto Forum:
  


Current Time: Thu Apr 25 08:53:09 GMT 2024

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

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

Back to the top