Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to get rid of obsolete validation errors?
How to get rid of obsolete validation errors? [message #989649] Fri, 07 December 2012 08:12 Go to next message
Aaron Digulla is currently offline Aaron DigullaFriend
Messages: 258
Registered: July 2009
Location: Switzerland
Senior Member
While developing a DSL, I often need to change my grammar. To make the unit tests pass, I need to update the test files.

Now I get validation errors because the version of the editor installed in another copy of Eclipse can't (yet) understand this new format. That's OK and expected.

Now I install the new version (with the new grammar) and restart. But the validation errors don't go away. That's bad.

How do I get rid of these obsolete errors?

I tried:

1. Restarting Eclipse
2. Forcing a rebuild
3. Select "Validate" in the project's context menu
4. Change and save each file

Of these, #2 and #4 work but both have drawbacks:

#4 is a lot of work because I have many files.

#2 triggers a bug in MercurialEclipse (https://bitbucket.org/mercurialeclipse/main/issue/351/files-under-version-control-get-deleted-by)

Questions:

1. Is there another way to handle this?

2. Why doesn't "Validate" clear the errors in the "Problems View"?
Re: How to get rid of obsolete validation errors? [message #989652 is a reply to message #989649] Fri, 07 December 2012 08:16 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi,

of course (2) would be the clean solution.
never the what about

(5) Delete the Error in the Problem view

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to get rid of obsolete validation errors? [message #991189 is a reply to message #989649] Mon, 17 December 2012 16:39 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
Aaron Digulla wrote on Fri, 07 December 2012 09:12

2. Why doesn't "Validate" clear the errors in the "Problems View"?



Might be related to http://www.eclipse.org/forums/index.php/t/441635/ ?

best,
Stephan
Re: How to get rid of obsolete validation errors? [message #991256 is a reply to message #989649] Tue, 18 December 2012 07:05 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Am 07.12.12 09:12, schrieb Aaron Digulla:

> 3. Select "Validate" in the project's context menu
>
> 2. Why doesn't "Validate" clear the errors in the "Problems View"?

I don't have a validate action in the context menu of the project. Which
plug-in contributes that?

Regards,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com
Re: How to get rid of obsolete validation errors? [message #991488 is a reply to message #991256] Wed, 19 December 2012 13:09 Go to previous messageGo to next message
Aaron Digulla is currently offline Aaron DigullaFriend
Messages: 258
Registered: July 2009
Location: Switzerland
Senior Member
I think Validate is contributed by Web Tools Project WTP or maybe the XML editors (because there are special settings for validating XML, HTML and DTD files).
Re: How to get rid of obsolete validation errors? [message #991636 is a reply to message #991488] Wed, 19 December 2012 22:22 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Am 19.12.12 14:09, schrieb Aaron Digulla:
> I think Validate is contributed by Web Tools Project WTP or maybe the
> XML editors (because there are special settings for validating XML, HTML
> and DTD files).

In that case I'm not suprised that no markers are removed, since this
validation has most likely nothing to do with EMF and Xtext's validation.

Regards,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com
Re: How to get rid of obsolete validation errors? [message #991823 is a reply to message #991636] Thu, 20 December 2012 09:25 Go to previous messageGo to next message
Aaron Digulla is currently offline Aaron DigullaFriend
Messages: 258
Registered: July 2009
Location: Switzerland
Senior Member
I think it would make sense to make it work for Xtext-based editors. Is there a chance you'll look at it when I open an issue?
Re: How to get rid of obsolete validation errors? [message #991838 is a reply to message #991823] Thu, 20 December 2012 10:07 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

I've seen these errors too and they're irritating but they're not an
Xtext problem. It would be wrong for Xtext to clean up another project's
mess.

The 'problem' is that EMF Validation is usually manually triggered and
so should be manually cleaned up. The solution might be for EMF to have
a builder that auto-validated and consequently cleaned up obsolete
validations.

Regards

Ed Willink


On 20/12/2012 09:25, Aaron Digulla wrote:
> I think it would make sense to make it work for Xtext-based editors.
> Is there a chance you'll look at it when I open an issue?
Re: How to get rid of obsolete validation errors? [message #991858 is a reply to message #991823] Thu, 20 December 2012 11:08 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Am 20.12.12 10:25, schrieb Aaron Digulla:
> I think it would make sense to make it work for Xtext-based editors. Is
> there a chance you'll look at it when I open an issue?

I doubt that we'll have the resources to implement something that hooks
into other project's validate actions.

Regards,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com
Re: How to get rid of obsolete validation errors? [message #991902 is a reply to message #991858] Thu, 20 December 2012 12:59 Go to previous messageGo to next message
Aaron Digulla is currently offline Aaron DigullaFriend
Messages: 258
Registered: July 2009
Location: Switzerland
Senior Member
You probably just need to use the extension point org.eclipse.wst.sse.ui.sourcevalidation and implement an IValidator.

Docs: http://www.eclipse.org/webtools/wst/components/sse/tutorials/source-validation.html#extending

JavaDoc for AbstractValidator: http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.wst.validation.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fwst%2Fvalidation%2FAbstractValidator.html

That aside, why doesn't the IDE clear all markers and rebuild all files when the version of the installed plugin changes?
Re: How to get rid of obsolete validation errors? [message #991943 is a reply to message #991838] Thu, 20 December 2012 14:19 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Ed,

It doesn't look like this has anything to do with EMF's validation.
Xtext itself adds a builder that validates DSL instances, including
cleaning up old errors...

Note that the M4 build supports "live validation" with decorators (via a
new generator option) and its used in the Sample Ecore Editor; that
approach doesn't produce markers only decorations (with hover details)
you can see in the editor.


On 20/12/2012 2:07 AM, Ed Willink wrote:
> Hi
>
> I've seen these errors too and they're irritating but they're not an
> Xtext problem. It would be wrong for Xtext to clean up another
> project's mess.
>
> The 'problem' is that EMF Validation is usually manually triggered and
> so should be manually cleaned up. The solution might be for EMF to
> have a builder that auto-validated and consequently cleaned up
> obsolete validations.
>
> Regards
>
> Ed Willink
>
>
> On 20/12/2012 09:25, Aaron Digulla wrote:
>> I think it would make sense to make it work for Xtext-based editors.
>> Is there a chance you'll look at it when I open an issue?
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: How to get rid of obsolete validation errors? [message #992067 is a reply to message #991902] Thu, 20 December 2012 19:38 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Am 20.12.12 13:59, schrieb Aaron Digulla:
> You probably just need to use the extension point
> org.eclipse.wst.sse.ui.sourcevalidation and implement an IValidator.
>
> Docs:
> http://www.eclipse.org/webtools/wst/components/sse/tutorials/source-validation.html#extending
>
>
> JavaDoc for AbstractValidator:
> http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.wst.validation.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fwst%2Fvalidation%2FAbstractValidator.html
>
>
> That aside, why doesn't the IDE clear all markers and rebuild all files
> when the version of the installed plugin changes?

Hi Aaron,

thanks for the pointer. I still don't think that we should add a
dependency to an arbitrary eclipse project just because that one
contributes a misleading menu item. Besides that, the contract of the
AbstractValidator looks quite complicated and pretty much mimics on
demand what the Xtext builder already does.

You are free to trigger a clean build manually as soon as you updated
the plugins. I don't think that's easily possible to detect an updated
plugin version, especially in the context of an runtime eclipse
workspace thus everything that we'd implement in that field would be
half baked. And in most cases, a clean build is not necessary and would
be quite annoying for the user.

Regards,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com
Re: How to get rid of obsolete validation errors? [message #992336 is a reply to message #992067] Fri, 21 December 2012 11:36 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
Sebastian Zarnekow wrote on Thu, 20 December 2012 20:38
I still don't think that we should add a
dependency to an arbitrary eclipse project just because that one
contributes a misleading menu item.


Would it make sense to propose this menu item to be pushed into the platform (and perhaps its contract cleaned up), so that we have a chance to make validate behavior of various plug-ins more consistent?

I've seen other confusing situations before, like when a .b3aggr file offers a "validate" action and a "validate aggregation". I'd love to see this coordinated somehow Smile

Stephan
Re: How to get rid of obsolete validation errors? [message #992343 is a reply to message #992336] Fri, 21 December 2012 11:50 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

+1

When (I think it's) WTP's at work you may even have two different
Validate menu actions.

It would be good to have a Validator extension point too, since this is
an area where the EMF API is rather weak.

Regards

Ed Willink

On 21/12/2012 11:36, Stephan Herrmann wrote:
> Sebastian Zarnekow wrote on Thu, 20 December 2012 20:38
>> I still don't think that we should add a dependency to an arbitrary
>> eclipse project just because that one contributes a misleading menu
>> item.
>
>
> Would it make sense to propose this menu item to be pushed into the
> platform (and perhaps its contract cleaned up), so that we have a
> chance to make validate behavior of various plug-ins more consistent?
>
> I've seen other confusing situations before, like when a .b3aggr file
> offers a "validate" action and a "validate aggregation". I'd love to
> see this coordinated somehow :)
>
> Stephan
>
Re: How to get rid of obsolete validation errors? [message #992696 is a reply to message #992343] Sat, 22 December 2012 10:19 Go to previous message
Aaron Digulla is currently offline Aaron DigullaFriend
Messages: 258
Registered: July 2009
Location: Switzerland
Senior Member
So the minimum should be to get the WTP project to show the "Validate" context menu item only for items which support it.

And the best solution would be to move the extension point into the platform so every plugin could use it.
Previous Topic:Which IValidationIssueProcessor should I use?
Next Topic:problem with trying the editor as Eclipse Application
Goto Forum:
  


Current Time: Thu Mar 28 15:21:36 GMT 2024

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

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

Back to the top