Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 344586

Summary: Find references gives incorrect results if started in a file that does not contain the declaration
Product: [Modeling] TMF Reporter: Hendrik Eeckhaut <hendrik>
Component: XtextAssignee: Jan Koehnlein <jan>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jan, sebastian.zarnekow, tmf.xtext-inbox
Version: 2.0.0Flags: sebastian.zarnekow: indigo+
Target Milestone: RC1   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Hendrik Eeckhaut CLA 2011-05-03 10:34:40 EDT
Build Identifier: M20110210-1200

If you search for references for an object that is declared in another file, the search results only contain (duplicate) references in the current files. If you trigger find references in a file that contains the declaration the search results are correct.

I am using Xtext 2.0 M6

Reproducible: Always

Steps to Reproduce:
1. Start Eclipse with the Domain Model Example 
2. create a file1.dmodel with following content:
     entity Foo1 {}
     entity Foo2 extends Foo1 {}
3. create a file2.dmodel with following content:
     entity Foo3 extends Foo1 {}
4. If you find references in file1.dmodel you get correct search results. But if you search references of Foo1 in file2.dmodel the search results are:
  file2.dmodel
     Foo3 - Entity
     Foo3 - Entity
Comment 1 Jan Koehnlein CLA 2011-05-04 06:16:57 EDT
This has been fixed with one of the recent commits. 

Nevertheless, I had to implement a better startegy for 
  JvmModelReferenceFilter.isInferredJvmElement(URI)
which did not take multiple derived JvmModelElements into account, such that the inferred JvmType of Foo2 also appeared in the search results.
Comment 2 Karsten Thoms CLA 2017-09-19 17:36:43 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 3 Karsten Thoms CLA 2017-09-19 17:47:39 EDT
Closing all bugs that were set to RESOLVED before Neon.0