|
|
|
|
Re: can scope provider call sort of super and filter obtained matches? [message #630993 is a reply to message #630956] |
Tue, 05 October 2010 18:57 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi Henrik,
strict validation and loose scoping is a common pattern to improve the
error messages. If you want to filter the proposals for cross references
in a generic way, feel free to override
AbstractJavaBasedContentProposalProvider.getProposalFactory( String,
ContentAssistContext)
and return your own subtype of the DefaultProposalCreator. Please note
that you should try to not resolve any proxies when you filter the
descriptions.
Hope that helps,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 05.10.10 17:53, schrieb Henrik Rentz-Reichert:
> I just realized, it is not so easy.
>
> The ICompletionProposal doesn't give me the proposed EObject, only a
> String to be inserted...
>
> What is the proper way to treat this issue?
>
> Thanks,
> Henrik
>
> Am 05.10.2010 17:20, schrieb Henrik Rentz-Reichert:
>> thanks for the hint! That works fine.
>>
>> Now I encounter a more semantic problem:
>> If type A has a reference of type B in general any element of type B is
>> a valid object.
>> This is restricted only by my model semantics which is imposed e.g. by a
>> corresponding validation check.
>> If now my scope provider filters out invalid references in the semantic
>> sense I may see an error mark with a message "reference not found".
>> Strictly speaking this is not true since the reference is found but not
>> valid.
>> So what I would like to have is a general scope but a strict validation,
>> which is quite simple to achieve.
>>
>> But my proposals on the other hand should contain only valid references.
>>
>> Can I implement that along the lines of
>> http://www.eclipse.org/Xtext/documentation/latest/xtext.html #contentAssist
>> by calling the super class implementation with an acceptor delegating
>> only if the proposal is valid?
>>
>> Thanks,
>> Henrik
>>
>> Am 05.10.2010 11:28, schrieb Christian Dietrich:
>>> Hi,
>>>
>>> have a look at the simple arithmetics example. there is a sample
>>> implementation of a filtering scope.
>>>
>>> ~Christian
|
|
|
Powered by
FUDForum. Page generated in 0.03765 seconds