Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to disable cross reference on predefined methods?(How to disable cross reference on predefined methods?)
How to disable cross reference on predefined methods? [message #1741912] Tue, 30 August 2016 14:41 Go to next message
Sachin Samaram is currently offline Sachin SamaramFriend
Messages: 271
Registered: April 2016
Senior Member
Hi,

Can anyone please tell me how to disable cross reference "Couldn't resolve reference"?
Re: How to disable cross reference on predefined methods? [message #1741928 is a reply to message #1741912] Tue, 30 August 2016 15:42 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13927
Registered: July 2009
Senior Member
can you explain why you want to do that? i most cases this is a bad idea

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
Re: How to disable cross reference on predefined methods? [message #1741931 is a reply to message #1741928] Tue, 30 August 2016 16:16 Go to previous messageGo to next message
Sachin Samaram is currently offline Sachin SamaramFriend
Messages: 271
Registered: April 2016
Senior Member
I have few methods which are in built with my product. So I no need to implement them externally. Editor should check them from jar.



Re: How to disable cross reference on predefined methods? [message #1741937 is a reply to message #1741931] Tue, 30 August 2016 16:48 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13927
Registered: July 2009
Senior Member
Well this question has no easy solution

(a) asuming your libary can be expressed in your dsl itself. and the dsl file containing project is a java project the you can put a jar containing the libary dsl files to the classpath of that project and it will work out of the box

(b) you should have a look at the concept of scoping. you could e.g. provide EObjectDescriptions for our libary inside a customization of DefaultGlobalScopeProvider

(c) you could customize org.eclipse.xtext.linking.ILinkingDiagnosticMessageProvider.getUnresolvedProxyMessage(ILinkingDiagnosticContext) and return null in certain situations


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
Re: How to disable cross reference on predefined methods? [message #1742117 is a reply to message #1741937] Wed, 31 August 2016 14:34 Go to previous messageGo to next message
Sachin Samaram is currently offline Sachin SamaramFriend
Messages: 271
Registered: April 2016
Senior Member
Hi,

Could you please tell me which method creates red underline if it doesn't find cross reference in HyperlinkHelper class?

Or, Can I at least remove red error underline?

[Updated on: Wed, 31 August 2016 14:37]

Report message to a moderator

Re: How to disable cross reference on predefined methods? [message #1742119 is a reply to message #1742117] Wed, 31 August 2016 14:36 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13927
Registered: July 2009
Senior Member
(C) debug it

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
Re: How to disable cross reference on predefined methods? [message #1742127 is a reply to message #1742119] Wed, 31 August 2016 15:32 Go to previous messageGo to next message
Sachin Samaram is currently offline Sachin SamaramFriend
Messages: 271
Registered: April 2016
Senior Member
Yes I did but any of the methods are not calling up in HyperlinkHelper class
Re: How to disable cross reference on predefined methods? [message #1742129 is a reply to message #1742127] Wed, 31 August 2016 15:48 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13927
Registered: July 2009
Senior Member
hyperlinkhelper uses resolved cross refs. it has ZERO todo with red underlining.

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
Re: How to disable cross reference on predefined methods? [message #1742131 is a reply to message #1742129] Wed, 31 August 2016 15:56 Go to previous messageGo to next message
Sachin Samaram is currently offline Sachin SamaramFriend
Messages: 271
Registered: April 2016
Senior Member
Can you explain please bit more?

[Updated on: Wed, 31 August 2016 16:00]

Report message to a moderator

Re: How to disable cross reference on predefined methods? [message #1742133 is a reply to message #1742131] Wed, 31 August 2016 16:04 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13927
Registered: July 2009
Senior Member
xtext cross referenced a resolved by the linking infrastructure using the scope provided by scopeproviders.
these use the class i gave you to produce errors.

the hyperlink helper uses at cross reference places that resolved references to do the hyperlinking
(it uses eobjectatoffsethelper)

i still dont know what you actually want to slove?

hyperlinking?
scoping?
ged rid of the error messages?


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
Re: How to disable cross reference on predefined methods? [message #1742135 is a reply to message #1742133] Wed, 31 August 2016 16:20 Go to previous messageGo to next message
Sachin Samaram is currently offline Sachin SamaramFriend
Messages: 271
Registered: April 2016
Senior Member
I want to get rid of error messages in case there is no cross reference available. Because I have some in built methods which are not visible to the code. So in such conditions I don't want to show error line. It is fine if they obey parser rule
Re: How to disable cross reference on predefined methods? [message #1742136 is a reply to message #1742135] Wed, 31 August 2016 16:19 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13927
Registered: July 2009
Senior Member
This is the Method i gave you. Set a breskpoint and See what happens

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
Re: How to disable cross reference on predefined methods? [message #1742137 is a reply to message #1742135] Wed, 31 August 2016 16:54 Go to previous messageGo to next message
Sachin Samaram is currently offline Sachin SamaramFriend
Messages: 271
Registered: April 2016
Senior Member
Hi,

I have extended HyperlinkHelper
@Inject
private EObjectAtOffsetHelper eObjectAtOffsetHelper;

but how can I override

public EObject resolveCrossReferencedElementAt(XtextResource resource, int offset) {
INode node = getCrossReferenceNode(resource, new TextRegion(offset, 0));
if (node != null)
return getCrossReferencedElement(node);
return null;
}

which is in EObjectAtOffsetHelper class.

[Updated on: Wed, 31 August 2016 16:55]

Report message to a moderator

Re: How to disable cross reference on predefined methods? [message #1742139 is a reply to message #1742137] Wed, 31 August 2016 17:19 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13927
Registered: July 2009
Senior Member
Yes but that has zero todo with the error message.
What is how to heal with unresolved references when hyper linking


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
Re: How to disable cross reference on predefined methods? [message #1742141 is a reply to message #1742139] Wed, 31 August 2016 17:23 Go to previous messageGo to next message
Sachin Samaram is currently offline Sachin SamaramFriend
Messages: 271
Registered: April 2016
Senior Member
So what is the solution for situation?
Re: How to disable cross reference on predefined methods? [message #1742238 is a reply to message #1742141] Thu, 01 September 2016 05:14 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13927
Registered: July 2009
Senior Member
Try to adapt the linking diagnostics message provider. That is a thing of 2 minutes for a first try

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
Re: How to disable cross reference on predefined methods? [message #1742264 is a reply to message #1742238] Thu, 01 September 2016 09:12 Go to previous message
Sachin Samaram is currently offline Sachin SamaramFriend
Messages: 271
Registered: April 2016
Senior Member
Yes it is working. Thank you sir.
Previous Topic:Indenting multiline values on serialization
Next Topic:xtext class not found error
Goto Forum:
  


Current Time: Fri May 07 09:52:47 GMT 2021

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

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

Back to the top