Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Call quickfix validation from Problems View
Call quickfix validation from Problems View [message #1807321] Tue, 28 May 2019 03:25 Go to next message
Eclipse UserFriend
Hi,

I have a question on xtext, validace and quickfixes.

We have defined validations in xtext. I have defined quickfix (Ctrl + 1) for the validation. This works fine.

validation:
warning("Component version is deprecated", ProcessDesignerPackage.eINSTANCE.componentVersionElement_Version, DEPRECATED_VERSION)


quickfix:
@Fix(ProcessDesignerValidator.DEPRECATED_VERSION)
	public void removeDeprecatedVersion(final Issue issue, IssueResolutionAcceptor acceptor) {
		acceptor.accept(issue, REMOVE_COMPONENT_VERSION, REMOVE_COMPONENT_VERSION, null, new ISemanticModification() {
			@Override
			public void apply(EObject element, IModificationContext context) throws Exception {
				...
			}
		});
	}


The validation result defined in xtext is also displayed in Problems View. However, if I want to call quickfix from Problems View (via the right button),
this is not possible because the menu item is disabled.

How to call (enable) quickfix validation from Problems View?

Thanks for every advice.

Martin
Re: Call quickfix validation from Problems View [message #1807322 is a reply to message #1807321] Tue, 28 May 2019 03:27 Go to previous messageGo to next message
Eclipse UserFriend
hi, which menu item do you refer to?
Re: Call quickfix validation from Problems View [message #1807324 is a reply to message #1807322] Tue, 28 May 2019 03:37 Go to previous messageGo to next message
Eclipse UserFriend
I mean the item Quick Fix (Ctrl + 1) in menu using the right mouse button to validate, which is disabled. You may still need to refer to the quickfix from Problmes View, I don't know.
Re: Call quickfix validation from Problems View [message #1807326 is a reply to message #1807324] Tue, 28 May 2019 03:56 Go to previous messageGo to next message
Eclipse UserFriend
hmmm i cannot follow you. from the snippet you posted that should work.
are you sure you rebuilt the project after implementing the quickfix?
does the quickfix work in the editor?
Re: Call quickfix validation from Problems View [message #1807348 is a reply to message #1807326] Tue, 28 May 2019 07:24 Go to previous messageGo to next message
Eclipse UserFriend
In xtext editor work but in Problems is disabled (see image)

https://firsoft.cz/images/xtext.png
Re: Call quickfix validation from Problems View [message #1807356 is a reply to message #1807348] Tue, 28 May 2019 08:46 Go to previous messageGo to next message
Eclipse UserFriend
i cannot reproduced that.
you might want to debug
org.eclipse.ui.internal.views.markers.QuickFixPropertyTester
respectively org.eclipse.xtext.ui.editor.quickfix.MarkerResolutionGenerator.hasResolutions(IMarker)

=> can you provide a hello world example reproducing the problem
=> can you also provide details about your system (Help -> About -> Installation Details -> Configuration
=> can you also have a look into the error log if there are any issues.
Re: Call quickfix validation from Problems View [message #1807391 is a reply to message #1807356] Wed, 29 May 2019 03:45 Go to previous messageGo to next message
Eclipse UserFriend
Perhaps important information is that xText is linked to Sirius (https://github.com/ObeoNetwork/Xtext-Sirius-integration).
The validations defined in Sirius can be corrected from Problems (using quickfix).

I tried to make a debug. In the MarkerHelpRegistry class, the hasResolutions method returns everywhere
on MarkerQueryResult result = query.performQuery(marker) null, so the marker will not find it in resolutionQueries.
Therefore, it returns hasResolutions false.

Unfortunately I cannot provide the project, it is quite extensive. There are no log errors.
Re: Call quickfix validation from Problems View [message #1807393 is a reply to message #1807391] Wed, 29 May 2019 03:56 Go to previous messageGo to next message
Eclipse UserFriend
=> debug into the internals of MarkerHelpRegistry
Re: Call quickfix validation from Problems View [message #1807396 is a reply to message #1807393] Wed, 29 May 2019 04:21 Go to previous messageGo to next message
Eclipse UserFriend
Sorry, but I don't get it now. I did the Debug in MarkerHelpRegistry. See previous message.
Re: Call quickfix validation from Problems View [message #1807397 is a reply to message #1807396] Wed, 29 May 2019 04:23 Go to previous messageGo to next message
Eclipse UserFriend
yes but in my case MarkerHelpRegistry asks org.eclipse.xtext.ui.editor.quickfix.MarkerResolutionGenerator.hasResolutions(IMarker)
and it says yes.
you have to find out why it does not in your case
Re: Call quickfix validation from Problems View [message #1807398 is a reply to message #1807397] Wed, 29 May 2019 04:30 Go to previous messageGo to next message
Eclipse UserFriend
here is the stack

MarkerResolutionGenerator.hasResolutions(IMarker) line: 84
MarkerHelpRegistry.hasResolution(IMarker, IConfigurationElement) line: 202
MarkerHelpRegistry.hasResolutions(IMarker) line: 171
QuickFixPropertyTester.test(Object, String, Object[], Object) line: 40
Property.test(Object, Object[], Object) line: 65
Re: Call quickfix validation from Problems View [message #1807401 is a reply to message #1807398] Wed, 29 May 2019 04:46 Go to previous message
Eclipse UserFriend
I figured it out. The error was in the definition of extension markerResolutionGenerator, where there was a bad (unknown) markerType.

Thanks a lot for your help!
Previous Topic:How to open model file in text editor programmatically
Next Topic:Inferring a class with generics in JvmModelInferrer
Goto Forum:
  


Current Time: Thu Mar 20 15:19:15 EDT 2025

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

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

Back to the top