mirror of
https://github.com/RustyRaptor/brackets.git
synced 2026-12-04 00:15:22 -07:00
more fixes to jsdocs
This commit is contained in:
1 parent
c8b53c7153
commit
bc8d9d8e2a
7 files changed
+60
-52
No files matched your search
@@ -37,7 +37,7 @@ define(function (require, exports, module) {
|
||||
* positions.
|
||||
*
|
||||
* @param {string} value - name of the new hint token
|
||||
* @param {?Array<number>} positions - optional list of positions at which
|
||||
* @param {?Array.<number>=} positions - optional list of positions at which
|
||||
* the token occurs
|
||||
* @return {Object} - a new hint token
|
||||
*/
|
||||
@@ -83,7 +83,7 @@ define(function (require, exports, module) {
|
||||
* Divide a path into directory and filename parts
|
||||
*
|
||||
* @param {string} path - a URI with directories separated by /
|
||||
* @return {Object<dir: string, file: string>} - a pair of strings that
|
||||
* @return {Object.<dir: string, file: string>} - a pair of strings that
|
||||
* correspond to the directory and filename of the given path.
|
||||
*/
|
||||
function splitPath(path) {
|
||||
@@ -109,11 +109,11 @@ define(function (require, exports, module) {
|
||||
/*
|
||||
* Annotate list of identifiers with their scope level.
|
||||
*
|
||||
* @param {Array<Object>} identifiers - list of identifier tokens to be
|
||||
* @param {Array.<Object>} identifiers - list of identifier tokens to be
|
||||
* annotated
|
||||
* @param {Scope} scope - scope object used to determine the scope level of
|
||||
* each identifier token in the previous list.
|
||||
* @return {Array<Object>} - the input array; to each object in the array a
|
||||
* @return {Array.<Object>} - the input array; to each object in the array a
|
||||
* new level {number} property has been added to indicate its scope
|
||||
* level.
|
||||
*/
|
||||
@@ -133,10 +133,10 @@ define(function (require, exports, module) {
|
||||
/*
|
||||
* Annotate a list of properties with their association level
|
||||
*
|
||||
* @param {Array<Object>} properties - list of property tokens
|
||||
* @param {Array.<Object>} properties - list of property tokens
|
||||
* @param {Association} association - an object that maps property
|
||||
* names to the number of times it occurs in a particular context
|
||||
* @return {Array<Object>} - the input array; to each object in the array a
|
||||
* @return {Array.<Object>} - the input array; to each object in the array a
|
||||
* new level {number} property has been added to indicate the number
|
||||
* of times the property has occurred in the association context.
|
||||
*/
|
||||
@@ -152,8 +152,8 @@ define(function (require, exports, module) {
|
||||
/*
|
||||
* Annotate a list of tokens as being global variables
|
||||
*
|
||||
* @param {Array<Object>} globals - list of identifier tokens
|
||||
* @return {Array<Object>} - the input array; to each object in the array a
|
||||
* @param {Array.<Object>} globals - list of identifier tokens
|
||||
* @return {Array.<Object>} - the input array; to each object in the array a
|
||||
* new global {boolean} property has been added to indicate that it is
|
||||
* a global variable.
|
||||
*/
|
||||
@@ -168,9 +168,9 @@ define(function (require, exports, module) {
|
||||
* Annotate a list of tokens as literals of a particular kind;
|
||||
* if string literals, annotate with an appropriate delimiter.
|
||||
*
|
||||
* @param {Array<Object>} literals - list of hint tokens
|
||||
* @param {Array.<Object>} literals - list of hint tokens
|
||||
* @param {string} kind - the kind of literals in the list (e.g., "string")
|
||||
* @return {Array<Object>} - the input array; to each object in the array a
|
||||
* @return {Array.<Object>} - the input array; to each object in the array a
|
||||
* new literal {boolean} property has been added to indicate that it
|
||||
* is a literal hint, and also a new kind {string} property to indicate
|
||||
* the literal kind. For string literals, a delimiter property is also
|
||||
@@ -195,8 +195,8 @@ define(function (require, exports, module) {
|
||||
/*
|
||||
* Annotate a list of tokens as keywords
|
||||
*
|
||||
* @param {Array<Object>} keyword - list of keyword tokens
|
||||
* @return {Array<Object>} - the input array; to each object in the array a
|
||||
* @param {Array.<Object>} keyword - list of keyword tokens
|
||||
* @return {Array.<Object>} - the input array; to each object in the array a
|
||||
* new keyword {boolean} property has been added to indicate that the
|
||||
* hint is a keyword.
|
||||
*/
|
||||
@@ -210,10 +210,10 @@ define(function (require, exports, module) {
|
||||
/*
|
||||
* Annotate a list of tokens with a path name
|
||||
*
|
||||
* @param {Array<Object>} tokens - list of hint tokens
|
||||
* @param {Array.<Object>} tokens - list of hint tokens
|
||||
* @param {string} dir - directory with which to annotate the hints
|
||||
* @param {string} file - file name with which to annotate the hints
|
||||
* @return {Array<Object>} - the input array; to each object in the array a
|
||||
* @return {Array.<Object>} - the input array; to each object in the array a
|
||||
* new path {string} property has been added, equal to dir + file.
|
||||
*/
|
||||
function annotateWithPath(tokens, dir, file) {
|
||||
|
||||
@@ -31,6 +31,11 @@ define(function (require, exports, module) {
|
||||
* Performs a binary search among an array of scope objects for one with a
|
||||
* range that contains pos. The array must be non-empty and sorted
|
||||
* ascending according to the objects' (disjoint) ranges.
|
||||
*
|
||||
* @param {Array.<Object>} arr - the sorted array of scope objects to
|
||||
* search
|
||||
* @param {number} pos - the position to search for in arr
|
||||
* @return {Object} - the scope object containing pos
|
||||
*/
|
||||
function binaryRangeSearch(arr, pos) {
|
||||
var low = 0,
|
||||
@@ -58,7 +63,7 @@ define(function (require, exports, module) {
|
||||
* @constructor
|
||||
* @param {AST} tree - an AST as described at
|
||||
https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API
|
||||
* @param {?Scope} parent - the (optional) parent of the new Scope
|
||||
* @param {?Scope=} parent - the (optional) parent of the new Scope
|
||||
*/
|
||||
function Scope(tree, parent) {
|
||||
|
||||
@@ -420,7 +425,7 @@ define(function (require, exports, module) {
|
||||
/*
|
||||
* Add a list of identifier declarations
|
||||
*
|
||||
* @param {Array<AST>} ids - a list of identifier AST nodes
|
||||
* @param {Array.<AST>} ids - a list of identifier AST nodes
|
||||
*/
|
||||
Scope.prototype.addAllDeclarations = function (ids) {
|
||||
var that = this;
|
||||
@@ -441,7 +446,7 @@ define(function (require, exports, module) {
|
||||
/*
|
||||
* Add an association object
|
||||
*
|
||||
* @param {AST} obj - a identifer AST node
|
||||
* @param {AST} obj - an identifier AST node
|
||||
* @param {AST} prop - a property AST node
|
||||
*/
|
||||
Scope.prototype.addAssociation = function (obj, prop) {
|
||||
@@ -568,7 +573,7 @@ define(function (require, exports, module) {
|
||||
*
|
||||
* @param {Function} add - the Scope accumulation function
|
||||
* @param {Object} init - an initial value for the accumulation function
|
||||
* @return {Object} - the result of of accumulating the current scope along
|
||||
* @return {Object} - the result of accumulating the current scope along
|
||||
* with all of its children
|
||||
*/
|
||||
Scope.prototype.walkDown = function (add, init) {
|
||||
@@ -587,7 +592,7 @@ define(function (require, exports, module) {
|
||||
* @param {Function} addItem - the item accumulation function
|
||||
* @param {Object} init - an initial value for the accumulation function
|
||||
* @param {string} listName - the name of a Scope property
|
||||
* @return {Object} - the result of of accumulating the given property for
|
||||
* @return {Object} - the result of accumulating the given property for
|
||||
* the current scope along with all of its children
|
||||
*/
|
||||
Scope.prototype.walkDownList = function (addItem, init, listName) {
|
||||
@@ -606,7 +611,7 @@ define(function (require, exports, module) {
|
||||
*
|
||||
* @param {Function} add - the identifier accumulation function
|
||||
* @param {Object} init - an initial value for the accumulation function
|
||||
* @return {Object} - the result of of accumulating identifier occurrences
|
||||
* @return {Object} - the result of accumulating identifier occurrences
|
||||
* for the current scope along with all of its children
|
||||
*/
|
||||
Scope.prototype.walkDownIdentifiers = function (add, init) {
|
||||
@@ -654,6 +659,7 @@ define(function (require, exports, module) {
|
||||
*
|
||||
* @param {Function} add - the Scope accumulation function
|
||||
* @param {Object} init - an initial value for the accumulation function
|
||||
* @param {string} prop - the property name to combine scope information for
|
||||
* @return {Object} - the result of of accumulating the current scope along
|
||||
* with its parents
|
||||
*/
|
||||
|
||||
@@ -104,7 +104,7 @@ define(function (require, exports, module) {
|
||||
* each (known) file in the directory.
|
||||
*
|
||||
* @param {string} dir - the directory name for which state is desired
|
||||
* @param {string} file - the file name for which state is desired
|
||||
* @param {string=} file - the file name for which state is desired
|
||||
* @return {Object} - a file state object (as documented within
|
||||
* intializeFileState above), or a set of file state objects if
|
||||
* file is omitted.
|
||||
@@ -174,7 +174,7 @@ define(function (require, exports, module) {
|
||||
* refreshed
|
||||
* @param {number} offset - offset into the text at which the inner scope
|
||||
* is to be refreshed
|
||||
* @param {Object + jQuery.Promise} - inner scope information, or a promise
|
||||
* @return {Object + jQuery.Promise} - inner scope information, or a promise
|
||||
* for such information, including the local scope object and lists of
|
||||
* identifiers, properties, globals, literals and associations.
|
||||
*/
|
||||
@@ -183,9 +183,9 @@ define(function (require, exports, module) {
|
||||
/*
|
||||
* Filter a list of tokens using a given scope object
|
||||
*
|
||||
* @param {Array<Object>} tokens - a list of identifier tokens
|
||||
* @param {Array.<Object>} tokens - a list of identifier tokens
|
||||
* @param {Scope} scope - a scope object
|
||||
* @return {Array<Object>} - the sublist of the input list that
|
||||
* @return {Array.<Object>} - the sublist of the input list that
|
||||
* contains all and only the identifier tokens in scope
|
||||
* w.r.t. to the given scope
|
||||
*/
|
||||
@@ -230,7 +230,7 @@ define(function (require, exports, module) {
|
||||
*
|
||||
* @param {string} dir - the directory name of the files for which
|
||||
* property lists should be merged
|
||||
* @param {Array<Object>} - the combined list of property tokens
|
||||
* @param {Array.<Object>} - the combined list of property tokens
|
||||
*/
|
||||
function mergeProperties(dir) {
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ define(function (require, exports, module) {
|
||||
/**
|
||||
* Get the current cursor position.
|
||||
*
|
||||
* @return Object<line: number, ch, number> - the current cursor position
|
||||
* @return {{line: number, ch: number}} - the current cursor position
|
||||
*/
|
||||
Session.prototype.getCursor = function () {
|
||||
return this.editor.getCursorPos();
|
||||
@@ -93,9 +93,9 @@ define(function (require, exports, module) {
|
||||
* Get the token at the given cursor position, or at the current cursor
|
||||
* if none is given.
|
||||
*
|
||||
* @param {?Object<line: number, ch, number>} cursor - the cursor position
|
||||
* @param {?{line: number, ch: number}} cursor - the cursor position
|
||||
* at which to retrieve a token
|
||||
* @param {Object} - the CodeMirror token at the given cursor position
|
||||
* @return {Object} - the CodeMirror token at the given cursor position
|
||||
*/
|
||||
Session.prototype.getToken = function (cursor) {
|
||||
var cm = this.editor._codeMirror;
|
||||
@@ -110,7 +110,7 @@ define(function (require, exports, module) {
|
||||
/**
|
||||
* Get the next cursor position on the line, or null if there isn't one.
|
||||
*
|
||||
* @return {?Object<line: number, ch, number>} - the cursor position
|
||||
* @return {?{line: number, ch: number}} - the cursor position
|
||||
* immediately following the current cursor position, or null if
|
||||
* none exists.
|
||||
*/
|
||||
@@ -132,7 +132,7 @@ define(function (require, exports, module) {
|
||||
/**
|
||||
* Get the token before the one at the given cursor position
|
||||
*
|
||||
* @param {Object<line: number, ch, number>} cursor - cursor position after
|
||||
* @param {{line: number, ch: number}} cursor - cursor position after
|
||||
* which a token should be retrieved
|
||||
* @return {Object} - the CodeMirror token before the one at the given
|
||||
* cursor position
|
||||
@@ -184,10 +184,11 @@ define(function (require, exports, module) {
|
||||
* Find the context of a property lookup. For example, for a lookup
|
||||
* foo(bar, baz(quux)).prop, foo is the context.
|
||||
*
|
||||
* @param {Object<line: number, ch, number>} cursor - the cursor position
|
||||
* @param {{line: number, ch: number}} cursor - the cursor position
|
||||
* at which context information is to be retrieved
|
||||
* @param {number} depth - the current depth of the parenthesis stack, or
|
||||
* undefined if the depth is 0.
|
||||
* @return {string} - the context for the property that was looked up
|
||||
*/
|
||||
Session.prototype.getContext = function (cursor, depth) {
|
||||
var token = this.getToken(cursor);
|
||||
@@ -216,7 +217,7 @@ define(function (require, exports, module) {
|
||||
* Get the type of the current session, i.e., whether it is a property
|
||||
* lookup and, if so, what the context of the lookup is.
|
||||
*
|
||||
* @return {Object<property: boolean, context: string>} - a pair consisting
|
||||
* @return {Object.<property: boolean, context: string>} - a pair consisting
|
||||
* of a {boolean} "property" that indicates whether or not the type of
|
||||
* the session is a property lookup, and a {string} "context" that
|
||||
* indicates the object context (as described in getContext above) of
|
||||
@@ -256,7 +257,7 @@ define(function (require, exports, module) {
|
||||
* Get a list of hints for the current session using the current scope
|
||||
* information.
|
||||
*
|
||||
* @return {Array<Object>} - the sorted list of hints for the current
|
||||
* @return {Array.<Object>} - the sorted list of hints for the current
|
||||
* session.
|
||||
*/
|
||||
Session.prototype.getHints = function () {
|
||||
@@ -392,7 +393,7 @@ define(function (require, exports, module) {
|
||||
* Comparator for sorting tokens by name
|
||||
*
|
||||
* @param {Object} a - a token
|
||||
* @param {Object} a - another token
|
||||
* @param {Object} b - another token
|
||||
* @return {number} - comparator value that indicates whether the name
|
||||
* of token a is lexicographically lower than the name of token b
|
||||
*/
|
||||
@@ -512,8 +513,8 @@ define(function (require, exports, module) {
|
||||
* Clone a list of hints. (Used so that later annotations are not
|
||||
* preserved when scope information changes.)
|
||||
*
|
||||
* @param {Array<Object>} hints - an array of hint tokens
|
||||
* @return {Array<Object>} - a new array of objects that are clones of
|
||||
* @param {Array.<Object>} hints - an array of hint tokens
|
||||
* @return {Array.<Object>} - a new array of objects that are clones of
|
||||
* the objects in the input array
|
||||
*/
|
||||
function copyHints(hints) {
|
||||
|
||||
@@ -49,7 +49,7 @@ define(function (require, exports, module) {
|
||||
* string, formats the hints for display, and returns a hint response
|
||||
* object according to the CodeHintManager's API for code hint providers.
|
||||
*
|
||||
* @param {Array<Object>} hints - hints to be included in the response
|
||||
* @param {Array.<Object>} hints - hints to be included in the response
|
||||
* @param {string} query - querystring with which to filter the hint list
|
||||
* @return {Object} - hint response as defined by the CodeHintManager API
|
||||
*/
|
||||
@@ -62,9 +62,9 @@ define(function (require, exports, module) {
|
||||
/*
|
||||
* Filter a list of tokens using the query string in the closure.
|
||||
*
|
||||
* @param {Array<Object>} tokens - list of hints to filter
|
||||
* @param {Array.<Object>} tokens - list of hints to filter
|
||||
* @param {number} limit - maximum numberof tokens to return
|
||||
* @return {Array<Object>} - filtered list of hints
|
||||
* @return {Array.<Object>} - filtered list of hints
|
||||
*/
|
||||
function filterWithQuery(tokens, limit) {
|
||||
|
||||
@@ -76,6 +76,7 @@ define(function (require, exports, module) {
|
||||
* @param {Function} test - test to determine if an element should
|
||||
* be included in the results
|
||||
* @param {number} limit - the maximum number of elements to return
|
||||
* @return {Array.<Object>} - new array of filtered elements
|
||||
*/
|
||||
function filterArrayPrefix(arr, test, limit) {
|
||||
var i = 0,
|
||||
@@ -123,10 +124,10 @@ define(function (require, exports, module) {
|
||||
* Returns a formatted list of hints with the query substring
|
||||
* highlighted.
|
||||
*
|
||||
* @param {Array<Object>} hints - the list of hints to format
|
||||
* @param {Array.<Object>} hints - the list of hints to format
|
||||
* @param {string} query - querystring used for highlighting matched
|
||||
* poritions of each hint
|
||||
* @param {Array<jQuery.Object>} - array of hints formatted as jQuery
|
||||
* @param {Array.<jQuery.Object>} - array of hints formatted as jQuery
|
||||
* objects
|
||||
*/
|
||||
function formatHints(hints, query) {
|
||||
@@ -220,7 +221,7 @@ define(function (require, exports, module) {
|
||||
*
|
||||
* @param {Editor} editor - the current editor context
|
||||
* @param {string} key - charCode of the last pressed key
|
||||
* @param {boolean} - can the provider provide hints for this session?
|
||||
* @return {boolean} - can the provider provide hints for this session?
|
||||
*/
|
||||
JSHints.prototype.hasHints = function (editor, key) {
|
||||
if ((key === null) || HintUtils.maybeIdentifier(key)) {
|
||||
|
||||
@@ -45,7 +45,7 @@ function require(url) {
|
||||
* function expects require, exports and module arguments; in the latter
|
||||
* case, the wrapper function expects only an exports arguments.
|
||||
*
|
||||
* @param {?Array<string>} bindings - an optional list of resources
|
||||
* @param {?Array.<string>} bindings - an optional list of resources
|
||||
* required by the module
|
||||
* @param {Function} wrapper - the function that defines the module
|
||||
*/
|
||||
@@ -93,7 +93,7 @@ function require(url) {
|
||||
*
|
||||
* @param {Function} walk - the function used to walk over an implicit scope
|
||||
* @param {string} keyProp - the property of the implicit scope to walk over
|
||||
* @param {Array<Object>} - a list of hint tokens for the implicit scope,
|
||||
* @return {Array.<Object>} - a list of hint tokens for the implicit scope,
|
||||
* including the positions at which they occur.
|
||||
*/
|
||||
function siftPositions(walk, keyProp) {
|
||||
@@ -127,7 +127,7 @@ function require(url) {
|
||||
* Walk the scope to compute all available association objects
|
||||
*
|
||||
* @param {Function} walk - the function used to walk over an implicit scope
|
||||
* @param {Object} - a set of association objects: each property is a
|
||||
* @return {Object} - a set of association objects: each property is a
|
||||
* property name; each value is an association, which indicates the
|
||||
* number of times the property occurs w.r.t. to a particular lookup
|
||||
* context.
|
||||
@@ -154,8 +154,8 @@ function require(url) {
|
||||
/**
|
||||
* Parse JSLint globals annotations from an array of JavaScript comments
|
||||
*
|
||||
* @param {Array<string>} comments - list of JavaScript comments
|
||||
* @return {Array<Object>} - a list of global hint objects as described by
|
||||
* @param {Array.<string>} comments - list of JavaScript comments
|
||||
* @return {Array.<Object>} - a list of global hint objects as described by
|
||||
* JSLint annotations found in the comments.
|
||||
*/
|
||||
function extractGlobals(comments) {
|
||||
|
||||
@@ -104,7 +104,7 @@ define(function (require, exports, module) {
|
||||
/*
|
||||
* Return the index at which hint occurs in hintList
|
||||
*
|
||||
* @param {Array<Object>} hintList - the list of hints
|
||||
* @param {Array.<Object>} hintList - the list of hints
|
||||
* @param {string} hint - the hint to search for
|
||||
* @return {number} - the index into hintList at which the hint occurs,
|
||||
* or -1 if it does not
|
||||
@@ -158,7 +158,7 @@ define(function (require, exports, module) {
|
||||
*
|
||||
* @param {Object + jQuery.Deferred} hintObj - a hint response object,
|
||||
* possibly deferred
|
||||
* @param {Array<string>} absentHints - a list of hints that should not
|
||||
* @param {Array.<string>} absentHints - a list of hints that should not
|
||||
* be present in the hint response
|
||||
*/
|
||||
function hintsAbsent(hintObj, absentHints) {
|
||||
@@ -176,7 +176,7 @@ define(function (require, exports, module) {
|
||||
*
|
||||
* @param {Object + jQuery.Deferred} hintObj - a hint response object,
|
||||
* possibly deferred
|
||||
* @param {Array<string>} absentHints - a list of hints that should be
|
||||
* @param {Array.<string>} expectedHints - a list of hints that should be
|
||||
* present in the hint response
|
||||
*/
|
||||
function hintsPresent(hintObj, expectedHints) {
|
||||
@@ -194,7 +194,7 @@ define(function (require, exports, module) {
|
||||
*
|
||||
* @param {Object + jQuery.Deferred} hintObj - a hint response object,
|
||||
* possibly deferred
|
||||
* @param {Array<string>} absentHints - a list of hints that should be
|
||||
* @param {Array.<string>} expectedHints - a list of hints that should be
|
||||
* present in the given order in the hint response
|
||||
*/
|
||||
function hintsPresentOrdered(hintObj, expectedHints) {
|
||||
@@ -217,7 +217,7 @@ define(function (require, exports, module) {
|
||||
*
|
||||
* @param {Object + jQuery.Deferred} hintObj - a hint response object,
|
||||
* possibly deferred
|
||||
* @param {Array<string>} absentHints - a list of hints that should be
|
||||
* @param {Array.<string>} absentHints - a list of hints that should be
|
||||
* present in the hint response, and no more.
|
||||
*/
|
||||
function hintsPresentExact(hintObj, expectedHints) {
|
||||
|
||||
Reference in new issue
Block a user