This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Created attachment 111263 [details] No support for inheritdoc in current version Pleasae add support for {@inheritdoc}. In current version (Netbeans 7.0.1) is not supported. More about {@inheritdoc}: http://manual.phpdoc.org/HTMLSmartyConverter/HandS/phpDocumentor/tutorial_tags.inlineinheritdoc.pkg.html
Created attachment 111264 [details] Sample project for testing inheritdoc support
Not supported in Netbeans 8.0 ...
How to implement this feature myself?
(In reply to khaperets from comment #3) > How to implement this feature myself? The best you can do is to provide a patch. Here [1] you can find information about NetBeans sources and how to work with them; the module you are interested in is in the "php.editor" directory. Thanks. [1] http://wiki.netbeans.org/WorkingWithNetBeansSources
One really bad thing is that Netbeans does not find the class in autocompletion options list when the class contains the {@inheritdoc} annotation. Since it does not see the class in that case it does not even provide the autocompletion mechanism for anything (variables, methods) regarding that class. An example would be ArrayCollection class in Doctrine2 framework. Using Netbeans 8.0 on Mac OS 10.10 (did not work on 10.9 either).
Please, implement it in next version, thanks.
Actually, this become a defect because all auto completions are breack for method or class using @inheritdoc
Definitely not this issue. Defect was reported and was confirmed as fixed for 8.0.1 patch.
Could you please details where is the patch , beacause even on the dev version i have the problem
OK, after install the last version this works with 8.0.1 and auto completion isn't break now. Many thanks for this enhancement :) The last part is that the comments aren't the parent comments and just show the docblock as it. An example with the Doctrine\Common\Collections\ArrayCollection::toArray method : vendor/doctrine/collections/lib/Doctrine/Common/Collections/ArrayCollection.php toArray {@inheritDoc}.
(In reply to ndm from comment #10) > OK, after install the last version this works with 8.0.1 and auto completion > isn't break now. Doesn't look like it is fixed in the current release version. From the About dialog: Product Version: NetBeans IDE 8.0.1 (Build 201408251540) Updates: NetBeans IDE is updated to version NetBeans 8.0.1 Patch 1.1
Why it has version 8.0.1 if it is not fixed even in 8.1.0?
(In reply to ua.oleg from comment #12) > Why it has version 8.0.1 if it is not fixed even in 8.1.0? Because it has been reported for the given version of NetBeans. The Target Milestone field contains information in which version of NetBeans issue is fixed (enhancement is implemented).
So it means that it would be implemented somewhere in the future, right?
(In reply to ua.oleg from comment #14) > So it means that it would be implemented somewhere in the future, right? Well, we hope so. But to be fair, we have _many_ tasks to do and the number of NetBeans developers is limited, unfortunately :) The best what can be done is when someone from our users (maybe you? ;) is skilled enough and creates a patch for any issue/enhancement which can be then applied/used by us. But that is not so easy, I am afraid (one needs to know Java and NetBeans is not a simple project, of course). Thanks for understanding.
Created attachment 158324 [details] prototype image I'm trying it. I'm going to apply the inline {@inheritdoc} to PhpDoc descriptions for class, method, @param tag. If I'm wrong, just let me know. I cannot attach a patch yet, sorry. e.g. /** * Header of ChildClass. * * {@inheritdoc} ChildClass Description. */ class ChildClass extends BaseClass { } /** * This is the foo method of ChildClass. * * {@inheritdoc} ChildClass foo method description. * @param string $a ChildClass a param Description. {@inheritdoc} * @param string $b ChildClass b param Description * @return string Description. */ public function foo($a, $b) { } Thanks.
(In reply to junichi11 from comment #16) > Created attachment 158324 [details] > prototype image Seems fine to me. Thanks a lot for working on it, Junichi!
Created attachment 158383 [details] prototype patch Tomas, could you please review it when you can make time? Changes: 1. Separate the process to get ASTNode 2. Parser is used multiple times to get parent comments. (I don't have another idea...) 3. If @param or @return are missing in the method comment, detect parent tags. 4. @property's description(also similar tags) is not shown in the document window, so I also fix it. Thanks!
Created attachment 158406 [details] prototype patch v2 > 2. Parser is used multiple times to get parent comments. (I don't have another idea...) I changed this part. I got comments using a lexer. Thanks.
@junichi11: Junichi, it seems to me that INLINE_INHERITDOC_PATTERN does not need to be a regular expression at all - am I right? If I am, simpler (and faster) String.contains() etc. methods could be used. Thanks.
@junichi11: Junichi, just want to verify - index is called only if {@inheritdoc} tag is present, right? Thanks.
(In reply to Tomas Mysik from comment #20) > @junichi11: Junichi, it seems to me that INLINE_INHERITDOC_PATTERN does not > need to be a regular expression at all - am I right? If I am, simpler (and > faster) String.contains() etc. methods could be used. I think you are right. Should I try fixing there at first? (In reply to Tomas Mysik from comment #21) > @junichi11: Junichi, just want to verify - index is called only if > {@inheritdoc} tag is present, right? It is always called in my current code if the element is a class, interface or method. But the tag should be checked before it is called. So I'll fix it. Thanks!
Perfect, will wait for new version of your patch. Thanks!
Created attachment 158463 [details] prototype patch v3 Only DocRenderer.java, Test is the same as v2. (If I should attach all files, I'll recreate a patch.) Changes - replaceInlineInheritdoc() : modified - hasInlineInheritdoc() : modified - getInheritedElements() : modified - needInheritedElements() : added instead of a regex : I tried it, but if you know a better way, could you fix there? Thanks!
(In reply to junichi11 from comment #24) > Only DocRenderer.java, Test is the same as v2. (If I should attach all > files, I'll recreate a patch.) Yes, please. Always attach a complete patch (and deprecate the previous ones) so it is (later) clear what is going to be done here. > instead of a regex : I tried it, but if you know a better way, could you fix > there? I can be wrong, of course! :) Will have a look at it once you attach a complete patch. Thanks!
Created attachment 158464 [details] prototype patch v3 > Yes, please. Always attach a complete patch (and deprecate the previous ones) so it is (later) clear what is going to be done here. Oh, I see, sorry. Thanks.
Will have a look at it tomorrow. Regarding regex - String.replace() etc. internally uses regular expressions as well so I was wrong here, sorry. However, checking whether the tag is present in the given PHPDoc is useful since calling index is expensive. Thanks and sorry for confusion!
(In reply to Tomas Mysik from comment #27) > Will have a look at it tomorrow. > > Regarding regex - String.replace() etc. internally uses regular expressions > as well so I was wrong here, sorry. However, checking whether the tag is > present in the given PHPDoc is useful since calling index is expensive. No problem :) Thank you always for reviewing!
Created attachment 158469 [details] prototype patch v4 Fixed the following cases: 1. the tag has spaces /** * The summary. * {@inheritdoc } * / 2. only the tag /** * {@inheritdoc} * / Thanks.
Patch applied, thanks a lot for it, Junichi! http://hg.netbeans.org/web-main/rev/4674e01e5113
Thanks a lot for reviewing it!
Integrated into 'main-silver', will be available in build *201602130002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/4674e01e5113 User: Tomas Mysik <tmysik@netbeans.org> Log: #202763 - Add support for {@inheritdoc} Patch contributed by junichi11@netbeans.org.
@junichi11 Thanks for taking the time to create this patch. I, and many others, have been waiting years for it.
(In reply to twifty from comment #33) > @junichi11 Thanks for taking the time to create this patch. I, and many > others, have been waiting years for it. You are welcome :) It would be great if it is tested by php users in a development build version[1] (201602160002 or later). Thanks. [1] http://bits.netbeans.org/download/trunk/nightly/latest/
Just tested with latest nightly - unfortunately it doesn't work for class members (yet) :( class BaseClass { /** * Really complicated configuration stuff explanation */ protected $configArray = [ 'key1' => 'value1', ...] } class ChildClass extends BaseClass { /** * {@inheritdoc} */ protected $configArray = [ 'key1' => 'childvalue', ...] } Can confirm however that it works as expected in a similar fashion for class and method PHPDOC. Thanks heaps for working on this guys, really yearning for this feature for quite a while now.
@Philzen Thanks for reporting it. Please submit it as a new issue.