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.

Bug 225979 - Support for @note and @waring Doxygen tags in comments or extensibility tags
Summary: Support for @note and @waring Doxygen tags in comments or extensibility tags
Status: RESOLVED WORKSFORME
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal (vote)
Assignee: Ondrej Brejla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-11 13:03 UTC by Eccenux
Modified: 2013-02-12 08:55 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Exploded part was with path, so that part was fine. (14.81 KB, image/png)
2013-02-11 19:18 UTC, Eccenux
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eccenux 2013-02-11 13:03:57 UTC
I like JavaDoc syntax (like {@link}), so I'm looking for extensions rather then a complete replacement. So this is not the same as Bug 144544.

I got used to especially @note and @warning Doxygen tags and there seem to be no replacement for them. Currently using 7.3 for PHP/Java. For me they don't have to have a special meaning, but:
* I would like to have autocomplete for the tag in comments.
* In autocomplete for the methods/properties that have e.g. @note tag I'd like it to be rendered as I would have written: <strong>Note:</strong>.

So a map in settings for custom tags like this would work for me:
* tag name (e.g. "note" for "@note")
* tag rendering (e.g. "<br/><strong>Note:</strong>")

Some extra options like in-line/block and grouping (make a list under single header) would be great, but I see them as optional (not that important).

Example comment:
/**
 * Some brief
 * 
 * Some more info
 * 
 * @note Please take extra care to do something.
 * @warning Never do something!  
 */

Rendering:
<h1>Some brief</h1>

<p>Some more info</p>

<br/><strong>Note:</strong> Please take extra care to do something.
<br/><strong>Warning:</strong> Never do something!
Comment 1 Ondrej Brejla 2013-02-11 13:07:06 UTC
You can add your custom annotation tags in Tools->Options->PHP->Annotations.
Comment 2 Eccenux 2013-02-11 19:18:36 UTC
Created attachment 131260 [details]
Exploded part was with path, so that part was fine.

That doesn't seem to work. What is a correct template for note which can be written as:

/**
 * @note Please take extra care to do something.
 */

OR:

/**
 * @note
 * This is a longer note which is broken into two concurrent lines.
 * Because not everything can be explained in 80 characters ;-).
 */

I've tried templates:
@note ${note-text}
@note(${note-text})
@note(${some} ${text})

Rendering of
 * @note some text
 * @note (some text)

in any case is:
<p> <strong>note</strong>   some
<p> <strong>note</strong>   (some

should be:
<p> <strong>note</strong>   some text
<p> <strong>note</strong>   (some text)

Even with sample template (see below) I get invalid rendering (see attachment).
@sample(${param1}, ${param2} = ${value1})

Note really sure what I should get from the sample. My just the docs need a bit of improvement?
Comment 3 Eccenux 2013-02-11 19:21:56 UTC
^My just = Maybe just :-)
Comment 4 Ondrej Brejla 2013-02-12 08:50:00 UTC
Template:

@note ${text}

Works as expected. If you confirm that annotation in CC then @note is inserted and "text" is selected and prepared for rewriting.

/**
* @note (some text)
*/

Is renderred properly as <strong>note</strong> _spaces_ (some text).

Sample annotation is renderred wrongly because there is no defined parser for custom annotation which format is "name(params...". Basic dummy parser which we provide just parses annotations which names ends with a whitespace. I.e.

* @sample (param1, param2 = 10)

will be rendered more properly. But as I wrote, it's not an issue, it's a well known feature and expeceted behavior. We can't parse every type of user defined annotation properly. We just provide solutions for some cases, sorry.

But back to your problem, as I wrote. The right template for your custom annotation is: @note ${text}

It works for me properly :)
Comment 5 Ondrej Brejla 2013-02-12 08:51:46 UTC
Now I see, that 

* @note (some text)

in your case is not rendered properly, that just first word is rendered. But it has been fixed few months ago and works properly in the dev build.
Comment 6 Ondrej Brejla 2013-02-12 08:55:44 UTC
Unfortunatelly multiline annotation descriptions are not supported either, because of parsing issues and conflicts. You can file a new enhancement for that, but it's not easy to fix and I don't know when will be a time for that (whether it's ever feasible in current infrastructure).