17 Replies Last post: May 19, 2014 1:11 PM by Emmanuel Belair  
Emmanuel Belair Newbie 23 posts since
Feb 7, 2012
Currently Being Moderated

Jan 13, 2014 8:40 PM

completion not working

Hi there,

 

I don't understand why completion is not working ...

when i press ctrl+space i haven't suggestion about a class which exists

Example in the screenshot: From the StoreService i want to import Customer class (that is located into Entity\Customer). Usually phpStorm purpose dropdown with a list of the classes including Entity\Customer.

But since few days, i don't get any project classes!

Andriy Bazanov Master 3,904 posts since
May 28, 2010
Currently Being Moderated
Jan 13, 2014 10:38 PM in response to: Emmanuel Belair
Re: completion not working

Hi there,

 

1) What version of PhpStorm do you use exactly (Help | About) ?

 

2) Will it (the desired class) be there (in completion list) if you invoke it (Ctrl+Space) just after @return tag (e.g. @return [CTRL+SPACE]) ?

 

3) Have you tried "File | Invalidate Caches..." yet ?

Andriy Bazanov Master 3,904 posts since
May 28, 2010
Currently Being Moderated
Jan 14, 2014 1:42 PM in response to: Emmanuel Belair
Re: completion not working

No real idea then.

 

Could be due to some conflict with 3rd party plugin, although unlikely (please disable all of them .. and try it like that).

 

But 7.1 is out for a while now -- please try it:

Alexey Gopachenko JetBrains 1,461 posts since
Aug 22, 2002
Currently Being Moderated
Jan 28, 2014 6:33 PM in response to: Emmanuel Belair
Re: completion not working

any exceptions in log?

Alexey Gopachenko JetBrains 1,461 posts since
Aug 22, 2002
Currently Being Moderated
Jan 30, 2014 3:36 PM in response to: Emmanuel Belair
Re: completion not working

Ok, just as I suspected.

This regression (around @method array) was introduced in last biuld and is fixed for next.

You can revert to back to 7.1 in the meantime or wait couple of days.

Liubov Melnikova JetBrains 215 posts since
Nov 8, 2013
Currently Being Moderated
May 14, 2014 3:08 PM in response to: Emmanuel Belair
Re: completion not working

Please try File | invalidate caches and restart at first. Let me know if it helps.

Liubov Melnikova JetBrains 215 posts since
Nov 8, 2013
Currently Being Moderated
May 14, 2014 10:18 PM in response to: Emmanuel Belair
Re: completion not working
Jim McKearney Newbie 16 posts since
May 28, 2005
Currently Being Moderated
May 17, 2014 9:15 AM in response to: Emmanuel Belair
Re: completion not working

Hi,

Your problem may be more related to name scope resolution and good old search paths.  I develop using the Laravel framework, are you zend?  Laravel tries to dynamicaly resolve in many cases as part of it architecture.  But you can include search paths,

sort of like JAVA class paths or LIBRARY_LD_PATHs. 

 

In Laravels case I created a subdir under the framework application dir called lib and add my libs there.

 

This is in my composer.json file:

 

       "psr-0": {

           "dbutils": "app/lib"

 

Laravel will include this in its name resolution search path.

 

Then I include those files I need:

 

<?php

    use dbutils\utils\SQL;

    use dbutils\query\Select;

    use dbutils\query\ResultSet;

    use dbutils\utils\ResultSetArray;

    use dbutils\database\mysql\MySQLConnection;

    use dbutils\database\mysql\MySQL;

 

    use dbutils\query\Table;

    use dbutils\query\Column;

    use dbutils\query\JoinType;

    use dbutils\query\ColType;

...  blah blah for a simple Laravel Controller
which uses the library...
    class CoverageCat
    {
        private $sql = null;
        public function __construct(MySQLConnection $sql)
        {
            $this->sql = $sql;
        }
        public function index()
        {
            $ret = "EMPTY";
            $select = new Select();
            $tbl_cat = new Table("test.climet_cvg_category", "cat");
            $select->addColumn("cat.cvg_cat_long_nm")->addColumn("cat.cvg_cat_key")
                ->addFrom($tbl_cat);
            $result = $this->sql->doQuery($select->toString());
            if (SQL::isSQL($result, 'ResultSet'))
            {.......
Everybody and Storm knows who we are referring to.  No Red Blobs !!!
And to test code directly in the Storm IDE I do this....
    use dbutils\query\ResultRows;
    use dbutils\query\ResultRow;
    use dbutils\query\ResultColumn;
    spl_autoload_extensions('.php');
    print "<p>" . get_include_path() . "</p>";
    //set_include_path(get_include_path().PATH_SEPARATOR.'../app/lib/');
    print "<p>" . get_include_path() . "</p>";
    spl_autoload_register();
    //spl_autoload_register(null, false);
    /*** specify extensions that may be loaded ***/
    //spl_autoload_extensions('.php, .class.php');
    /*** class Loader ***/
    function classLoader($class)
    {
        $filename = strtolower($class) . '.php';
        $file ='../app/lib/' . $filename;
        if (!file_exists($file))
        {
            return false;
        }
        include_once $file;
    }
    /*** register the loader functions ***/
    //spl_autoload_register(array('spl_autoload', 'classLoader'));
    $sql = new MySQLConnection();
    // ************* Define Tables ****************
    $tbl_employee = new Table("test.tbhrsemp", "e");
    $tbl_coverage = new Table("test.climet_ml_coverage_team", "cvg");
    $tbl_symbol = new Table("test.is_institution", "i");
And I can test code snips and logic right in the Storm IDE and debug locally...
Attached my Laravel Project Image from Storm 7.1.3  they look sort of like your projects...
Hope this helps if You are using Zend.  Humbly, blame plugins and versions is a last ditch attempt.  Try to figure out how things work, humbly said.
If you got version issues, the IDE and PHP system will let you know real quick.
Me still getting to understand PHP naming vodoo!!
Attachments:

More Like This

  • Retrieving data ...