I recently discovered that Netbeans really likes javascript comments which are formatted like this:
/** * This is a sample comment * * @param {Number} myParam info about this parameter * @return {String} Returns some sample string. */ function sample(info) { .. }
This appears to be Javadoc compatible comments, but is it? Is there a resource somewhere which defines what formatting as acceptible? Also, is this style of commenting common to other IDE's such as Eclipse?
Edit: I have uploaded this screenshot to illustrate how Netbeans interprets @param and @return
Thanks.
If we want to comment out a block of code in NetBeans IDE, we can simply use [ctrl]+[shift]+[c] .
The NetBeans JavaScript editor provides syntax highlighting, autocompletion, and code folding, pretty much as you'd expect. The JavaScript editing features also work for JavaScript code embedded in PHP, JSP, and HTML files.
Comment tags are similar to JSDoc3, but not all JSDoc3 tags are supported. Some tags are missing in JSdocs 3 (they have no references in the list below).
You can see which are available this way:
It will show you the list of supported tags and help with its syntax (parameters autocompletion). More tags are expected to be supported in future Netbeans releases as multiple bug reports are issued by users.
Here is the list of supported tags as for Netbeans 7.4:
// Define argument type, name and description.
// This object adds onto a parent object.
// Identify the author of an item.
// This object uses something from another object.
// Use the following text to describe the entire class.
// Document an object as a constant.
// This function is intended to be called with the "new" keyword.
// This function member will be the constructor for the previous class.
// Document the default value.
// Document that this is no longer the preferred way.
// Describe a symbol.
// Type object is inherited from.
// A field.
// Describe a file.
// A function.
// [todo] Remove this from the final output.
// Document an inner object.
// Document properties on an object literal as if they belonged to a symbol with a given name.
// Inline tag - create a link.
// This symbol belongs to a parent symbol.
// Document the name of an object.
// Document a namespace object.
// Document the parameter to a function.
// This symbol is meant to be private.
// Document a property of an object.
// This symbol is meant to be public.
// This file requires a JavaScript module.
// Return.
// Document the return value of a function.
// Refer to some other documentation for more information.
// When was this feature added?
// Document a static member.
// Explain a syntax.
// Describe what errors could be thrown.
// Document the type of an object.
// Documents the version number of an item.
This style of comments is for JSDoc.
It is similar to JavaDoc but has some differences.
You can find out more at https://github.com/jsdoc/jsdoc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With