-
Notifications
You must be signed in to change notification settings - Fork 75
Custom reference syntax to class or class member in comments make impossible to navigate in IDE #197
Comments
Hi @insperedia, First of, a big thank you for this plugin which really makes our lives easier :) I think @cebe may be your contact of choice for this issue, as he's maintaining yii2-apidoc & deals with the guide generation which relies on those links. |
The reason why we did use our own markdown syntax for refering to classes and methods was that there is no clear defininiton in PHPdoc on how to handle these links:
I have not checked current situation, but "PSR-5: PHPDoc Standard" is in Draft since 2013, in its current state it does not provide much help for links like this. In the original draft So unless we get a specification for how to parse |
Aha cool, did not know about PSR-19 :) |
So we should propose to extend definition of https://github.com/php-fig/fig-standards/blob/master/proposed/phpdoc-tags.md#56-link |
Actually, @link was just an example, not an actual proposition, and it was just accident it was the same as an existent tag. Fact is that plugin can read ANY @Whatsever and following text after space (this should be checked). Moreover, I see that @see probably fits the requirement, and it already works in IDE. |
Yes. In PhpStorm the following works well:
|
I think it's fine to switch to that syntax. |
Please don't forget to update |
@thoulah that's for Yii 3. |
There is no yii-apidoc ? |
Not yet. |
As I can see this syntax ( /**
* Generates a link tag that refers to an external CSS file.
* @param array|string $url the URL of the external CSS file. This parameter will be processed by {@see Url::to()}.
|
Likely it need FQN. |
No, it doesn't work either. |
Actually, only the first occurrence of the
The same is with * @return int {@see BaseIpHelper::IPV4} or {@see BaseIpHelper::IPV6} |
Closing. Mostly done. |
Hi,
I am one of Yii plugin developer for PHPStorm. And want to discuss one fundamental problem in Yii2.
The custom syntax for reference to class or class member in comments makes it impossible to implement navigation in IDE(PHPStorm). For example [[SomeClassName]]. The problem is that plugin can manipulate only DOM that is built by IDE parser. Because PHP plugin is not open source it is impossible to modify PHP parser to make this custom syntax work.
BUT as I remember IDE parses any string with @ in the beginning. So format can be like this, @link|ClassName::classMember, or something similar.
If there are resources to fix this I can help to find right format to make it possible to implement working links in PHPStorm plugin.
The text was updated successfully, but these errors were encountered: