When writing Servoy Developer IDE
The Script Editor in the Servoy Developer IDE supports annotating JavaScript code using JSDoc. Documenting the code is a good practise, as it makes it easier to understand the code after a while or if another programmer needs to have a look at it.
Within Servoy, there is
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.
The JSDoc syntax consists of a set of JSDoc tags. Some of these tags require a Type Expression as one of the parameters.
JSDoc:
/**
*
*
*/
Auto generated tempaltes
Control-Shift-J
Code Completion
JSDoc Tags
Tag |
Syntax & Examples |
Comments |
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@AllowToRunInFind |
@AllowToRunInFind |
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 Unknown macro: {userName}
|
|
||||||||||||
@constructor |
|
|
||||||||||||
@deprecated |
|
|
||||||||||||
@example |
|
|
||||||||||||
@param |
@param Unknown macro: {Type}
name parameterDescription | || @private | @private | Annotates a function as accessible only from within the scope in which it is declared |
|
|
||||||||||||
@returns |
@returns Unknown macro: {Type}
|
|
||||||||||||
@type |
@type Unknown macro: {Type}
|
|
||||||||||||
@version |
@version versionDescription |
|
Type Expressions
Type Expressions are used to describe the type and/or structure of data...
Expression name |
Syntax example |
Comments |
---|---|---|
Array Type |
String[] |
|
Object Type |
Object<String> Unknown macro: {name}
|
|
Object Type with optional properties |
{{ Unknown macro: {sDocID}
}} Unknown macro: {sDocID}
}} |
|
JSFoundSet type |
JSFoundset<datasource> Unknown macro: {column1}
> |
|
JSRecord type |
JSRecord<datasource> Unknown macro: {column1}
> |
|
JSDataSet type |
JSDataSet< Unknown macro: {name}
> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Adding whatever tag you like
Code completion
JSDoc Templates
Tip: Check out the JSDoc plugin for Servoy Developer on ServoyForge
Old 5.x style of annotating:
JSRecord:servername.tablename
JSFoundset :servername.tablename
Form:formname