bmewburn / intelephense-docs

Documentation for the Intelephense PHP language server
https://intelephense.com
Other
184 stars 17 forks source link

LS cannot find a class in the workspace #46

Open ivaaaan opened 2 years ago

ivaaaan commented 2 years ago

Hey. I'm facing with an issue when LS couldn't find a class in the workspace.

My code structure:

www/
...pages/
......some_class.php
tests/
...pages/
......SomeClassTest.php

some_class.php:

class Someclass
{

}

SomeClassTest.php:

class SomeClassTest extends Test 
{
   public function test()
   {
        $obj = new \SomeClass();
    }
}

LSP returns an error Undefined type SomeClass. It's interesting that LSP can find other classes that in the global namespace, including classes in the same directory that some_class.php file is. It's 40k lines long, btw, perhaps that's an issue?

Can you please help me to resolve this issue?

quelilon commented 1 year ago

I have this type of error with new Redis(), how to fix it?