Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How do I implement the "Find References" function?(How do I implement the "Find References" function?)
How do I implement the "Find References" function? [message #1862767] Thu, 28 December 2023 14:12 Go to next message
David Sun is currently offline David SunFriend
Messages: 45
Registered: July 2020
I created two DSLS with xtext, one called DSL A and one called DSL B.

I created a project in eclipse.

In my project, I used DSL A to create a source code file called xxx.a and in it I created a variable "abcd";

In my project, I created a source code file called zzz.b with DLS B and used the variable "abcd" in xxx.a.

I am now going to implement the "Find References" function from the right-click menu in XtextEditor to find out where the variable "abcd" is being used in the file xxx.a in my project.

The function of "Find the References" was implemented by the org.eclipse.xtext.findReferences.ReferenceFinder.
I debuged the
In the method org.eclipse.xtext.findReferences.ReferenceFinder.findAllReferences(TargetURIs targetURIs, IResourceAccess resourceAccess,
IResourceDescriptions indexData, Acceptor acceptor, IProgressMonitor monitor), indexData.getAllResourceDescriptions () statement returns no IResourceDescription object in the result. The variable "indexData" is object of org.eclipse.xtext.builder.impl.DirtyStateAwareResourceDescriptions.

How do I implement the "Find References" function?
Please give me some proposals.
Thanks a lot !
  • Attachment: xtext.png
    (Size: 66.08KB, Downloaded 40 times)
Re: How do I implement the "Find References" function? [message #1862768 is a reply to message #1862767] Thu, 28 December 2023 14:38 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14699
Registered: July 2009
Senior Member
If you use normal xtext cross references this will work ootb

Twitter : @chrdietrich
Blog :
Previous Topic:Grammar for extension equal to a keyword
Next Topic:Reference from xxxx will not be updated as the language has not registered an IReferenceUpdater
Goto Forum:

Current Time: Mon Jul 22 20:33:48 GMT 2024

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

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

Back to the top