So I was playing around with creating an custom rule (https://phpstan.org/developing-extensions/rules) when I noticed that in VSCode using PHP Tools extension (activated) does not provide me with the resolved (generic) type.
See the screenshot in VSCode:

The same in PHPStorm seems fine:

I can provide a repo link complete with devcontainer setup if you guys think that would help, but I think it easy to recreate locally (you just need to install PHPStan as an dependency).
<?php
declare(strict_types=1);
namespace Ilyes512\PHPStanCustomRules\Rules;
use PhpParser\Node;
use PhpParser\Node\Expr\New_;
use PhpParser\Node\Name;
use PHPStan\Analyser\Scope;
use PHPStan\Rules\Rule;
/**
* @implements Rule<New_>
*/
class UseFactoryRule implements Rule
{
public function getNodeType(): string
{
return New_::class;
}
public function processNode(Node $node, Scope $scope): array
{
if (!$node->class instanceof Name) {
return [];
}
dump($node->class);
return [];
}
}