Closed sminnee closed 1 year ago
If this would be too hard, is it possible to use include()
, require()
, or require_once()
in these files?
I think i'm also having the same issue, I want to load .phpstorm.meta.php
config contained in the following composer
packages.
If/when using phpstorm + symfony those packages are bundled into the phpstorm symfony extension.
After I add them as composer dependencies using
composer require thomas-schulz/symfony-meta --dev
composer require thomas-schulz/doctrine-phpstorm-meta --dev
I can see that the the following .phpstorm.meta.php
files can be found inside the vendor/
folder.
$ find vendor -name ".phpstorm.meta.php"
vendor/thomas-schulz/doctrine-phpstorm-meta/dbal/.phpstorm.meta.php
vendor/thomas-schulz/doctrine-phpstorm-meta/annotations/.phpstorm.meta.php
vendor/thomas-schulz/doctrine-phpstorm-meta/orm/.phpstorm.meta.php
vendor/thomas-schulz/doctrine-phpstorm-meta/collections/.phpstorm.meta.php
vendor/thomas-schulz/symfony-meta/Psr/Log/.phpstorm.meta.php
vendor/thomas-schulz/symfony-meta/Monolog/.phpstorm.meta.php
vendor/thomas-schulz/symfony-meta/Symfony/Bridge/PhpUnit/.phpstorm.meta.php
vendor/thomas-schulz/symfony-meta/Symfony/Bridge/Twig/Mime/.phpstorm.meta.php
vendor/thomas-schulz/symfony-meta/Symfony/Component/HttpKernel/.phpstorm.meta.php
vendor/thomas-schulz/symfony-meta/Symfony/Component/Form/.phpstorm.meta.php
vendor/thomas-schulz/symfony-meta/Symfony/Component/HttpClient/.phpstorm.meta.php
vendor/thomas-schulz/symfony-meta/Symfony/Component/Validator/.phpstorm.meta.php
vendor/thomas-schulz/symfony-meta/Symfony/Component/Config/.phpstorm.meta.php
vendor/thomas-schulz/symfony-meta/Symfony/Component/Security/.phpstorm.meta.php
vendor/thomas-schulz/symfony-meta/Symfony/Component/ExpressionLanguage/.phpstorm.meta.php
vendor/thomas-schulz/symfony-meta/Symfony/Component/Ldap/.phpstorm.meta.php
vendor/thomas-schulz/symfony-meta/Symfony/Component/PropertyInfo/.phpstorm.meta.php
vendor/thomas-schulz/symfony-meta/Symfony/Component/EventDispatcher/.phpstorm.meta.php
vendor/thomas-schulz/symfony-meta/Symfony/Component/Templating/.phpstorm.meta.php
vendor/thomas-schulz/symfony-meta/Symfony/Component/Finder/.phpstorm.meta.php
vendor/thomas-schulz/symfony-meta/Symfony/Component/Workflow/.phpstorm.meta.php
vendor/thomas-schulz/symfony-meta/Symfony/Component/DomCrawler/.phpstorm.meta.php
vendor/thomas-schulz/symfony-meta/Symfony/Component/Yaml/.phpstorm.meta.php
vendor/thomas-schulz/symfony-meta/Symfony/Component/Mime/.phpstorm.meta.php
vendor/thomas-schulz/symfony-meta/Symfony/Component/OptionsResolver/.phpstorm.meta.php
vendor/thomas-schulz/symfony-meta/Symfony/Component/Routing/.phpstorm.meta.php
vendor/thomas-schulz/symfony-meta/Symfony/Component/CssSelector/.phpstorm.meta.php
vendor/thomas-schulz/symfony-meta/Symfony/Component/VarDumper/.phpstorm.meta.php
vendor/thomas-schulz/symfony-meta/Symfony/Component/DependencyInjection/.phpstorm.meta.php
vendor/thomas-schulz/symfony-meta/Symfony/Component/HttpFoundation/.phpstorm.meta.php
vendor/thomas-schulz/symfony-meta/Symfony/Component/Process/.phpstorm.meta.php
vendor/thomas-schulz/symfony-meta/Symfony/Component/Console/.phpstorm.meta.php
vendor/thomas-schulz/symfony-meta/Symfony/Bundle/WebServerBundle/.phpstorm.meta.php
vendor/thomas-schulz/symfony-meta/Symfony/Bundle/FrameworkBundle/.phpstorm.meta.php
vendor/thomas-schulz/symfony-meta/Symfony/Bundle/WebProfilerBundle/.phpstorm.meta.php
As far as I can tell though the intelephense plugin isn't loading them.
I think i'm also having the same issue, I want to load
.phpstorm.meta.php
config contained in the followingcomposer
packages.
- https://github.com/King2500/symfony-phpstorm-meta
- https://github.com/King2500/doctrine-phpstorm-meta
If/when using phpstorm + symfony those packages are bundled into the phpstorm symfony extension.
After I add them as composer dependencies using
composer require thomas-schulz/symfony-meta --dev composer require thomas-schulz/doctrine-phpstorm-meta --dev
I can see that the the following
.phpstorm.meta.php
files can be found inside thevendor/
folder.$ find vendor -name ".phpstorm.meta.php" vendor/thomas-schulz/doctrine-phpstorm-meta/dbal/.phpstorm.meta.php vendor/thomas-schulz/doctrine-phpstorm-meta/annotations/.phpstorm.meta.php vendor/thomas-schulz/doctrine-phpstorm-meta/orm/.phpstorm.meta.php vendor/thomas-schulz/doctrine-phpstorm-meta/collections/.phpstorm.meta.php vendor/thomas-schulz/symfony-meta/Psr/Log/.phpstorm.meta.php vendor/thomas-schulz/symfony-meta/Monolog/.phpstorm.meta.php vendor/thomas-schulz/symfony-meta/Symfony/Bridge/PhpUnit/.phpstorm.meta.php vendor/thomas-schulz/symfony-meta/Symfony/Bridge/Twig/Mime/.phpstorm.meta.php vendor/thomas-schulz/symfony-meta/Symfony/Component/HttpKernel/.phpstorm.meta.php vendor/thomas-schulz/symfony-meta/Symfony/Component/Form/.phpstorm.meta.php vendor/thomas-schulz/symfony-meta/Symfony/Component/HttpClient/.phpstorm.meta.php vendor/thomas-schulz/symfony-meta/Symfony/Component/Validator/.phpstorm.meta.php vendor/thomas-schulz/symfony-meta/Symfony/Component/Config/.phpstorm.meta.php vendor/thomas-schulz/symfony-meta/Symfony/Component/Security/.phpstorm.meta.php vendor/thomas-schulz/symfony-meta/Symfony/Component/ExpressionLanguage/.phpstorm.meta.php vendor/thomas-schulz/symfony-meta/Symfony/Component/Ldap/.phpstorm.meta.php vendor/thomas-schulz/symfony-meta/Symfony/Component/PropertyInfo/.phpstorm.meta.php vendor/thomas-schulz/symfony-meta/Symfony/Component/EventDispatcher/.phpstorm.meta.php vendor/thomas-schulz/symfony-meta/Symfony/Component/Templating/.phpstorm.meta.php vendor/thomas-schulz/symfony-meta/Symfony/Component/Finder/.phpstorm.meta.php vendor/thomas-schulz/symfony-meta/Symfony/Component/Workflow/.phpstorm.meta.php vendor/thomas-schulz/symfony-meta/Symfony/Component/DomCrawler/.phpstorm.meta.php vendor/thomas-schulz/symfony-meta/Symfony/Component/Yaml/.phpstorm.meta.php vendor/thomas-schulz/symfony-meta/Symfony/Component/Mime/.phpstorm.meta.php vendor/thomas-schulz/symfony-meta/Symfony/Component/OptionsResolver/.phpstorm.meta.php vendor/thomas-schulz/symfony-meta/Symfony/Component/Routing/.phpstorm.meta.php vendor/thomas-schulz/symfony-meta/Symfony/Component/CssSelector/.phpstorm.meta.php vendor/thomas-schulz/symfony-meta/Symfony/Component/VarDumper/.phpstorm.meta.php vendor/thomas-schulz/symfony-meta/Symfony/Component/DependencyInjection/.phpstorm.meta.php vendor/thomas-schulz/symfony-meta/Symfony/Component/HttpFoundation/.phpstorm.meta.php vendor/thomas-schulz/symfony-meta/Symfony/Component/Process/.phpstorm.meta.php vendor/thomas-schulz/symfony-meta/Symfony/Component/Console/.phpstorm.meta.php vendor/thomas-schulz/symfony-meta/Symfony/Bundle/WebServerBundle/.phpstorm.meta.php vendor/thomas-schulz/symfony-meta/Symfony/Bundle/FrameworkBundle/.phpstorm.meta.php vendor/thomas-schulz/symfony-meta/Symfony/Bundle/WebProfilerBundle/.phpstorm.meta.php
As far as I can tell though the intelephense plugin isn't loading them.
Any solution for this
there are no plans to further support phpstorm metadata.
Is there an alternative metadata format for VSCode that is able to be included in subdirectories?
There were 2 cases were phpstorm metadata was understood by this extension.
This extension will move towards providing this all via a phpdoc type system.
Case 1 is solved by templates which were added in 1.9. A vendor can type classes, traits, interfaces, functions, methods, properties with template syntax or a user can provide a stub to override the vendor declaration. For example, using a method in the linked framework/issue, it can be annotated like so:
namespace SilverStripe\Core\Injector;
class Injector implements ContainerInterface
{
/**
*
* @template T of object
*
* @param class-string<T> $name
* @param mixed ...$argument arguments to pass to the constructor
* @return T A new instance of the specified object
*/
public function create($name, $argument = null) { }
}
case 2 will have a similar solution in a future release.
This extension will move towards providing this all via a phpdoc type system.
Does this mean that existing support for PhpStorm metadata will be removed?
likely in some future release
Describe the bug In PHPStorm, a
.phpstorm.meta.php
file can be provided not only in the project root but in any subfolder. Notably, this means that composer packages are able to provide their own .phpstorm.meta.php file with hints for that package.To Reproduce
Expected behavior