Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to disable cross-resource reference
How to disable cross-resource reference [message #1782922] Mon, 05 March 2018 07:52 Go to next message
Weihua Fan is currently offline Weihua FanFriend
Messages: 18
Registered: December 2015
Junior Member
Hi

I have a project that running my grammar perfectly until recently. I found that one DSL file will automatically cross refer to an Element in another DSL file if it cant find it in local file instead of reporting a not found error.

e.x.

In myRule1.dsl :
ruleA(>ruleB) = ......
// ruleB() = ......

In myRule2.dsl :
ruleB() = ......

ruleA and ruleB are same type of element (Rule) that defined in my grammar.
The problem is when I comment out ruleB from myRule1.dsl I dont get an rule-not-found error, instead when I CMD+Click on ruleB (after '>') it leads me to definition of ruleB in myRule2.dsl. Thats not what I want, can I disable this default cross-resouce reference behavior?

Thanks in advance.
Re: How to disable cross-resource reference [message #1782923 is a reply to message #1782922] Mon, 05 March 2018 07:56 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12237
Registered: July 2009
Senior Member
you could write your own org.eclipse.xtext.scoping.IGlobalScopeProvider that returns IScope.NULLSCOPE

Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: How to disable cross-resource reference [message #1783036 is a reply to message #1782923] Wed, 07 March 2018 04:13 Go to previous message
Weihua Fan is currently offline Weihua FanFriend
Messages: 18
Registered: December 2015
Junior Member
Thank you. It works
Previous Topic:Best place to create an instance of an external referenced emf model element?
Next Topic:Assert error in FormatterTestHelper due to different whitespace in ITextRegionAccess strings.
Goto Forum:
  


Current Time: Sat Sep 22 01:04:42 GMT 2018

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

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

Back to the top