Skip to main content



      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 09:12 Go to next message
Eclipse UserFriend
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 ReferenceFinder.java.
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 90 times)
Re: How do I implement the "Find References" function? [message #1862768 is a reply to message #1862767] Thu, 28 December 2023 09:38 Go to previous message
Eclipse UserFriend
If you use normal xtext cross references this will work ootb
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: Sat Apr 19 15:08:33 EDT 2025

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

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

Back to the top