Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Problem with expensive validation
Problem with expensive validation [message #1149512] Tue, 22 October 2013 06:11 Go to next message
Alexander Fichtinger is currently offline Alexander FichtingerFriend
Messages: 66
Registered: January 2013
Member
Hello,

because I want to trigger a validation manually, i defined it with CheckType.EXPENSIVE.

When I would like to do the validation I run the following code:

final Diagnostic diagnostic = Diagnostician.INSTANCE.validate(configuration.getProgramInstance());
switch (diagnostic.getSeverity())
{
case Diagnostic.ERROR:
LOGGER.error(diagnostic.getMessage());
}

The validation itself, works fine, and the logger message is put to the error log view (LOGGER is our own logger).

But the problem is, that no error markers are displayed (neither in the ProjectExplorer nor in the Editor). Also the Problems view does not show any errors.

What am I doing wrong?
Thanks for any help!

Kind regards,
Alexander
Re: Problem with expensive validation [message #1149570 is a reply to message #1149512] Tue, 22 October 2013 06:51 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
A Validate action should be registered for your editor.
Please try the right click context menu in an editor.

If it'S not there check your plugin.xml (ui project) it should contain
some handler definition similar to this
<handler
class="my.example.LanguageExecutableExtensionFactory:org.eclipse.xtext.ui.editor.handler.ValidateActionHandler"
commandId="my.example.Language.validate">
<activeWhen>
<reference
definitionId="my.example.Language.Editor.opened">
</reference>
</activeWhen>
</handler>


Am 10/22/13 8:11 AM, schrieb Alexander Fichtinger:
> Hello,
>
> because I want to trigger a validation manually, i defined it with
> CheckType.EXPENSIVE.
>
> When I would like to do the validation I run the following code:
>
> final Diagnostic diagnostic =
> Diagnostician.INSTANCE.validate(configuration.getProgramInstance());
> switch (diagnostic.getSeverity())
> {
> case Diagnostic.ERROR:
> LOGGER.error(diagnostic.getMessage());
> }
>
> The validation itself, works fine, and the logger message is put to the
> error log view (LOGGER is our own logger).
>
> But the problem is, that no error markers are displayed (neither in the
> ProjectExplorer nor in the Editor). Also the Problems view does not show
> any errors.
>
> What am I doing wrong?
> Thanks for any help!
>
> Kind regards,
> Alexander


--
Need professional support for Xtext or other Eclipse Modeling technologies?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : http://blog.efftinge.de
Re: Problem with expensive validation [message #1151204 is a reply to message #1149570] Wed, 23 October 2013 07:33 Go to previous message
Alexander Fichtinger is currently offline Alexander FichtingerFriend
Messages: 66
Registered: January 2013
Member
Hi Sven,

yes this was the answer to my problem.
The right click on the menu entry "Validate" in the editor context menu does the expensive validations.

Thank you,

Alexander
Previous Topic:Using eclipse menu for code generation
Next Topic:how2 append to a generated file?
Goto Forum:
  


Current Time: Sat Jul 11 06:13:27 GMT 2020

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

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

Back to the top