Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Diagnostic vs. Diagnostic...
Diagnostic vs. Diagnostic... [message #663423] Mon, 04 April 2011 21:00 Go to next message
Henrik Lindberg is currently offline Henrik Lindberg
Messages: 2492
Registered: July 2009
Senior Member
Hi,
I am moving some logic that I executed during validation to be performed
after linking. The way to report errors is quite different when getting
an IDiagnosticsConsumer instead of being able to call the error(...)
methods.

What is the correct way to report errors ("the same way as in the
validator")? I basically want to report errors against EObject features.

The "Diagnostic" accepted by the IDiagnosticConsumer is not the emf
Diagnostic that is used in the validator, and I found sublcasses for
Linking, Syntax, and Exception issues.

Should I just subclass AbstractDiagnostic ?

Regards
- henrik
Re: Diagnostic vs. Diagnostic... [message #663532 is a reply to message #663423] Tue, 05 April 2011 10:18 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik Lindberg
Messages: 2492
Registered: July 2009
Senior Member
Where is the logic that translates a FeatureBasedDiagnostic into a
node/location in source ?

- henrik

On 4/5/11 3:00 AM, Henrik Lindberg wrote:
> Hi,
> I am moving some logic that I executed during validation to be performed
> after linking. The way to report errors is quite different when getting
> an IDiagnosticsConsumer instead of being able to call the error(...)
> methods.
>
> What is the correct way to report errors ("the same way as in the
> validator")? I basically want to report errors against EObject features.
>
> The "Diagnostic" accepted by the IDiagnosticConsumer is not the emf
> Diagnostic that is used in the validator, and I found sublcasses for
> Linking, Syntax, and Exception issues.
>
> Should I just subclass AbstractDiagnostic ?
>
> Regards
> - henrik
Re: Diagnostic vs. Diagnostic... [message #663538 is a reply to message #663532] Tue, 05 April 2011 10:26 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik Lindberg
Messages: 2492
Registered: July 2009
Senior Member
I can answer myself -
org.eclipse.xtext.validation.DiagnosticConverterImpl

*sigh*
- henrik

On 4/5/11 4:18 PM, Henrik Lindberg wrote:
> Where is the logic that translates a FeatureBasedDiagnostic into a
> node/location in source ?
>
> - henrik
>
> On 4/5/11 3:00 AM, Henrik Lindberg wrote:
>> Hi,
>> I am moving some logic that I executed during validation to be performed
>> after linking. The way to report errors is quite different when getting
>> an IDiagnosticsConsumer instead of being able to call the error(...)
>> methods.
>>
>> What is the correct way to report errors ("the same way as in the
>> validator")? I basically want to report errors against EObject features.
>>
>> The "Diagnostic" accepted by the IDiagnosticConsumer is not the emf
>> Diagnostic that is used in the validator, and I found sublcasses for
>> Linking, Syntax, and Exception issues.
>>
>> Should I just subclass AbstractDiagnostic ?
>>
>> Regards
>> - henrik
>
Re: Diagnostic vs. Diagnostic... [message #663540 is a reply to message #663538] Tue, 05 April 2011 10:38 Go to previous message
Henrik Lindberg is currently offline Henrik Lindberg
Messages: 2492
Registered: July 2009
Senior Member
hm, actually, I can't find that it makes use of the index for the
feature in that logic.
- henrik

On 4/5/11 4:26 PM, Henrik Lindberg wrote:
> I can answer myself -
> org.eclipse.xtext.validation.DiagnosticConverterImpl
>
> *sigh*
> - henrik
>
> On 4/5/11 4:18 PM, Henrik Lindberg wrote:
>> Where is the logic that translates a FeatureBasedDiagnostic into a
>> node/location in source ?
>>
>> - henrik
>>
>> On 4/5/11 3:00 AM, Henrik Lindberg wrote:
>>> Hi,
>>> I am moving some logic that I executed during validation to be performed
>>> after linking. The way to report errors is quite different when getting
>>> an IDiagnosticsConsumer instead of being able to call the error(...)
>>> methods.
>>>
>>> What is the correct way to report errors ("the same way as in the
>>> validator")? I basically want to report errors against EObject features.
>>>
>>> The "Diagnostic" accepted by the IDiagnosticConsumer is not the emf
>>> Diagnostic that is used in the validator, and I found sublcasses for
>>> Linking, Syntax, and Exception issues.
>>>
>>> Should I just subclass AbstractDiagnostic ?
>>>
>>> Regards
>>> - henrik
>>
>
Previous Topic:Configuring local and global scope providers at the same time
Next Topic:CrossLinking
Goto Forum:
  


Current Time: Fri Apr 18 04:16:26 EDT 2014

Powered by FUDForum. Page generated in 0.03323 seconds