NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
"Find Declaration" stops working if I copy a file


Joined: 14 Apr 2007
Posts: 96
Reply with quote
This is a minor annoyance, but here goes. Lets say I have a file "a.php" In this file I am able to use "Find Declaration" for the methods or functions in this class. It works fine. Then, I need to make a backup, so I copy the file to another directory by dragging and dropping the file in phped. After doing this, the "Find Declaration" now takes me to the new file I just copied into the other directory. If I delete this other file because I no longer need it, "Find Declaration" no longer works at all.

Is there a way to force it to use the current file? Or to rebuild its list of symbols?


Thank you,

Rod
View user's profileFind all posts by rodericksimpsonSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8335
Reply with quote
I can't replicate the problem, yet.
What I tried is listed below:
-created file a.php with class My
-created file b.php that references to class My
-created a subdirectory in the project and created extra copy of the two files there
-at this point two My classes were shown in the code explorer. File b.php in the subdirectory opened a.php in that subdirectory upon I clicked Find Declaration on My class.
-I deleted a.php and checked again. Code Explorer updated itself and only one My class remained in the tree. Find Declaration still worked.



PS: to rebuild list of symbols you may just invoke Refresh in the Code Explorer window.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 14 Apr 2007
Posts: 96
Reply with quote
I tried using refresh, both at the folder level, and all the way at the top of the project.

I did try a few things, and I figured out that if I take of the extends part of the class declaration, everything works:


include ("xxx/path/to/class/a/a.php");

class b extends a <----------------- Find Declaration works if I remove "extends a"
{

}

It was working before I tried to copy the file. Also, I found the file in the includes tab for the project, and it says it is mapped correctly.

Any ideas?
View user's profileFind all posts by rodericksimpsonSend private message


Joined: 14 Apr 2007
Posts: 96
Reply with quote
I am still not able to get the "find declaration" to work for some files. It seems that they are all ones that extend a particular file. Things I have tried:
1. doing a "refresh".
2. I have tried deleting the include for the original class.
3. deleting the file and then creating a new one (and pasting the code in).


I also noticed that all other files that extend this main file have the same problem.

One thing that does work is if I delete the "extends classA" part from the class definition, everthing works as it should.


I also found that when I ran phpdoc, it did not pick up any of these files that extend this class.

Any ideas?
View user's profileFind all posts by rodericksimpsonSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8335
Reply with quote
if Code Insight and PHPDOC are unable to pick the files with your classes, please make sure that the files are in the project and their extension matches an extension listed for PHP4 or PHP5 in the tools->settings->file associations

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 14 Apr 2007
Posts: 96
Reply with quote
Dmitri,

I have verified that the files are associated with php4. The type is .class, but I tried changing it to .php (then refreshing the folder), but it still would not work. Also, they are in the active project.

The only thing that I can do to make the "find declaration" work is to remove the "extends class_a" from the class declaration. Let me know if you need anything else (I can send screenshots, files, etc..)

Thank you,

-r
View user's profileFind all posts by rodericksimpsonSend private message
"Find Declaration" stops working if I copy a file
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic