Skip to main content



      Home
Home » Modeling » TMF (Xtext) » [XText] cross reference ... lazy
[XText] cross reference ... lazy [message #62519] Wed, 22 July 2009 09:01 Go to next message
Eclipse UserFriend
Hello *,

cross references are great. I played with them in the last minutes. But I search
a more lazy way for usage. Example (XText) :

===
Service :
'service' name = ID '{' '}';
Invoke :
'invoke' action = [Service|ID] ';';
===

DSLs code:
===
service one {}
service two {}

invoke one;
invoke two;
===

But there are more services than written in this file. However, it would be
great, if "invoke (one|two);" would be an proprosal. An "invoke three;" should
be no error in the generated editor.

How can I modify my grammar for this?

Ciao, Micha
Re: [XText] cross reference ... lazy [message #62636 is a reply to message #62519] Wed, 22 July 2009 09:20 Go to previous messageGo to next message
Eclipse UserFriend
Hi Michael,

you'ld have to implement a scope provider that creates a scope which in
turn contains all available services. ContentAssist and linking will
work out of the box with it.
Otherwise you may try to use plain IDs and do some validation but this
way round you'ld have to implement custom content assist.

Hope that helps,
Sebastian

--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 22.07.2009 15:01 Uhr, schrieb Michael Burkhardt:
> Hello *,
>
> cross references are great. I played with them in the last minutes. But
> I search a more lazy way for usage. Example (XText) :
>
> ===
> Service :
> 'service' name = ID '{' '}';
> Invoke :
> 'invoke' action = [Service|ID] ';';
> ===
>
> DSLs code:
> ===
> service one {}
> service two {}
>
> invoke one;
> invoke two;
> ===
>
> But there are more services than written in this file. However, it would
> be great, if "invoke (one|two);" would be an proprosal. An "invoke
> three;" should be no error in the generated editor.
>
> How can I modify my grammar for this?
>
> Ciao, Micha
Re: [XText] cross reference ... lazy [message #62755 is a reply to message #62636] Wed, 22 July 2009 10:48 Go to previous messageGo to next message
Eclipse UserFriend
Hi Sebastian,

> you'ld have to implement a scope provider that creates a scope which in
> turn contains all available services.
Its a language for a distributed system. There is no difference between
'available, but currently unknown' and 'named, but not available'.

In this case, my scope provider should accept all Invoke.action strings.

Ciao, Micha


--- Original-Nachricht ---
Absender: Sebastian Zarnekow
Datum: 22.07.2009 15:20
> Hi Michael,
>
> you'ld have to implement a scope provider that creates a scope which in
> turn contains all available services. ContentAssist and linking will
> work out of the box with it.
> Otherwise you may try to use plain IDs and do some validation but this
> way round you'ld have to implement custom content assist.
>
> Hope that helps,
> Sebastian
>
Re: [XText] cross reference ... lazy [message #62777 is a reply to message #62755] Wed, 22 July 2009 10:54 Go to previous message
Eclipse UserFriend
Hi Michael,

in this case I'ld advise you to not use cross references but plain text
instead. You can use validation rules to provide feedback for the user.
Another possibility is to create the services on demand when a link
should be resolved. Note that this is a tough task and requires
detailled knowledge about the architecture and lifecylce. But this way
round it would be easier to provide content assist for available services.

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 22.07.2009 16:48 Uhr, schrieb Michael Burkhardt:
> Hi Sebastian,
>
> > you'ld have to implement a scope provider that creates a scope which in
> > turn contains all available services.
> Its a language for a distributed system. There is no difference between
> 'available, but currently unknown' and 'named, but not available'.
>
> In this case, my scope provider should accept all Invoke.action strings.
>
> Ciao, Micha
>
>
> --- Original-Nachricht ---
> Absender: Sebastian Zarnekow
> Datum: 22.07.2009 15:20
>> Hi Michael,
>>
>> you'ld have to implement a scope provider that creates a scope which
>> in turn contains all available services. ContentAssist and linking
>> will work out of the box with it.
>> Otherwise you may try to use plain IDs and do some validation but this
>> way round you'ld have to implement custom content assist.
>>
>> Hope that helps,
>> Sebastian
>>
Previous Topic:Xtext formatter
Next Topic:Recursive cross-references
Goto Forum:
  


Current Time: Fri May 09 12:08:37 EDT 2025

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

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

Back to the top