...
The JSDoc syntax supported by the Servoy Developer IDE is derived from the JSDoc Toolkit and Google Closure Compiler's support for JavaScript annotation, plus some custom Servoy extensions.
See #JSDoc JSDoc Tags and #Type Type Expressions below for the supported tags and their syntax.
...
Tag | Syntax & Examples | Context | Impact | Description | |||||
---|---|---|---|---|---|---|---|---|---|
@AllowToRunInFind | @AllowToRunInFind | function | Determines if the function will be executes in FindMode when used as an event handler | Custom Servoy JSDoc tag to annotate a function that it can be run if the Form on which the function is ran is in FindMode | |||||
@author | @author userName | function, variable | none | Indicates the author of the code | |||||
@constructor | @constructor | function | This will show a different icon on the Script Outline view. besides that no further impact |
| |||||
@deprecated | @deprecated | function, variable | Accessing a deprecated variable or calling a deprecated function will produce a builder marker in Servoy Developer | Indicates that the function or variable is obsolete or has been replaced and should be used anymore. | |||||
@example | @example | function | none | Tag allowing to provide some sample code how to use the function or variable. Multiline content is possible my including "<br> | |||||
@param | @param {Type} name parameterDescription | function | Builder markers will be generated in Servoy Developer if the function is called with values for the parameters that do no | Describe function parameters. | |||||
@private | @private | function, variable | Accessing a private variable/function from outside the scope in which it is declared will generate a builder marker in Servoy Developer | Annotates a variable or function as accessible only from within the file in which it is declared | |||||
@protected | @protected | function, variable | Accessing a protected variable/function from outside the scope in which it is declared or a child scope will generate a builder marker in Servoy Developer | Annotates a variable or function as accessible from within the same file in which it is declared and all files that extend this file | |||||
@return | @return {Type} | function | The specified type is used by the build process to determine the correctness of the code that uses the returned value | Annotates the type of the returned value. | |||||
@returns | @returns {Type} | function | see @return | alias for @return | |||||
@see | @see seeDescription | function, variable | none | Tag to provide pointers to other parts of the code that are related | |||||
@since | @since versionDescription | function, variable | none | Tag to provide information about in which version of the code the variable or function was introduced | <ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="1ba6c304-871f-4667-929e-de41b2f9c846"><ac:plain-text-body><![CDATA[ | @SuppressWarnings | @SuppressWarnings ([deprecated], [hides], [wrongparameters], [undeclared]) | function | |
@SuppressWarnings | @SuppressWarnings ([deprecated], [hides], [wrongparameters], [undeclared]) | function | Stop the generation of builder markers in Servoy Developer for the specified warnings | Custom Servoy JSDoc tag to suppress builder markers of a certain type within a function. | ]]></ac:plain-text-body></ac:structured-macro> | ||||
@throws | @throws {Type} | function | none | Tag to describe the type of Exceptions that can be raised when the function is called. | |||||
@type | @type {Type} | variable, inline variable, (function*) | The specified type is used by the build process to determine the correctness of the code that uses the variable | Tag to specify the type of the value that a variable can hold. | |||||
@version | @version versionDescription | function, variable | none | Tag to provide information about the version of the code |
...
Use case | Tag | Example |
---|---|---|
function parameters | @param | /** |
function return type | @return | /** |
functions exceptions | @throws | /** |
variables | @type | /** |
|
|
|
A Type Expression is to always be surrounded by curly braces: {typeExpression}. Note that when using the Object Type expression variation that start and stops with curly braces as well, this results in double opening and closing braces.
Expression name | Syntax example | Context | Comments | |
---|---|---|---|---|
Named type | {String} | @param, @return, @type, @throws | The complete list of available types can be seen by triggering Code Completion inside the curly braces in the Script Editor | |
AnyType | * | @param, @return, @type, @throws |
| |
OR Type | {String|Number} | @param, @return, @type, @throws |
| |
REST Type | {...String} | @param |
| |
Array Type unmigrated-wiki-markup | \{String\[\]} | @param, @return, @type, @throws |
| |
Object Type | {Object<String>Object} | @param, @return, @type, @throws |
| |
Object Type with optional properties |
| @param, @return, @type, @throws |
| |
JSFoundset type | {JSFoundset<db:/udm/contacts>JSFoundset}1 | @param, @return, @type |
| |
JSRecord type | {JSRecord<db:/udm/contacts>JSRecord}1 | @param, @return, @type |
| |
JSDataSet type | {JSDataSet<{name:String, age:Number}>} | @param, @return, @type |
| |
RuntimeForm Type | {RuntimeForm<superFormName>RuntimeForm} | @param, @return, @type |
|
...