如何在 PhpDoc 块中创建文件链接或在 PhpStorm 中创建注释?

问题描述 投票:0回答:2

是否有功能或插件可以创建指向本地项目文件的链接,如下所示:

/**
 * @see ./views/templates/file.twig
 */
public function render()
{
  ..
}

这对于在文件之间跳转非常有用。

我找到了这个插件,但在 PhpStorm > 2016 中似乎不再维护或不支持:

https://plugins.jetbrains.com/plugin/7235?pr=phpStorm

phpstorm phpdoc
2个回答
0
投票

我在文件中使用假函数

if (!function_exists('fakefunction___link')) { 
    function fakefunction___link() {
        return null;
    }
}

然后在另一个 PHP 文件中我有

/** @see fakefunction___link */

0
投票

PhpStorm 2023.2

/**
 * @see /README.md  # It works
 * @see /.gitignore # It doesn't work (hidden files)
 */
class SomeClass
{
    // ...
}
© www.soinside.com 2019 - 2024. All rights reserved.