Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Display EXPENSIVE checks when building
Display EXPENSIVE checks when building [message #1793212] Wed, 01 August 2018 10:46 Go to next message
Eclipse UserFriend
Hey guys,

I want to do the Xtext validation programatically. Therefore I perform the following code:

final IResourceValidator validator = eResource.getResourceServiceProvider().getResourceValidator();
return validator.validate(eResource, CheckMode.ALL, null);

This works fine for getting all validation issues.
The problem is, that the error markers are not shown.

I read in another forum topic that it should be sufficient if a project build just with the XtextBuilder is triggered.

So I've tried this:

project.build(IncrementalProjectBuilder.FULL_BUILD, XTEXT_BUILDER_ID, null, new NullProgressMonitor());


Unfortunately, the markers are not generated too.
The biggest problem for me is, that the markers for EXPENSIVE checks are not shown.

Is there a way to show the markers? Or could you give me a hint about what I'm doing wrong?

Thank you very much! =)

Alex
Re: Display EXPENSIVE checks when building [message #1793214 is a reply to message #1793212] Wed, 01 August 2018 10:59 Go to previous messageGo to next message
Eclipse UserFriend
what do you mean by "show markers". ususally you schedule a validation job for expensive validation (see corresponding context menu action)
Re: Display EXPENSIVE checks when building [message #1793238 is a reply to message #1793214] Thu, 02 August 2018 01:54 Go to previous messageGo to next message
Eclipse UserFriend
I mean that the annotations and markers in the editors and in the project explorer are not shown.
Yes, I already saw the ValidationJob in ValidateActionHandler.

The problem is, in my own code I think I am not sure if I have sufficient info to create the ValidationJob.
And also I wondered if doing this by a ValdationJob is the correct way to go, because as I mentioned, I also read about invoking a build would also create annotations and markers in the editors.
Re: Display EXPENSIVE checks when building [message #1793240 is a reply to message #1793238] Thu, 02 August 2018 02:14 Go to previous messageGo to next message
Eclipse UserFriend
the questions is: what should trigger the expensive validation
Re: Display EXPENSIVE checks when building [message #1793242 is a reply to message #1793240] Thu, 02 August 2018 02:31 Go to previous messageGo to next message
Eclipse UserFriend
We have added a menu entry to the context menu of the Project Explorer.
When this menu entry is clicked, the "whole" validation should be performed, i.e. all files are processed and all validations (FAST, NORMAL and EXPENSIVE) are done.
When the validation is finished, the issues are displayed in a new View, this works just fine. But the annotations in the files and editors are not shown, because we do not know how to do this.

And I just tried to create the ValidationJob somehow, but I think this would be quite difficult.
Re: Display EXPENSIVE checks when building [message #1793244 is a reply to message #1793242] Thu, 02 August 2018 02:55 Go to previous messageGo to next message
Eclipse UserFriend
simly have a look at the existing

org.eclipse.xtext.ui.editor.handler.ValidateActionHandler
Re: Display EXPENSIVE checks when building [message #1793247 is a reply to message #1793244] Thu, 02 August 2018 03:02 Go to previous messageGo to next message
Eclipse UserFriend
I already looked at this class =)
The problem is, I think I do not have sufficient information for creating the ValidationJob, as I said before :).
Re: Display EXPENSIVE checks when building [message #1793248 is a reply to message #1793247] Thu, 02 August 2018 03:03 Go to previous messageGo to next message
Eclipse UserFriend
The question is, if there is any other possibility for doing what I want, or if creating a ValidationJob is the only possible solution.
Re: Display EXPENSIVE checks when building [message #1793250 is a reply to message #1793248] Thu, 02 August 2018 03:11 Go to previous message
Eclipse UserFriend
of course you could call the vaidator manually and created the annotations and markers manually too.
see that MarkerCreator does. and what ValidationJob+ ValidateActionHandler do.

=> you need to call the validator
=> you need to create markers
=> maybe you need to do something to update marker annotations in open editors
Previous Topic:RuntimeException - Context not valid for type
Next Topic:How to define Xtext grammar for a strange scenario
Goto Forum:
  


Current Time: Sat Jun 21 04:12:16 EDT 2025

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

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

Back to the top