bmewburn / vscode-intelephense

PHP intellisense for Visual Studio Code
https://intelephense.com
Other
1.63k stars 94 forks source link

Vendor class shows as undefined type #2637

Closed murugappanrm closed 7 months ago

murugappanrm commented 1 year ago

Describe the bug Extension is reporting vendor class as undefined type

To Reproduce A code snippet (NOT a screenshot of a code snippet) or steps to reproduce the issue

<?php

use Muru\Framework\Console\Kernel;
use Psr\Container\ContainerInterface;

// set a base path and autoloading

require __DIR__ . '/../vendor/autoload.php';

function dd(...$v)
{
    d(...$v);
    exit;
}
Kint::$aliases[] = 'dd';
defined('BASEPATH') or define('BASEPATH', dirname(__DIR__));
// -------------------------------------
// require the container
/** @var ContainerInterface $container */
$container = require_once BASEPATH . '/config/services.php';

// get the Console Kernel from the container

$kernel = $container->get(Kernel::class);

// call a handle method on the kernel, return the console application status code
$status = $kernel->handle();

// exist with that status

exit($status);

?>

Expected behavior This should not be reported as errors. Screenshots If applicable, add screenshots to help explain your problem.

Screenshot_7

Platform and version OS and Intelephense version.

Windows: 10 PHP: 8.1.17 Intelephense: 1.9.5

murugappanrm commented 1 year ago

The problem has become worse with the latest version 1.9.5. I am now trying out older version 1.9.4Where is the fix please?

murugappanrm commented 1 year ago

Why is there no resolution for this?

juanwilde commented 1 year ago

I am running into the same issue with Mongo dependencies. Even sometimes with classes in the project, for example, an enum that is used on an entity :(

bmewburn commented 7 months ago

Please try reindexing. ctrl + shift + p -> Index workspace. If this does not fix it please open a new ticket with a reproducible example.