Skip to main content

JSUtils

Import :

const JSUtils = brackets.getModule("language/JSUtils")

_

Set of utilities for simple parsing of JS text.

Kind: global variable

findMatchingFunctions(functionName, fileInfos, [keepAllFiles]) ⇒ $.Promise

Return all functions that have the specified name, searching across all the given files.

Kind: global function
Returns: $.Promise - that will be resolved with an Array of objects containing the source document, start line, and end line (0-based, inclusive range) for each matching function list. Does not addRef() the documents returned in the array.

ParamTypeDescription
functionNameStringThe name to match.
fileInfosArray.<File>The array of files to search.
[keepAllFiles]booleanIf true, don't ignore non-javascript files.

findAllMatchingFunctionsInText(text, searchName) ⇒ Object

Finds all instances of the specified searchName in "text". Returns an Array of Objects with start and end properties.

Kind: global function
Returns: Object - Array of objects containing the start offset for each matched function name.

ParamTypeDescription
textStringJS text to search
searchNameStringfunction name to search for