Bug 76752 - "Open Declaration" causes a twin of the current file to be opened
Summary: "Open Declaration" causes a twin of the current file to be opened
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 2.0.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0   Edit
Assignee: Devin Steffler CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 92915
Blocks:
  Show dependency tree
 
Reported: 2004-10-21 11:06 EDT by Chad Barnes CLA
Modified: 2009-01-09 16:56 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chad Barnes CLA 2004-10-21 11:06:11 EDT
In one of our customer's sources, she is highlighting a procedure name
and selecting "Open Declartion".  This causes a new editor to open with the
same file in it.  Now, there are two editors displaying the same file.
However, hovering over the tab shows the original file at location:
   
    UserInterfaceView/blah/blah/blah.c  (a linked resource path)

And the second editor shows the location:

    M:/network_drive/view/blah/blah/blah.c  (the actual location)

Now, add on top of this, if she again selects "Open Declaration", but on
the second editor's file, an error occurs:
    java.lang.reflect.InvocationTargetException
    at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:284)
    at org.eclipse.jface.dialogs.ProgressMonitorDialog.run
(ProgressMonitorDialog.java:397)
    at org.eclipse.cdt.internal.ui.search.actions.OpenDeclarationsAction.run
(OpenDeclarationsAction.java:200)
    .
    .
    .
The place I can find it going bad is:

    OpenDeclarationActions.class (CDT 2.0.2) line #153:

    IFile resourceFile = fEditor.getInputFile();

This returns null.

This seems to be a side-effect of using linked-resources.
Comment 1 Devin Steffler CLA 2005-04-28 09:32:11 EDT
I think this is fixed in CVS HEAD.

Can you give me a specific example of how I can reproduce this to check?
Comment 2 Chad Barnes CLA 2005-04-28 09:51:43 EDT
At the time of this problem, the project was setup such that all the contents 
were in a single linked resource utilizing a linked resource variable:

Project\
   Stuff (linked res -> \MY_VARIABLE\stuff)\
      src\
      build\
      inc\
      lib\

MY_VARIABLE -> \\network_location\blah\blah

Working on source files in this linked resource would show the open 
declaration problem.

Comment 3 Devin Steffler CLA 2005-04-28 10:03:52 EDT
This should be fixed once 92915 is fixed.
Comment 4 Devin Steffler CLA 2005-05-03 15:20:53 EDT
FIXED in HEAD.  Please verify.