NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Code Completion Problems PhpEd version 6 build 6033


Joined: 04 Feb 2008
Posts: 21
Location: Nottingham UK
Reply with quote
Hi,
I am having some code completion problems with the latest release of version 6 (build 6033).

When changing class code code as in adding: methods; var's; constants and deleting methods & var's these changes are not shown in code completion dropdowns elsewhere in the project. Yes code completion dropdowns show methods and var's that no longer exist.

I am using namespaces and 'use' clauses, but until recent updates I was not experiencing the issues above.

Most classes are of a singleton pattern each returning an instance. instance-> also fails to show methods that have been added and often show methods, constants and var's that no longer exist.

since this issue it has become very difficult to contiue with a framework development that is 7 months into its project.

any assistance / help etc would be appreciated.

As this situation is so bazzar I could produce a small webcast of the issue live within the IDE if that would help

Jonathan
View user's profileFind all posts by Jonathan_ParkerSend private messageVisit poster's website
Update


Joined: 04 Feb 2008
Posts: 21
Location: Nottingham UK
Reply with quote
I have tried removing the project from the workspace and recreating it with the same root file path and saving it as different name: Problems still exist.
View user's profileFind all posts by Jonathan_ParkerSend private messageVisit poster's website
Solution to code completion problems with namespaces


Joined: 04 Feb 2008
Posts: 21
Location: Nottingham UK
Reply with quote
I believe that I have found the problem and the possible fix (for my particular project!) although I have yet to modify all of my project.

Prior to udating to build 6033 I had used the following format for some of my classes within namespaces.


Code:

<?php
namespace App\Section\Module\ModuleName;

class ModuleName{

private static $instance = null;

private function __construct(){}

static function get_instance(){
if(self::$instance == null) self::$instance = new self();
return self::$instance;
}

}


Referencing the above class:
Code:

 use \App\Section\Module\ModuleName\ModuleName as Module;

Module::get_instance()->method();
 

As you will note a double use of the ModuleName ! This worked fine for me until I udated to build 6033. Since update I have had th ebazzar issues that I described in my initial post on this issue.
Changed namespace class format within my framework to:
Code:

namespace App\Section\Modules\ModuleName;

class Obj_ModuleName{

.. etc
}

Now brings back all of my code completion functionality:
Code:

use \App\section\Modules\ModuleName\Obj_ModuleName as Module;

Module::get_instance()->method();

Is working the way it should.

So prior to build 6033 I could have a class with the same name as the namspace that it was in. Now it would seem that a class can not be named the same as the namespace that it is in.
To be honest it makes for better code readability and based on my own experience I would recomend this approach.

My framework has quite an elaborate namespace structure and as such many may not see the issues that I have, but the above does seem to have got rid of my IDE code completion problems.
I would be interrested to hear from NuSphere staff on this one.
View user's profileFind all posts by Jonathan_ParkerSend private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
If you believe you experienced a problem with the IDE functionality, please contact support http://www.nusphere.com/contact_us and provide all details

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Code Completion Problems PhpEd version 6 build 6033
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