Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Simple local names with qualified name provider
Simple local names with qualified name provider [message #889819] Tue, 19 June 2012 18:52 Go to next message
Axel Guckelsberger is currently offline Axel GuckelsbergerFriend
Messages: 354
Registered: July 2009
Senior Member
Hi all,

I am using the qualified name provider and customised it for skipping one
level in the containment hierarchy. The global scope is limited to allow
only entities for being exported.

So I can now reference entities like
"MyApp.myEntity"
or
"OtherModel.someEntity"
which is very nice.

My question is about referencing local entities. I would like to make the
first part optional for these, so that "myEntity" would be valid, too. I
looked at the qualified name provider implementation again for that, but
failed to recognise a way to check whether the resource of the currently
EObject equals the "currently" opened resource. With this information I
could simply skip the first containment level, too, as soon as the resource
is the local one.

Thank you for any ideas.
Axel
Re: Simple local names with qualified name provider [message #889822 is a reply to message #889819] Tue, 19 June 2012 19:26 Go to previous messageGo to next message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
This the scenario in which I usually override
ImportedNamespaceAwareLocalScopeProvider.internalGetImportedNamespaceResolvers


Am 19.06.12 20:52, schrieb Axel Guckelsberger:
> Hi all,
>
> I am using the qualified name provider and customised it for skipping one
> level in the containment hierarchy. The global scope is limited to allow
> only entities for being exported.
>
> So I can now reference entities like
> "MyApp.myEntity"
> or
> "OtherModel.someEntity"
> which is very nice.
>
> My question is about referencing local entities. I would like to make the
> first part optional for these, so that "myEntity" would be valid, too. I
> looked at the qualified name provider implementation again for that, but
> failed to recognise a way to check whether the resource of the currently
> EObject equals the "currently" opened resource. With this information I
> could simply skip the first containment level, too, as soon as the resource
> is the local one.
>
> Thank you for any ideas.
> Axel
>
>


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


---
Get professional support from the Xtext committers at www.typefox.io
Re: Simple local names with qualified name provider [message #889886 is a reply to message #889822] Wed, 20 June 2012 07:22 Go to previous messageGo to next message
Axel Guckelsberger is currently offline Axel GuckelsbergerFriend
Messages: 354
Registered: July 2009
Senior Member
Thanks Jan, I will look into that.


Jan Koehnlein wrote:
> This the scenario in which I usually override
>
ImportedNamespaceAwareLocalScopeProvider.internalGetImportedNamespaceResolvers
>
>
> Am 19.06.12 20:52, schrieb Axel Guckelsberger:
>> Hi all,
>>
>> I am using the qualified name provider and customised it for skipping one
>> level in the containment hierarchy. The global scope is limited to allow
>> only entities for being exported.
>>
>> So I can now reference entities like
>> "MyApp.myEntity"
>> or
>> "OtherModel.someEntity"
>> which is very nice.
>>
>> My question is about referencing local entities. I would like to make the
>> first part optional for these, so that "myEntity" would be valid, too. I
>> looked at the qualified name provider implementation again for that, but
>> failed to recognise a way to check whether the resource of the currently
>> EObject equals the "currently" opened resource. With this information I
>> could simply skip the first containment level, too, as soon as the
>> resource is the local one.
>>
>> Thank you for any ideas.
>> Axel
>>
>>
>
>
Re: Simple local names with qualified name provider [message #889945 is a reply to message #889822] Wed, 20 June 2012 10:59 Go to previous messageGo to next message
Axel Guckelsberger is currently offline Axel GuckelsbergerFriend
Messages: 354
Registered: July 2009
Senior Member
Hi Jan,

I looked at the class, but it does not fit to my setup as I use the
ImportURI mechanism. Where is the corresponding entrypoint here? I am
looking at SimpleLocalScopeProvider, but not sure yet whether this is a more
appropriate place than the QualifiedNameProvider itself.

Greetings,
Axel


Jan Koehnlein wrote:

> This the scenario in which I usually override
>
ImportedNamespaceAwareLocalScopeProvider.internalGetImportedNamespaceResolvers
>
>
> Am 19.06.12 20:52, schrieb Axel Guckelsberger:
>> Hi all,
>>
>> I am using the qualified name provider and customised it for skipping one
>> level in the containment hierarchy. The global scope is limited to allow
>> only entities for being exported.
>>
>> So I can now reference entities like
>> "MyApp.myEntity"
>> or
>> "OtherModel.someEntity"
>> which is very nice.
>>
>> My question is about referencing local entities. I would like to make the
>> first part optional for these, so that "myEntity" would be valid, too. I
>> looked at the qualified name provider implementation again for that, but
>> failed to recognise a way to check whether the resource of the currently
>> EObject equals the "currently" opened resource. With this information I
>> could simply skip the first containment level, too, as soon as the
>> resource is the local one.
>>
>> Thank you for any ideas.
>> Axel
>>
>>
>
>
Re: Simple local names with qualified name provider [message #891177 is a reply to message #889945] Sun, 24 June 2012 07:34 Go to previous message
Axel Guckelsberger is currently offline Axel GuckelsbergerFriend
Messages: 354
Registered: July 2009
Senior Member
Hi all,

does anybody know how to implement the proposed change in qualified name
creation and resolution?

Glad about any pointers,

Axel




Axel Guckelsberger wrote:

> Hi Jan,
>
> I looked at the class, but it does not fit to my setup as I use the
> ImportURI mechanism. Where is the corresponding entrypoint here? I am
> looking at SimpleLocalScopeProvider, but not sure yet whether this is a
> more appropriate place than the QualifiedNameProvider itself.
>
> Greetings,
> Axel
>
>
> Jan Koehnlein wrote:
>
>> This the scenario in which I usually override
>>
>
ImportedNamespaceAwareLocalScopeProvider.internalGetImportedNamespaceResolvers
>>
>>
>> Am 19.06.12 20:52, schrieb Axel Guckelsberger:
>>> Hi all,
>>>
>>> I am using the qualified name provider and customised it for skipping
>>> one level in the containment hierarchy. The global scope is limited to
>>> allow only entities for being exported.
>>>
>>> So I can now reference entities like
>>> "MyApp.myEntity"
>>> or
>>> "OtherModel.someEntity"
>>> which is very nice.
>>>
>>> My question is about referencing local entities. I would like to make
>>> the first part optional for these, so that "myEntity" would be valid,
>>> too. I looked at the qualified name provider implementation again for
>>> that, but failed to recognise a way to check whether the resource of the
>>> currently EObject equals the "currently" opened resource. With this
>>> information I could simply skip the first containment level, too, as
>>> soon as the resource is the local one.
>>>
>>> Thank you for any ideas.
>>> Axel
>>>
>>>
>>
>>

[Updated on: Wed, 15 August 2012 05:38]

Report message to a moderator

Previous Topic:preprocessor before parsing needed
Next Topic:filtering exported objects
Goto Forum:
  


Current Time: Fri Mar 29 00:32:35 GMT 2024

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

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

Back to the top