NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
[resolved] why I get this code completion error.
Veteran

Joined: 30 Nov 2006
Posts: 186
Reply with quote
Hi

It is a little difficult for me to understand why PHPed sometimes does code completion and sometimes not.

I am writing a component for the Joomla CMS, and sometimes when I write

$mainframe-> I get the windows displaying the class methods, and other sometimes I just get this error message.

Code completion is not available due to the following error(s):
Failed to find class of "$mainframe" member, (declared as JSite)

What does this mean ?
View user's profileFind all posts by hgrSend private message
Veteran

Joined: 24 Jan 2006
Posts: 311
Reply with quote
That means that the class JSite is not known to PhpED's code insight. You need to describe it - there is a similar post on this subject:
mysqli-in-oo-autocomplete-t2605.html?highlight=spl
View user's profileFind all posts by yfaktorSend private message
Veteran

Joined: 30 Nov 2006
Posts: 186
Reply with quote
Ok I found a file where $mainframe = new JSite() but that was not in scope where I use the $mainframe variable.

So I deleted that file, and searched for any other file where JSite was used, and there is none.

I have restarted PHPEd, to make it reload my workspace, but it still gives me the same error message when I try to lookup $mainframe->

And there is absolutely no code left where $mainframe is declared as an instance of JSite.

Is there a function that can re-index the code completion on the worspace ?
View user's profileFind all posts by hgrSend private message
Veteran

Joined: 30 Nov 2006
Posts: 186
Reply with quote
And here is the proof that there is no reference left to JSite.

But PHPed continues to give me the same error message when I want to lookup the methods for $mainframe->


View user's profileFind all posts by hgrSend private message
Veteran

Joined: 30 Nov 2006
Posts: 186
Reply with quote
Forgot to put in the search criterias.
View user's profileFind all posts by hgrSend private message
Veteran

Joined: 24 Jan 2006
Posts: 311
Reply with quote
what is $mainframe instance of now?
View user's profileFind all posts by yfaktorSend private message
Veteran

Joined: 30 Nov 2006
Posts: 186
Reply with quote
it is an instance of a class named mosMainFrame

See the image.

My point is that the class JSite is not used anywhere in the code but the code completion still think it is.


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

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
Quote:
I have restarted PHPEd, to make it reload my workspace, but it still gives me the same error message when I try to lookup $mainframe->

Restart the IDE won't help. You need to refresh Code Explorer.

Quote:
Is there a function that can re-index the code completion on the worspace ?

Still the same Smile it's Refresh in Code Explorer window.

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

Joined: 30 Nov 2006
Posts: 186
Reply with quote
Sorry but I have done this many times, by right clicking on the workspace in the explorer view and select refresh, and it still claims that $mainframe is defined as an instance of JSite.

It is like there is something written in cache, that is not cleard by refreshing.
View user's profileFind all posts by hgrSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
Please check that Code Explorer is not in "Single file" mode. In this case it re-parses only current file. Otherwise it refreshes all the project and all the libraries in the 'Code Insight Includes' list of directories.

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

Joined: 30 Nov 2006
Posts: 186
Reply with quote
That was the answer. When I changed it to Project view and refreshed the workspace, the lookup worked again.

But this is the tricky part.
I really love the singel file mode, because I get a good overview of the current file I am editing. But how to I then make sure that the code completion will refresh automaticly?
View user's profileFind all posts by hgrSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
It does refresh automatically in most cases.
It didn't refresh in your cases b'ze you deleted file and probably you didn't do it PhpED's workspace window, otherwise it would refresh too.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
[resolved] why I get this code completion error.
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 2  

  
  
 Reply to topic