|Remove warning/error marker [message #1776923]
||Wed, 22 November 2017 20:02
| Steffen Zschaler
Registered: July 2009
Is there a way from within Xtext to remove a marker created at a previous validation run?
I have implemented some validation checks in the usual Xtext way. One of these checks is potentially fairly expensive, but is also only relevant if a model contains a particular keyword. To make sure users are aware of the check not running by default, I have implemented a FAST check that simply adds a warning to the keyword if the keyword is present. This warning basically instructs users to run the expensive test.
When they do run the expensive test, it is possible that this produces an error marker. I would like the warning marker to be removed when the expensive test is run (regardless of whether this produces an error or not).
I think I know how to do this with standard Eclipse on-board tools (using ResourcePlugin). However, for obvious reasons these are not available to me from within the Xtext validation infrastructure. For the same reasons I don't want to introduce such a dependency in that plugin. Presumably, I could override parts of the validation infrastructure provided by Xtext, but I would rather want to avoid that if possible.
Is there a way to remove existing warnings/errors when running a validator?
|Re: Remove warning/error marker [message #1776932 is a reply to message #1776927]
||Wed, 22 November 2017 21:10
so you ae not talking about markers but about annotations?|
and how do you execute expensive validation?
for me this could be a bug .
seems to add stuff only but not remove existing ones.
can you please create a ticket at github.com/eclipse/xtext-eclipse
org.eclipse.xtext.ui.editor.validation.AddMarkersOperation.execute(IProgressMonitor) deletes the markers.
treats thst in the editor.
but thats marker annotations only.
this leaves the xtext annotations unattended
these are handle by org.eclipse.xtext.ui.editor.validation.AnnotationIssueProcessor.
imho the validationjob should use a hybrid of AnnotationIssueProcessor and MarkerIssueProcessor (in ValidateActionHandler)
maybe you can do some digging yourself
Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Powered by FUDForum
. Page generated in 0.02023 seconds