Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Suppress or Override Quickfix for Unresolved Definition(Performance issue when reference to resource not found)
Suppress or Override Quickfix for Unresolved Definition [message #1736736] Fri, 01 July 2016 11:46 Go to next message
Michael Colburn is currently offline Michael ColburnFriend
Messages: 10
Registered: November 2012
Junior Member
I have an application with two DSLs, where one refers to the other. The extension for the first DSL is *.ares. The second uses *.atem.

As a simple example consider these two files:

First DSL file, test_data.ares has:

key01 = "text one"
key02 = "text two"

Second, different DSL, test.atem has:

import test_data.*
sid key01
sid key03

The argument of 'sid' is a key from test_data.ares.

Note that key03 does not exist. So, it gets flagged as an error:
Couldn't resolve reference to Definition 'key03'

If one places the cursor over the flagged key in test.atem, a popup
appears with the same message and suggests changing it to key01 or key02 as a quickfix. Normally this is a nice feature.

But, here is my problem...

The user of this application has created thousands of files for the DSL that uses the ares extension. The files contains nearly 1 million entries (key = value).

If the definition from the ares DSL that is referenced in the atem DSL exists, there is no performance problem. But if it does not exist, when the user hovers over the flagged reference, the application clocks for about five minutes before the user regains control.

I would like to avoid the quickfix for this situation, that is, either turn it off or override it so that it does nothing.

I believe that the message:

Couldn't resolve reference to Definition

comes from the Xtext core LinkingDiagnosticProxyMessage.getUnresolvedProxyMessage, line 32:
String msg = "Couldn't resolve reference to " + referenceType.getName() + " '" + linkText + "'.";

Which is called by Linker.ensureIsLinked, line 134:
DiagnosticMessage message = diagnosticMessageProvider.getUnresolvedProxyMessage(context);

Thank you!
Re: Suppress or Override Quickfix for Unresolved Definition [message #1736738 is a reply to message #1736736] Fri, 01 July 2016 12:02 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14735
Registered: July 2009
Senior Member
see org.eclipse.xtext.ui.editor.quickfix.DefaultQuickfixProvider.createLinkingIssueResolutions(Issue, IssueResolutionAcceptor)
(override it in YOurDslQuickfixProvider and do nothing. (no call super)


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
Re: Suppress or Override Quickfix for Unresolved Definition [message #1736743 is a reply to message #1736738] Fri, 01 July 2016 12:16 Go to previous message
Michael Colburn is currently offline Michael ColburnFriend
Messages: 10
Registered: November 2012
Junior Member
That worked. Thanks!
Previous Topic:Using ImportURIScopingFragment instead of ImportNamespacesScopingFragment with the new MWE2
Next Topic:xtext editor hanging for long time
Goto Forum:
  


Current Time: Tue Dec 03 21:15:41 GMT 2024

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

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

Back to the top