id
int32
0
58k
repo
stringlengths
5
67
path
stringlengths
4
116
func_name
stringlengths
0
58
original_string
stringlengths
52
373k
language
stringclasses
1 value
code
stringlengths
52
373k
code_tokens
list
docstring
stringlengths
4
11.8k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
86
226
2,100
adobe/brackets
src/extensions/default/AutoUpdate/node/AutoUpdateDomain.js
performCleanup
function performCleanup(requester, filesToCache, notifyBack) { var currentRequester = requester || ""; function filterFilesAndNotify(files, filesToCacheArr, notifyBackToBrackets) { files.forEach(function (file) { var fileExt = path.extname(path.basename(file)); ...
javascript
function performCleanup(requester, filesToCache, notifyBack) { var currentRequester = requester || ""; function filterFilesAndNotify(files, filesToCacheArr, notifyBackToBrackets) { files.forEach(function (file) { var fileExt = path.extname(path.basename(file)); ...
[ "function", "performCleanup", "(", "requester", ",", "filesToCache", ",", "notifyBack", ")", "{", "var", "currentRequester", "=", "requester", "||", "\"\"", ";", "function", "filterFilesAndNotify", "(", "files", ",", "filesToCacheArr", ",", "notifyBackToBrackets", "...
Performs clean up for the contents in Update Directory in AppData @param {Array} filesToCache - array of file types to cache @param {boolean} notifyBack - true if Brackets needs to be notified post cleanup, false otherwise
[ "Performs", "clean", "up", "for", "the", "contents", "in", "Update", "Directory", "in", "AppData" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/node/AutoUpdateDomain.js#L332-L382
2,101
adobe/brackets
src/extensions/default/AutoUpdate/node/AutoUpdateDomain.js
initializeState
function initializeState(requester, updateParams) { var currentRequester = requester || ""; _updateParams = updateParams; installerPath = path.resolve(updateDir, updateParams.installerName); postMessageToBrackets(MessageIds.NOTIFY_INITIALIZATION_COMPLETE, currentRequester); }
javascript
function initializeState(requester, updateParams) { var currentRequester = requester || ""; _updateParams = updateParams; installerPath = path.resolve(updateDir, updateParams.installerName); postMessageToBrackets(MessageIds.NOTIFY_INITIALIZATION_COMPLETE, currentRequester); }
[ "function", "initializeState", "(", "requester", ",", "updateParams", ")", "{", "var", "currentRequester", "=", "requester", "||", "\"\"", ";", "_updateParams", "=", "updateParams", ";", "installerPath", "=", "path", ".", "resolve", "(", "updateDir", ",", "updat...
Initializes the node with update parameters @param {object} updateParams - json containing update parameters
[ "Initializes", "the", "node", "with", "update", "parameters" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/node/AutoUpdateDomain.js#L388-L393
2,102
adobe/brackets
src/extensions/default/AutoUpdate/node/AutoUpdateDomain.js
registerNodeFunctions
function registerNodeFunctions() { functionMap["node.downloadInstaller"] = downloadInstaller; functionMap["node.performCleanup"] = performCleanup; functionMap["node.validateInstaller"] = validateChecksum; functionMap["node.initializeState"] = initializeState; functionMap["node.ch...
javascript
function registerNodeFunctions() { functionMap["node.downloadInstaller"] = downloadInstaller; functionMap["node.performCleanup"] = performCleanup; functionMap["node.validateInstaller"] = validateChecksum; functionMap["node.initializeState"] = initializeState; functionMap["node.ch...
[ "function", "registerNodeFunctions", "(", ")", "{", "functionMap", "[", "\"node.downloadInstaller\"", "]", "=", "downloadInstaller", ";", "functionMap", "[", "\"node.performCleanup\"", "]", "=", "performCleanup", ";", "functionMap", "[", "\"node.validateInstaller\"", "]",...
Generates a map for node side functions
[ "Generates", "a", "map", "for", "node", "side", "functions" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/node/AutoUpdateDomain.js#L405-L412
2,103
adobe/brackets
src/extensions/default/AutoUpdate/node/AutoUpdateDomain.js
initNode
function initNode(initObj) { var resetUpdateProgres = false; if (!isNodeDomainInitialized) { MessageIds = initObj.messageIds; updateDir = path.resolve(initObj.updateDir); logFilePath = path.resolve(updateDir, logFile); installStatusFilePath = path.resolve(...
javascript
function initNode(initObj) { var resetUpdateProgres = false; if (!isNodeDomainInitialized) { MessageIds = initObj.messageIds; updateDir = path.resolve(initObj.updateDir); logFilePath = path.resolve(updateDir, logFile); installStatusFilePath = path.resolve(...
[ "function", "initNode", "(", "initObj", ")", "{", "var", "resetUpdateProgres", "=", "false", ";", "if", "(", "!", "isNodeDomainInitialized", ")", "{", "MessageIds", "=", "initObj", ".", "messageIds", ";", "updateDir", "=", "path", ".", "resolve", "(", "initO...
Initializes node for the auto update, registers messages and node side funtions @param {object} initObj - json containing init information { messageIds : Messages for brackets and node communication updateDir : update directory in Appdata requester : ID of the current requester domain}
[ "Initializes", "node", "for", "the", "auto", "update", "registers", "messages", "and", "node", "side", "funtions" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/node/AutoUpdateDomain.js#L421-L435
2,104
adobe/brackets
src/extensions/default/AutoUpdate/node/AutoUpdateDomain.js
receiveMessageFromBrackets
function receiveMessageFromBrackets(msgObj) { var argList = msgObj.args; argList.unshift(msgObj.requester || ""); functionMap[msgObj.fn].apply(null, argList); }
javascript
function receiveMessageFromBrackets(msgObj) { var argList = msgObj.args; argList.unshift(msgObj.requester || ""); functionMap[msgObj.fn].apply(null, argList); }
[ "function", "receiveMessageFromBrackets", "(", "msgObj", ")", "{", "var", "argList", "=", "msgObj", ".", "args", ";", "argList", ".", "unshift", "(", "msgObj", ".", "requester", "||", "\"\"", ")", ";", "functionMap", "[", "msgObj", ".", "fn", "]", ".", "...
Receives messages from brackets @param {object} msgObj - json containing - { fn - function to execute on node side args - arguments to the above function }
[ "Receives", "messages", "from", "brackets" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/node/AutoUpdateDomain.js#L444-L448
2,105
adobe/brackets
src/extensions/default/AutoUpdate/node/AutoUpdateDomain.js
init
function init(domainManager) { if (!domainManager.hasDomain("AutoUpdate")) { domainManager.registerDomain("AutoUpdate", { major: 0, minor: 1 }); } _domainManager = domainManager; domainManager.registerCommand( "AutoUpda...
javascript
function init(domainManager) { if (!domainManager.hasDomain("AutoUpdate")) { domainManager.registerDomain("AutoUpdate", { major: 0, minor: 1 }); } _domainManager = domainManager; domainManager.registerCommand( "AutoUpda...
[ "function", "init", "(", "domainManager", ")", "{", "if", "(", "!", "domainManager", ".", "hasDomain", "(", "\"AutoUpdate\"", ")", ")", "{", "domainManager", ".", "registerDomain", "(", "\"AutoUpdate\"", ",", "{", "major", ":", "0", ",", "minor", ":", "1",...
Initialize the domain with commands and events related to AutoUpdate @param {DomainManager} domainManager - The DomainManager for AutoUpdateDomain
[ "Initialize", "the", "domain", "with", "commands", "and", "events", "related", "to", "AutoUpdate" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/node/AutoUpdateDomain.js#L455-L507
2,106
adobe/brackets
src/editor/Editor.js
_buildPreferencesContext
function _buildPreferencesContext(fullPath) { return PreferencesManager._buildContext(fullPath, fullPath ? LanguageManager.getLanguageForPath(fullPath).getId() : undefined); }
javascript
function _buildPreferencesContext(fullPath) { return PreferencesManager._buildContext(fullPath, fullPath ? LanguageManager.getLanguageForPath(fullPath).getId() : undefined); }
[ "function", "_buildPreferencesContext", "(", "fullPath", ")", "{", "return", "PreferencesManager", ".", "_buildContext", "(", "fullPath", ",", "fullPath", "?", "LanguageManager", ".", "getLanguageForPath", "(", "fullPath", ")", ".", "getId", "(", ")", ":", "undefi...
Helper function to build preferences context based on the full path of the file. @param {string} fullPath Full path of the file @return {*} A context for the specified file name
[ "Helper", "function", "to", "build", "preferences", "context", "based", "on", "the", "full", "path", "of", "the", "file", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/Editor.js#L292-L295
2,107
adobe/brackets
src/editor/Editor.js
_onKeyEvent
function _onKeyEvent(instance, event) { self.trigger("keyEvent", self, event); // deprecated self.trigger(event.type, self, event); return event.defaultPrevented; // false tells CodeMirror we didn't eat the event }
javascript
function _onKeyEvent(instance, event) { self.trigger("keyEvent", self, event); // deprecated self.trigger(event.type, self, event); return event.defaultPrevented; // false tells CodeMirror we didn't eat the event }
[ "function", "_onKeyEvent", "(", "instance", ",", "event", ")", "{", "self", ".", "trigger", "(", "\"keyEvent\"", ",", "self", ",", "event", ")", ";", "// deprecated", "self", ".", "trigger", "(", "event", ".", "type", ",", "self", ",", "event", ")", ";...
Redispatch these CodeMirror key events as Editor events
[ "Redispatch", "these", "CodeMirror", "key", "events", "as", "Editor", "events" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/Editor.js#L1004-L1008
2,108
adobe/brackets
src/utils/StringUtils.js
format
function format(str) { // arguments[0] is the base string, so we need to adjust index values here var args = [].slice.call(arguments, 1); return str.replace(/\{(\d+)\}/g, function (match, num) { return typeof args[num] !== "undefined" ? args[num] : match; }); }
javascript
function format(str) { // arguments[0] is the base string, so we need to adjust index values here var args = [].slice.call(arguments, 1); return str.replace(/\{(\d+)\}/g, function (match, num) { return typeof args[num] !== "undefined" ? args[num] : match; }); }
[ "function", "format", "(", "str", ")", "{", "// arguments[0] is the base string, so we need to adjust index values here", "var", "args", "=", "[", "]", ".", "slice", ".", "call", "(", "arguments", ",", "1", ")", ";", "return", "str", ".", "replace", "(", "/", ...
Format a string by replacing placeholder symbols with passed in arguments. Example: var formatted = StringUtils.format("Hello {0}", "World"); @param {string} str The base string @param {...} Arguments to be substituted into the string @return {string} Formatted string
[ "Format", "a", "string", "by", "replacing", "placeholder", "symbols", "with", "passed", "in", "arguments", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/StringUtils.js#L50-L56
2,109
adobe/brackets
src/utils/StringUtils.js
breakableUrl
function breakableUrl(url) { // This is for displaying in UI, so always want it escaped var escUrl = _.escape(url); // Inject zero-width space character (U+200B) near path separators (/) to allow line breaking there return escUrl.replace( new RegExp(regexEscape("/"), "g"), ...
javascript
function breakableUrl(url) { // This is for displaying in UI, so always want it escaped var escUrl = _.escape(url); // Inject zero-width space character (U+200B) near path separators (/) to allow line breaking there return escUrl.replace( new RegExp(regexEscape("/"), "g"), ...
[ "function", "breakableUrl", "(", "url", ")", "{", "// This is for displaying in UI, so always want it escaped", "var", "escUrl", "=", "_", ".", "escape", "(", "url", ")", ";", "// Inject zero-width space character (U+200B) near path separators (/) to allow line breaking there", "...
Return an escaped path or URL string that can be broken near path separators. @param {string} url the path or URL to format @return {string} the formatted path or URL
[ "Return", "an", "escaped", "path", "or", "URL", "string", "that", "can", "be", "broken", "near", "path", "separators", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/StringUtils.js#L166-L175
2,110
adobe/brackets
src/utils/StringUtils.js
prettyPrintBytes
function prettyPrintBytes(bytes, precision) { var kilobyte = 1024, megabyte = kilobyte * 1024, gigabyte = megabyte * 1024, terabyte = gigabyte * 1024, returnVal = bytes; if ((bytes >= 0) && (bytes < kilobyte)) { returnVal = bytes + " B"; ...
javascript
function prettyPrintBytes(bytes, precision) { var kilobyte = 1024, megabyte = kilobyte * 1024, gigabyte = megabyte * 1024, terabyte = gigabyte * 1024, returnVal = bytes; if ((bytes >= 0) && (bytes < kilobyte)) { returnVal = bytes + " B"; ...
[ "function", "prettyPrintBytes", "(", "bytes", ",", "precision", ")", "{", "var", "kilobyte", "=", "1024", ",", "megabyte", "=", "kilobyte", "*", "1024", ",", "gigabyte", "=", "megabyte", "*", "1024", ",", "terabyte", "=", "gigabyte", "*", "1024", ",", "r...
Converts number of bytes into human readable format. If param bytes is negative it returns the number without any changes. @param {number} bytes Number of bytes to convert @param {number} precision Number of digits after the decimal separator @return {string}
[ "Converts", "number", "of", "bytes", "into", "human", "readable", "format", ".", "If", "param", "bytes", "is", "negative", "it", "returns", "the", "number", "without", "any", "changes", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/StringUtils.js#L185-L205
2,111
adobe/brackets
src/utils/StringUtils.js
truncate
function truncate(str, len) { // Truncate text to specified length if (str.length > len) { str = str.substr(0, len); // To prevent awkwardly truncating in the middle of a word, // attempt to truncate at the end of the last whole word var lastSpaceChar = s...
javascript
function truncate(str, len) { // Truncate text to specified length if (str.length > len) { str = str.substr(0, len); // To prevent awkwardly truncating in the middle of a word, // attempt to truncate at the end of the last whole word var lastSpaceChar = s...
[ "function", "truncate", "(", "str", ",", "len", ")", "{", "// Truncate text to specified length", "if", "(", "str", ".", "length", ">", "len", ")", "{", "str", "=", "str", ".", "substr", "(", "0", ",", "len", ")", ";", "// To prevent awkwardly truncating in ...
Truncate text to specified length. @param {string} str Text to be truncated. @param {number} len Length to which text should be truncated @return {?string} Returns truncated text only if it was changed
[ "Truncate", "text", "to", "specified", "length", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/StringUtils.js#L213-L226
2,112
adobe/brackets
src/utils/ValidationUtils.js
isInteger
function isInteger(value) { // Validate value is a number if (typeof (value) !== "number" || isNaN(parseInt(value, 10))) { return false; } // Validate number is an integer if (Math.floor(value) !== value) { return false; } // Validate num...
javascript
function isInteger(value) { // Validate value is a number if (typeof (value) !== "number" || isNaN(parseInt(value, 10))) { return false; } // Validate number is an integer if (Math.floor(value) !== value) { return false; } // Validate num...
[ "function", "isInteger", "(", "value", ")", "{", "// Validate value is a number", "if", "(", "typeof", "(", "value", ")", "!==", "\"number\"", "||", "isNaN", "(", "parseInt", "(", "value", ",", "10", ")", ")", ")", "{", "return", "false", ";", "}", "// V...
Used to validate whether type of unknown value is an integer. @param {*} value Value for which to validate its type @return {boolean} true if value is a finite integer
[ "Used", "to", "validate", "whether", "type", "of", "unknown", "value", "is", "an", "integer", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/ValidationUtils.js#L34-L51
2,113
adobe/brackets
src/utils/ValidationUtils.js
isIntegerInRange
function isIntegerInRange(value, lowerLimit, upperLimit) { // Validate value is an integer if (!isInteger(value)) { return false; } // Validate integer is in range var hasLowerLimt = (typeof (lowerLimit) === "number"), hasUpperLimt = (typeof (upperLimit) ...
javascript
function isIntegerInRange(value, lowerLimit, upperLimit) { // Validate value is an integer if (!isInteger(value)) { return false; } // Validate integer is in range var hasLowerLimt = (typeof (lowerLimit) === "number"), hasUpperLimt = (typeof (upperLimit) ...
[ "function", "isIntegerInRange", "(", "value", ",", "lowerLimit", ",", "upperLimit", ")", "{", "// Validate value is an integer", "if", "(", "!", "isInteger", "(", "value", ")", ")", "{", "return", "false", ";", "}", "// Validate integer is in range", "var", "hasLo...
Used to validate whether type of unknown value is an integer, and, if so, is it within the option lower and upper limits. @param {*} value Value for which to validate its type @param {number=} lowerLimit Optional lower limit (inclusive) @param {number=} upperLimit Optional upper limit (inclusive) @return {boolean} tru...
[ "Used", "to", "validate", "whether", "type", "of", "unknown", "value", "is", "an", "integer", "and", "if", "so", "is", "it", "within", "the", "option", "lower", "and", "upper", "limits", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/ValidationUtils.js#L62-L73
2,114
adobe/brackets
src/document/TextRange.js
TextRange
function TextRange(document, startLine, endLine) { this.startLine = startLine; this.endLine = endLine; this.document = document; document.addRef(); // store this-bound versions of listeners so we can remove them later this._handleDocumentChange = this._handleDocumentChan...
javascript
function TextRange(document, startLine, endLine) { this.startLine = startLine; this.endLine = endLine; this.document = document; document.addRef(); // store this-bound versions of listeners so we can remove them later this._handleDocumentChange = this._handleDocumentChan...
[ "function", "TextRange", "(", "document", ",", "startLine", ",", "endLine", ")", "{", "this", ".", "startLine", "=", "startLine", ";", "this", ".", "endLine", "=", "endLine", ";", "this", ".", "document", "=", "document", ";", "document", ".", "addRef", ...
Stores a range of lines that is automatically maintained as the Document changes. The range MAY drop out of sync with the Document in certain edge cases; startLine & endLine will become null when that happens. Important: you must dispose() a TextRange when you're done with it. Because TextRange addRef()s the Document ...
[ "Stores", "a", "range", "of", "lines", "that", "is", "automatically", "maintained", "as", "the", "Document", "changes", ".", "The", "range", "MAY", "drop", "out", "of", "sync", "with", "the", "Document", "in", "certain", "edge", "cases", ";", "startLine", ...
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/document/TextRange.js#L58-L69
2,115
adobe/brackets
src/language/CSSUtils.js
getInfoAtPos
function getInfoAtPos(editor, constPos) { // We're going to be changing pos a lot, but we don't want to mess up // the pos the caller passed in so we use extend to make a safe copy of it. var pos = $.extend({}, constPos), ctx = TokenUtils.getInitialContext(editor._codeMirror, pos), ...
javascript
function getInfoAtPos(editor, constPos) { // We're going to be changing pos a lot, but we don't want to mess up // the pos the caller passed in so we use extend to make a safe copy of it. var pos = $.extend({}, constPos), ctx = TokenUtils.getInitialContext(editor._codeMirror, pos), ...
[ "function", "getInfoAtPos", "(", "editor", ",", "constPos", ")", "{", "// We're going to be changing pos a lot, but we don't want to mess up", "// the pos the caller passed in so we use extend to make a safe copy of it.", "var", "pos", "=", "$", ".", "extend", "(", "{", "}", ",...
Returns a context info object for the given cursor position @param {!Editor} editor @param {{ch: number, line: number}} constPos A CM pos (likely from editor.getCursorPos()) @return {{context: string, offset: number, name: string, index: number, values: Array.<string>, isNewItem: boolean, range: {start: {line: number,...
[ "Returns", "a", "context", "info", "object", "for", "the", "given", "cursor", "position" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/CSSUtils.js#L611-L658
2,116
adobe/brackets
src/language/CSSUtils.js
getCompleteSelectors
function getCompleteSelectors(info, useGroup) { if (info.parentSelectors) { // Show parents with / separators. var completeSelectors = info.parentSelectors + " / "; if (useGroup && info.selectorGroup) { completeSelectors += info.selectorGroup; } el...
javascript
function getCompleteSelectors(info, useGroup) { if (info.parentSelectors) { // Show parents with / separators. var completeSelectors = info.parentSelectors + " / "; if (useGroup && info.selectorGroup) { completeSelectors += info.selectorGroup; } el...
[ "function", "getCompleteSelectors", "(", "info", ",", "useGroup", ")", "{", "if", "(", "info", ".", "parentSelectors", ")", "{", "// Show parents with / separators.", "var", "completeSelectors", "=", "info", ".", "parentSelectors", "+", "\" / \"", ";", "if", "(", ...
Return a string that shows the literal parent hierarchy of the selector in info. @param {!SelectorInfo} info @param {boolean=} useGroup true to append selectorGroup instead of selector @return {string} the literal parent hierarchy of the selector
[ "Return", "a", "string", "that", "shows", "the", "literal", "parent", "hierarchy", "of", "the", "selector", "in", "info", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/CSSUtils.js#L668-L683
2,117
adobe/brackets
src/language/CSSUtils.js
_getSelectorInFinalCSSForm
function _getSelectorInFinalCSSForm(selectorArray) { var finalSelectorArray = [""], parentSelectorArray = [], group = []; _.forEach(selectorArray, function (selector) { selector = _stripAtRules(selector); group = selector.split(","); parentSele...
javascript
function _getSelectorInFinalCSSForm(selectorArray) { var finalSelectorArray = [""], parentSelectorArray = [], group = []; _.forEach(selectorArray, function (selector) { selector = _stripAtRules(selector); group = selector.split(","); parentSele...
[ "function", "_getSelectorInFinalCSSForm", "(", "selectorArray", ")", "{", "var", "finalSelectorArray", "=", "[", "\"\"", "]", ",", "parentSelectorArray", "=", "[", "]", ",", "group", "=", "[", "]", ";", "_", ".", "forEach", "(", "selectorArray", ",", "functi...
Converts the given selector array into the actual CSS selectors similar to those generated by a CSS preprocessor. @param {Array.<string>} selectorArray @return {string}
[ "Converts", "the", "given", "selector", "array", "into", "the", "actual", "CSS", "selectors", "similar", "to", "those", "generated", "by", "a", "CSS", "preprocessor", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/CSSUtils.js#L1314-L1341
2,118
adobe/brackets
src/language/CSSUtils.js
_findAllMatchingSelectorsInText
function _findAllMatchingSelectorsInText(text, selector, mode) { var allSelectors = extractAllSelectors(text, mode); var result = []; // For now, we only match the rightmost simple selector, and ignore // attribute selectors and pseudo selectors var classOrIdSelector = selector[...
javascript
function _findAllMatchingSelectorsInText(text, selector, mode) { var allSelectors = extractAllSelectors(text, mode); var result = []; // For now, we only match the rightmost simple selector, and ignore // attribute selectors and pseudo selectors var classOrIdSelector = selector[...
[ "function", "_findAllMatchingSelectorsInText", "(", "text", ",", "selector", ",", "mode", ")", "{", "var", "allSelectors", "=", "extractAllSelectors", "(", "text", ",", "mode", ")", ";", "var", "result", "=", "[", "]", ";", "// For now, we only match the rightmost...
Finds all instances of the specified selector in "text". Returns an Array of Objects with start and end properties. For now, we only support simple selectors. This function will need to change dramatically to support full selectors. FUTURE: (JRB) It would be nice to eventually use the browser/jquery to do the selecto...
[ "Finds", "all", "instances", "of", "the", "specified", "selector", "in", "text", ".", "Returns", "an", "Array", "of", "Objects", "with", "start", "and", "end", "properties", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/CSSUtils.js#L1363-L1400
2,119
adobe/brackets
src/language/CSSUtils.js
_findMatchingRulesInCSSFiles
function _findMatchingRulesInCSSFiles(selector, resultSelectors) { var result = new $.Deferred(); // Load one CSS file and search its contents function _loadFileAndScan(fullPath, selector) { var oneFileResult = new $.Deferred(); DocumentManager.getDocumentForPa...
javascript
function _findMatchingRulesInCSSFiles(selector, resultSelectors) { var result = new $.Deferred(); // Load one CSS file and search its contents function _loadFileAndScan(fullPath, selector) { var oneFileResult = new $.Deferred(); DocumentManager.getDocumentForPa...
[ "function", "_findMatchingRulesInCSSFiles", "(", "selector", ",", "resultSelectors", ")", "{", "var", "result", "=", "new", "$", ".", "Deferred", "(", ")", ";", "// Load one CSS file and search its contents", "function", "_loadFileAndScan", "(", "fullPath", ",", "sele...
Finds matching selectors in CSS files; adds them to 'resultSelectors'
[ "Finds", "matching", "selectors", "in", "CSS", "files", ";", "adds", "them", "to", "resultSelectors" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/CSSUtils.js#L1424-L1458
2,120
adobe/brackets
src/language/CSSUtils.js
_loadFileAndScan
function _loadFileAndScan(fullPath, selector) { var oneFileResult = new $.Deferred(); DocumentManager.getDocumentForPath(fullPath) .done(function (doc) { // Find all matching rules for the given CSS file's content, and add them to the // o...
javascript
function _loadFileAndScan(fullPath, selector) { var oneFileResult = new $.Deferred(); DocumentManager.getDocumentForPath(fullPath) .done(function (doc) { // Find all matching rules for the given CSS file's content, and add them to the // o...
[ "function", "_loadFileAndScan", "(", "fullPath", ",", "selector", ")", "{", "var", "oneFileResult", "=", "new", "$", ".", "Deferred", "(", ")", ";", "DocumentManager", ".", "getDocumentForPath", "(", "fullPath", ")", ".", "done", "(", "function", "(", "doc",...
Load one CSS file and search its contents
[ "Load", "one", "CSS", "file", "and", "search", "its", "contents" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/CSSUtils.js#L1428-L1446
2,121
adobe/brackets
src/language/CSSUtils.js
_parseSelector
function _parseSelector(ctx) { var selector = ""; // Skip over { TokenUtils.movePrevToken(ctx); while (true) { if (ctx.token.type !== "comment") { // Stop once we've reached a {, }, or ; if (/[\{\}\;]/.test(ctx.tok...
javascript
function _parseSelector(ctx) { var selector = ""; // Skip over { TokenUtils.movePrevToken(ctx); while (true) { if (ctx.token.type !== "comment") { // Stop once we've reached a {, }, or ; if (/[\{\}\;]/.test(ctx.tok...
[ "function", "_parseSelector", "(", "ctx", ")", "{", "var", "selector", "=", "\"\"", ";", "// Skip over {", "TokenUtils", ".", "movePrevToken", "(", "ctx", ")", ";", "while", "(", "true", ")", "{", "if", "(", "ctx", ".", "token", ".", "type", "!==", "\"...
Parse a selector. Assumes ctx is pointing at the opening { that is after the selector name.
[ "Parse", "a", "selector", ".", "Assumes", "ctx", "is", "pointing", "at", "the", "opening", "{", "that", "is", "after", "the", "selector", "name", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/CSSUtils.js#L1563-L1594
2,122
adobe/brackets
src/language/CSSUtils.js
extractAllNamedFlows
function extractAllNamedFlows(text) { var namedFlowRegEx = /(?:flow\-(into|from)\:\s*)([\w\-]+)(?:\s*;)/gi, result = [], names = {}, thisMatch; // Reduce the content so that matches // inside strings and comments are ignored text = reduceStyleSheetFor...
javascript
function extractAllNamedFlows(text) { var namedFlowRegEx = /(?:flow\-(into|from)\:\s*)([\w\-]+)(?:\s*;)/gi, result = [], names = {}, thisMatch; // Reduce the content so that matches // inside strings and comments are ignored text = reduceStyleSheetFor...
[ "function", "extractAllNamedFlows", "(", "text", ")", "{", "var", "namedFlowRegEx", "=", "/", "(?:flow\\-(into|from)\\:\\s*)([\\w\\-]+)(?:\\s*;)", "/", "gi", ",", "result", "=", "[", "]", ",", "names", "=", "{", "}", ",", "thisMatch", ";", "// Reduce the content s...
Extracts all named flow instances @param {!string} text to extract from @return {Array.<string>} array of unique flow names found in the content (empty if none)
[ "Extracts", "all", "named", "flow", "instances" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/CSSUtils.js#L1729-L1753
2,123
adobe/brackets
src/document/ChangedDocumentTracker.js
ChangedDocumentTracker
function ChangedDocumentTracker() { var self = this; this._changedPaths = {}; this._windowFocus = true; this._addListener = this._addListener.bind(this); this._removeListener = this._removeListener.bind(this); this._onChange = this._onChange.bind(this); this._onW...
javascript
function ChangedDocumentTracker() { var self = this; this._changedPaths = {}; this._windowFocus = true; this._addListener = this._addListener.bind(this); this._removeListener = this._removeListener.bind(this); this._onChange = this._onChange.bind(this); this._onW...
[ "function", "ChangedDocumentTracker", "(", ")", "{", "var", "self", "=", "this", ";", "this", ".", "_changedPaths", "=", "{", "}", ";", "this", ".", "_windowFocus", "=", "true", ";", "this", ".", "_addListener", "=", "this", ".", "_addListener", ".", "bi...
Tracks "change" events on opened Documents. Used to monitor changes to documents in-memory and update caches. Assumes all documents have changed when the Brackets window loses and regains focus. Does not read timestamps of files on disk. Clients may optionally track file timestamps on disk independently. @constructor
[ "Tracks", "change", "events", "on", "opened", "Documents", ".", "Used", "to", "monitor", "changes", "to", "documents", "in", "-", "memory", "and", "update", "caches", ".", "Assumes", "all", "documents", "have", "changed", "when", "the", "Brackets", "window", ...
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/document/ChangedDocumentTracker.js#L41-L65
2,124
adobe/brackets
src/search/FindReplace.js
_findAllAndSelect
function _findAllAndSelect(editor) { editor = editor || EditorManager.getActiveEditor(); if (!editor) { return; } var sel = editor.getSelection(), newSelections = []; if (CodeMirror.cmpPos(sel.start, sel.end) === 0) { sel = _getWordAt(editor, ...
javascript
function _findAllAndSelect(editor) { editor = editor || EditorManager.getActiveEditor(); if (!editor) { return; } var sel = editor.getSelection(), newSelections = []; if (CodeMirror.cmpPos(sel.start, sel.end) === 0) { sel = _getWordAt(editor, ...
[ "function", "_findAllAndSelect", "(", "editor", ")", "{", "editor", "=", "editor", "||", "EditorManager", ".", "getActiveEditor", "(", ")", ";", "if", "(", "!", "editor", ")", "{", "return", ";", "}", "var", "sel", "=", "editor", ".", "getSelection", "("...
Takes the primary selection, expands it to a word range if necessary, then sets the selection to include all instances of that range. Removes all other selections. Does nothing if the selection is not a range after expansion.
[ "Takes", "the", "primary", "selection", "expands", "it", "to", "a", "word", "range", "if", "necessary", "then", "sets", "the", "selection", "to", "include", "all", "instances", "of", "that", "range", ".", "Removes", "all", "other", "selections", ".", "Does",...
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindReplace.js#L364-L395
2,125
adobe/brackets
src/search/FindReplace.js
clearCurrentMatchHighlight
function clearCurrentMatchHighlight(cm, state) { if (state.markedCurrent) { state.markedCurrent.clear(); ScrollTrackMarkers.markCurrent(-1); } }
javascript
function clearCurrentMatchHighlight(cm, state) { if (state.markedCurrent) { state.markedCurrent.clear(); ScrollTrackMarkers.markCurrent(-1); } }
[ "function", "clearCurrentMatchHighlight", "(", "cm", ",", "state", ")", "{", "if", "(", "state", ".", "markedCurrent", ")", "{", "state", ".", "markedCurrent", ".", "clear", "(", ")", ";", "ScrollTrackMarkers", ".", "markCurrent", "(", "-", "1", ")", ";", ...
Removes the current-match highlight, leaving all matches marked in the generic highlight style
[ "Removes", "the", "current", "-", "match", "highlight", "leaving", "all", "matches", "marked", "in", "the", "generic", "highlight", "style" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindReplace.js#L398-L403
2,126
adobe/brackets
src/search/FindReplace.js
clearHighlights
function clearHighlights(cm, state) { cm.operation(function () { state.marked.forEach(function (markedRange) { markedRange.clear(); }); clearCurrentMatchHighlight(cm, state); }); state.marked.length = 0; state.markedCurrent = null; ...
javascript
function clearHighlights(cm, state) { cm.operation(function () { state.marked.forEach(function (markedRange) { markedRange.clear(); }); clearCurrentMatchHighlight(cm, state); }); state.marked.length = 0; state.markedCurrent = null; ...
[ "function", "clearHighlights", "(", "cm", ",", "state", ")", "{", "cm", ".", "operation", "(", "function", "(", ")", "{", "state", ".", "marked", ".", "forEach", "(", "function", "(", "markedRange", ")", "{", "markedRange", ".", "clear", "(", ")", ";",...
Clears all match highlights, including the current match
[ "Clears", "all", "match", "highlights", "including", "the", "current", "match" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindReplace.js#L451-L465
2,127
adobe/brackets
src/search/FindReplace.js
openSearchBar
function openSearchBar(editor, replace) { var cm = editor._codeMirror, state = getSearchState(cm); // Use the selection start as the searchStartPos. This way if you // start with a pre-populated search and enter an additional character, // it will extend the initial selectio...
javascript
function openSearchBar(editor, replace) { var cm = editor._codeMirror, state = getSearchState(cm); // Use the selection start as the searchStartPos. This way if you // start with a pre-populated search and enter an additional character, // it will extend the initial selectio...
[ "function", "openSearchBar", "(", "editor", ",", "replace", ")", "{", "var", "cm", "=", "editor", ".", "_codeMirror", ",", "state", "=", "getSearchState", "(", "cm", ")", ";", "// Use the selection start as the searchStartPos. This way if you", "// start with a pre-popu...
Creates a Find bar for the current search session. @param {!Editor} editor @param {boolean} replace Whether to show the Replace UI; default false
[ "Creates", "a", "Find", "bar", "for", "the", "current", "search", "session", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindReplace.js#L597-L649
2,128
adobe/brackets
src/extensions/default/JSLint/main.js
_getIndentSize
function _getIndentSize(fullPath) { return Editor.getUseTabChar(fullPath) ? Editor.getTabSize(fullPath) : Editor.getSpaceUnits(fullPath); }
javascript
function _getIndentSize(fullPath) { return Editor.getUseTabChar(fullPath) ? Editor.getTabSize(fullPath) : Editor.getSpaceUnits(fullPath); }
[ "function", "_getIndentSize", "(", "fullPath", ")", "{", "return", "Editor", ".", "getUseTabChar", "(", "fullPath", ")", "?", "Editor", ".", "getTabSize", "(", "fullPath", ")", ":", "Editor", ".", "getSpaceUnits", "(", "fullPath", ")", ";", "}" ]
gets indentation size depending whether the tabs or spaces are used
[ "gets", "indentation", "size", "depending", "whether", "the", "tabs", "or", "spaces", "are", "used" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/JSLint/main.js#L210-L212
2,129
adobe/brackets
src/extensions/default/JSLint/main.js
lintOneFile
function lintOneFile(text, fullPath) { // If a line contains only whitespace (here spaces or tabs), remove the whitespace text = text.replace(/^[ \t]+$/gm, ""); var options = prefs.get("options"); _lastRunOptions = _.clone(options); if (!options) { options = {}; ...
javascript
function lintOneFile(text, fullPath) { // If a line contains only whitespace (here spaces or tabs), remove the whitespace text = text.replace(/^[ \t]+$/gm, ""); var options = prefs.get("options"); _lastRunOptions = _.clone(options); if (!options) { options = {}; ...
[ "function", "lintOneFile", "(", "text", ",", "fullPath", ")", "{", "// If a line contains only whitespace (here spaces or tabs), remove the whitespace", "text", "=", "text", ".", "replace", "(", "/", "^[ \\t]+$", "/", "gm", ",", "\"\"", ")", ";", "var", "options", "...
Run JSLint on the current document. Reports results to the main UI. Displays a gold star when no errors are found.
[ "Run", "JSLint", "on", "the", "current", "document", ".", "Reports", "results", "to", "the", "main", "UI", ".", "Displays", "a", "gold", "star", "when", "no", "errors", "are", "found", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/JSLint/main.js#L218-L272
2,130
adobe/brackets
src/extensions/default/InlineColorEditor/main.js
prepareEditorForProvider
function prepareEditorForProvider(hostEditor, pos) { var colorRegEx, cursorLine, match, sel, start, end, endPos, marker; sel = hostEditor.getSelection(); if (sel.start.line !== sel.end.line) { return null; } colorRegEx = new RegExp(ColorUtils.COLOR_REGEX); c...
javascript
function prepareEditorForProvider(hostEditor, pos) { var colorRegEx, cursorLine, match, sel, start, end, endPos, marker; sel = hostEditor.getSelection(); if (sel.start.line !== sel.end.line) { return null; } colorRegEx = new RegExp(ColorUtils.COLOR_REGEX); c...
[ "function", "prepareEditorForProvider", "(", "hostEditor", ",", "pos", ")", "{", "var", "colorRegEx", ",", "cursorLine", ",", "match", ",", "sel", ",", "start", ",", "end", ",", "endPos", ",", "marker", ";", "sel", "=", "hostEditor", ".", "getSelection", "...
Prepare hostEditor for an InlineColorEditor at pos if possible. Return editor context if so; otherwise null. @param {Editor} hostEditor @param {{line:Number, ch:Number}} pos @return {?{color:String, marker:TextMarker}}
[ "Prepare", "hostEditor", "for", "an", "InlineColorEditor", "at", "pos", "if", "possible", ".", "Return", "editor", "context", "if", "so", ";", "otherwise", "null", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineColorEditor/main.js#L41-L77
2,131
adobe/brackets
src/LiveDevelopment/MultiBrowserImpl/protocol/remote/LiveDevProtocolRemote.js
function (msg) { var msgHandlers; if (!msg.method) { // no message type, ignoring it // TODO: should we trigger a generic event? console.log("[Brackets LiveDev] Received message without method."); return; } /...
javascript
function (msg) { var msgHandlers; if (!msg.method) { // no message type, ignoring it // TODO: should we trigger a generic event? console.log("[Brackets LiveDev] Received message without method."); return; } /...
[ "function", "(", "msg", ")", "{", "var", "msgHandlers", ";", "if", "(", "!", "msg", ".", "method", ")", "{", "// no message type, ignoring it", "// TODO: should we trigger a generic event?", "console", ".", "log", "(", "\"[Brackets LiveDev] Received message without method...
Dispatch messages to handlers according to msg.method value. @param {Object} msg Message to be dispatched.
[ "Dispatch", "messages", "to", "handlers", "according", "to", "msg", ".", "method", "value", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/MultiBrowserImpl/protocol/remote/LiveDevProtocolRemote.js#L60-L90
2,132
adobe/brackets
src/LiveDevelopment/MultiBrowserImpl/protocol/remote/LiveDevProtocolRemote.js
function (orig, response) { if (!orig.id) { console.log("[Brackets LiveDev] Trying to send a response for a message with no ID"); return; } response.id = orig.id; this.send(response); }
javascript
function (orig, response) { if (!orig.id) { console.log("[Brackets LiveDev] Trying to send a response for a message with no ID"); return; } response.id = orig.id; this.send(response); }
[ "function", "(", "orig", ",", "response", ")", "{", "if", "(", "!", "orig", ".", "id", ")", "{", "console", ".", "log", "(", "\"[Brackets LiveDev] Trying to send a response for a message with no ID\"", ")", ";", "return", ";", "}", "response", ".", "id", "=", ...
Send a response of a particular message to the Editor. Original message must provide an 'id' property @param {Object} orig Original message. @param {Object} response Message to be sent as the response.
[ "Send", "a", "response", "of", "a", "particular", "message", "to", "the", "Editor", ".", "Original", "message", "must", "provide", "an", "id", "property" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/MultiBrowserImpl/protocol/remote/LiveDevProtocolRemote.js#L98-L105
2,133
adobe/brackets
src/LiveDevelopment/MultiBrowserImpl/protocol/remote/LiveDevProtocolRemote.js
function (method, handler) { if (!method || !handler) { return; } if (!this.handlers[method]) { //initialize array this.handlers[method] = []; } // add handler to the stack this.handlers[method].push(...
javascript
function (method, handler) { if (!method || !handler) { return; } if (!this.handlers[method]) { //initialize array this.handlers[method] = []; } // add handler to the stack this.handlers[method].push(...
[ "function", "(", "method", ",", "handler", ")", "{", "if", "(", "!", "method", "||", "!", "handler", ")", "{", "return", ";", "}", "if", "(", "!", "this", ".", "handlers", "[", "method", "]", ")", "{", "//initialize array", "this", ".", "handlers", ...
Subscribe handlers to specific messages. @param {string} method Message type. @param {function} handler. TODO: add handler name or any identification mechanism to then implement 'off'?
[ "Subscribe", "handlers", "to", "specific", "messages", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/MultiBrowserImpl/protocol/remote/LiveDevProtocolRemote.js#L113-L123
2,134
adobe/brackets
src/LiveDevelopment/MultiBrowserImpl/protocol/remote/LiveDevProtocolRemote.js
function (msg) { console.log("Runtime.evaluate"); var result = eval(msg.params.expression); MessageBroker.respond(msg, { result: JSON.stringify(result) // TODO: in original protocol this is an object handle }); }
javascript
function (msg) { console.log("Runtime.evaluate"); var result = eval(msg.params.expression); MessageBroker.respond(msg, { result: JSON.stringify(result) // TODO: in original protocol this is an object handle }); }
[ "function", "(", "msg", ")", "{", "console", ".", "log", "(", "\"Runtime.evaluate\"", ")", ";", "var", "result", "=", "eval", "(", "msg", ".", "params", ".", "expression", ")", ";", "MessageBroker", ".", "respond", "(", "msg", ",", "{", "result", ":", ...
Evaluate an expresion and return its result.
[ "Evaluate", "an", "expresion", "and", "return", "its", "result", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/MultiBrowserImpl/protocol/remote/LiveDevProtocolRemote.js#L141-L147
2,135
adobe/brackets
src/LiveDevelopment/MultiBrowserImpl/protocol/remote/LiveDevProtocolRemote.js
function (msg) { if (msg.params.url) { // navigate to a new page. window.location.replace(msg.params.url); } }
javascript
function (msg) { if (msg.params.url) { // navigate to a new page. window.location.replace(msg.params.url); } }
[ "function", "(", "msg", ")", "{", "if", "(", "msg", ".", "params", ".", "url", ")", "{", "// navigate to a new page.", "window", ".", "location", ".", "replace", "(", "msg", ".", "params", ".", "url", ")", ";", "}", "}" ]
Navigate to a different page. @param {Object} msg
[ "Navigate", "to", "a", "different", "page", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/MultiBrowserImpl/protocol/remote/LiveDevProtocolRemote.js#L251-L256
2,136
adobe/brackets
src/LiveDevelopment/MultiBrowserImpl/protocol/remote/LiveDevProtocolRemote.js
function (msgStr) { var msg; try { msg = JSON.parse(msgStr); } catch (e) { console.log("[Brackets LiveDev] Malformed message received: ", msgStr); return; } // delegates handling/routing to MessageBroker. ...
javascript
function (msgStr) { var msg; try { msg = JSON.parse(msgStr); } catch (e) { console.log("[Brackets LiveDev] Malformed message received: ", msgStr); return; } // delegates handling/routing to MessageBroker. ...
[ "function", "(", "msgStr", ")", "{", "var", "msg", ";", "try", "{", "msg", "=", "JSON", ".", "parse", "(", "msgStr", ")", ";", "}", "catch", "(", "e", ")", "{", "console", ".", "log", "(", "\"[Brackets LiveDev] Malformed message received: \"", ",", "msgS...
Handles a message from the transport. Parses it as JSON and delegates to MessageBroker who is in charge of routing them to handlers. @param {string} msgStr The protocol message as stringified JSON.
[ "Handles", "a", "message", "from", "the", "transport", ".", "Parses", "it", "as", "JSON", "and", "delegates", "to", "MessageBroker", "who", "is", "in", "charge", "of", "routing", "them", "to", "handlers", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/MultiBrowserImpl/protocol/remote/LiveDevProtocolRemote.js#L353-L363
2,137
adobe/brackets
src/LiveDevelopment/MultiBrowserImpl/protocol/remote/LiveDevProtocolRemote.js
onDocumentClick
function onDocumentClick(event) { var element = event.target; if (element && element.hasAttribute('data-brackets-id')) { MessageBroker.send({"tagId": element.getAttribute('data-brackets-id')}); } }
javascript
function onDocumentClick(event) { var element = event.target; if (element && element.hasAttribute('data-brackets-id')) { MessageBroker.send({"tagId": element.getAttribute('data-brackets-id')}); } }
[ "function", "onDocumentClick", "(", "event", ")", "{", "var", "element", "=", "event", ".", "target", ";", "if", "(", "element", "&&", "element", ".", "hasAttribute", "(", "'data-brackets-id'", ")", ")", "{", "MessageBroker", ".", "send", "(", "{", "\"tagI...
Sends the message containing tagID which is being clicked to the editor in order to change the cursor position to the HTML tag corresponding to the clicked element.
[ "Sends", "the", "message", "containing", "tagID", "which", "is", "being", "clicked", "to", "the", "editor", "in", "order", "to", "change", "the", "cursor", "position", "to", "the", "HTML", "tag", "corresponding", "to", "the", "clicked", "element", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/MultiBrowserImpl/protocol/remote/LiveDevProtocolRemote.js#L385-L390
2,138
adobe/brackets
src/extensions/default/HealthData/HealthDataPreview.js
previewHealthData
function previewHealthData() { var result = new $.Deferred(); HealthDataManager.getHealthData().done(function (healthDataObject) { var combinedHealthAnalyticsData = HealthDataManager.getAnalyticsData(), content; combinedHealthAnalyticsData = [healthDataObject, co...
javascript
function previewHealthData() { var result = new $.Deferred(); HealthDataManager.getHealthData().done(function (healthDataObject) { var combinedHealthAnalyticsData = HealthDataManager.getAnalyticsData(), content; combinedHealthAnalyticsData = [healthDataObject, co...
[ "function", "previewHealthData", "(", ")", "{", "var", "result", "=", "new", "$", ".", "Deferred", "(", ")", ";", "HealthDataManager", ".", "getHealthData", "(", ")", ".", "done", "(", "function", "(", "healthDataObject", ")", "{", "var", "combinedHealthAnal...
Show the dialog for previewing the Health Data that will be sent.
[ "Show", "the", "dialog", "for", "previewing", "the", "Health", "Data", "that", "will", "be", "sent", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/HealthData/HealthDataPreview.js#L44-L76
2,139
adobe/brackets
src/extensions/default/NavigationAndHistory/main.js
_openEditorForContext
function _openEditorForContext(contextData) { // Open the file in the current active pane to prevent unwanted scenarios if we are not in split view, fallback // to the persisted paneId when specified and we are in split view or unable to determine the paneid var activePaneId = MainViewManager.ge...
javascript
function _openEditorForContext(contextData) { // Open the file in the current active pane to prevent unwanted scenarios if we are not in split view, fallback // to the persisted paneId when specified and we are in split view or unable to determine the paneid var activePaneId = MainViewManager.ge...
[ "function", "_openEditorForContext", "(", "contextData", ")", "{", "// Open the file in the current active pane to prevent unwanted scenarios if we are not in split view, fallback", "// to the persisted paneId when specified and we are in split view or unable to determine the paneid", "var", "acti...
Opens a full editor for the given context @private @param {Object.<path, paneId, cursor>} contextData - wrapper to provide the information required to open a full editor @return {$.Promise} - from the commandmanager
[ "Opens", "a", "full", "editor", "for", "the", "given", "context" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NavigationAndHistory/main.js#L99-L129
2,140
adobe/brackets
src/extensions/default/NavigationAndHistory/main.js
_makeMROFListEntry
function _makeMROFListEntry(path, pane, cursorPos) { return { file: path, paneId: pane, cursor: cursorPos }; }
javascript
function _makeMROFListEntry(path, pane, cursorPos) { return { file: path, paneId: pane, cursor: cursorPos }; }
[ "function", "_makeMROFListEntry", "(", "path", ",", "pane", ",", "cursorPos", ")", "{", "return", "{", "file", ":", "path", ",", "paneId", ":", "pane", ",", "cursor", ":", "cursorPos", "}", ";", "}" ]
Creates an entry for MROF list @private @param {String} path - full path of a doc @param {String} pane - the pane holding the editor for the doc @param {Object} cursorPos - current cursor position @return {Object} a frame containing file path, pane and last known cursor
[ "Creates", "an", "entry", "for", "MROF", "list" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NavigationAndHistory/main.js#L139-L145
2,141
adobe/brackets
src/extensions/default/NavigationAndHistory/main.js
_syncWithFileSystem
function _syncWithFileSystem() { _mrofList = _mrofList.filter(function (e) {return e; }); return Async.doSequentially(_mrofList, _checkExt, false); }
javascript
function _syncWithFileSystem() { _mrofList = _mrofList.filter(function (e) {return e; }); return Async.doSequentially(_mrofList, _checkExt, false); }
[ "function", "_syncWithFileSystem", "(", ")", "{", "_mrofList", "=", "_mrofList", ".", "filter", "(", "function", "(", "e", ")", "{", "return", "e", ";", "}", ")", ";", "return", "Async", ".", "doSequentially", "(", "_mrofList", ",", "_checkExt", ",", "fa...
Checks whether entries in MROF list actually exists in fileSystem to prevent access to deleted files @private
[ "Checks", "whether", "entries", "in", "MROF", "list", "actually", "exists", "in", "fileSystem", "to", "prevent", "access", "to", "deleted", "files" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NavigationAndHistory/main.js#L190-L193
2,142
adobe/brackets
src/extensions/default/NavigationAndHistory/main.js
_createMROFList
function _createMROFList() { var paneList = MainViewManager.getPaneIdList(), mrofList = [], fileList, index; var pane, file, mrofEntry, paneCount, fileCount; // Iterate over the pane ID list for (paneCount = 0; paneCount < paneList.length; paneCount+...
javascript
function _createMROFList() { var paneList = MainViewManager.getPaneIdList(), mrofList = [], fileList, index; var pane, file, mrofEntry, paneCount, fileCount; // Iterate over the pane ID list for (paneCount = 0; paneCount < paneList.length; paneCount+...
[ "function", "_createMROFList", "(", ")", "{", "var", "paneList", "=", "MainViewManager", ".", "getPaneIdList", "(", ")", ",", "mrofList", "=", "[", "]", ",", "fileList", ",", "index", ";", "var", "pane", ",", "file", ",", "mrofEntry", ",", "paneCount", "...
This function is used to create mrof when a project is opened for the firt time with the recent files feature This routine acts as a logic to migrate existing viewlist to mrof structure @private
[ "This", "function", "is", "used", "to", "create", "mrof", "when", "a", "project", "is", "opened", "for", "the", "firt", "time", "with", "the", "recent", "files", "feature", "This", "routine", "acts", "as", "a", "logic", "to", "migrate", "existing", "viewli...
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NavigationAndHistory/main.js#L320-L343
2,143
adobe/brackets
src/extensions/default/NavigationAndHistory/main.js
_createMROFDisplayList
function _createMROFDisplayList(refresh) { var $def = $.Deferred(); var $mrofList, $link, $newItem; /** * Clears the MROF list in memory and pop over but retains the working set entries * @private */ function _purgeAllExceptWorkingSet() { ...
javascript
function _createMROFDisplayList(refresh) { var $def = $.Deferred(); var $mrofList, $link, $newItem; /** * Clears the MROF list in memory and pop over but retains the working set entries * @private */ function _purgeAllExceptWorkingSet() { ...
[ "function", "_createMROFDisplayList", "(", "refresh", ")", "{", "var", "$def", "=", "$", ".", "Deferred", "(", ")", ";", "var", "$mrofList", ",", "$link", ",", "$newItem", ";", "/**\n * Clears the MROF list in memory and pop over but retains the working set entrie...
Shows the current MROF list @private
[ "Shows", "the", "current", "MROF", "list" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NavigationAndHistory/main.js#L380-L455
2,144
adobe/brackets
src/extensions/default/NavigationAndHistory/main.js
_purgeAllExceptWorkingSet
function _purgeAllExceptWorkingSet() { _mrofList = _createMROFList(); $mrofList.empty(); _createMROFDisplayList(true); $currentContext = null; PreferencesManager.setViewState(OPEN_FILES_VIEW_STATE, _mrofList, _getPrefsContext(), true); }
javascript
function _purgeAllExceptWorkingSet() { _mrofList = _createMROFList(); $mrofList.empty(); _createMROFDisplayList(true); $currentContext = null; PreferencesManager.setViewState(OPEN_FILES_VIEW_STATE, _mrofList, _getPrefsContext(), true); }
[ "function", "_purgeAllExceptWorkingSet", "(", ")", "{", "_mrofList", "=", "_createMROFList", "(", ")", ";", "$mrofList", ".", "empty", "(", ")", ";", "_createMROFDisplayList", "(", "true", ")", ";", "$currentContext", "=", "null", ";", "PreferencesManager", ".",...
Clears the MROF list in memory and pop over but retains the working set entries @private
[ "Clears", "the", "MROF", "list", "in", "memory", "and", "pop", "over", "but", "retains", "the", "working", "set", "entries" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NavigationAndHistory/main.js#L389-L395
2,145
adobe/brackets
src/extensions/default/NavigationAndHistory/main.js
_onFocus
function _onFocus(event) { var $scope = $(event.target).parent(); $("#mrof-container #mrof-list > li.highlight").removeClass("highlight"); $(event.target).parent().addClass("highlight"); $mrofContainer.find("#recent-file-path").text($scope.data("path")); $mrof...
javascript
function _onFocus(event) { var $scope = $(event.target).parent(); $("#mrof-container #mrof-list > li.highlight").removeClass("highlight"); $(event.target).parent().addClass("highlight"); $mrofContainer.find("#recent-file-path").text($scope.data("path")); $mrof...
[ "function", "_onFocus", "(", "event", ")", "{", "var", "$scope", "=", "$", "(", "event", ".", "target", ")", ".", "parent", "(", ")", ";", "$", "(", "\"#mrof-container #mrof-list > li.highlight\"", ")", ".", "removeClass", "(", "\"highlight\"", ")", ";", "...
Focus handler for the link in list item @private
[ "Focus", "handler", "for", "the", "link", "in", "list", "item" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NavigationAndHistory/main.js#L414-L421
2,146
adobe/brackets
src/extensions/default/NavigationAndHistory/main.js
_onClick
function _onClick(event) { var $scope = $(event.delegateTarget).parent(); _openEditorForContext({ path: $scope.data("path"), paneId: $scope.data("paneId"), cursor: $scope.data("cursor"), hideOnOpenFile: true }); ...
javascript
function _onClick(event) { var $scope = $(event.delegateTarget).parent(); _openEditorForContext({ path: $scope.data("path"), paneId: $scope.data("paneId"), cursor: $scope.data("cursor"), hideOnOpenFile: true }); ...
[ "function", "_onClick", "(", "event", ")", "{", "var", "$scope", "=", "$", "(", "event", ".", "delegateTarget", ")", ".", "parent", "(", ")", ";", "_openEditorForContext", "(", "{", "path", ":", "$scope", ".", "data", "(", "\"path\"", ")", ",", "paneId...
Click handler for the link in list item @private
[ "Click", "handler", "for", "the", "link", "in", "list", "item" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NavigationAndHistory/main.js#L427-L435
2,147
adobe/brackets
src/extensions/default/NavigationAndHistory/main.js
_moveNext
function _moveNext() { var $context, $next; $context = $currentContext || $("#mrof-container #mrof-list > li.highlight"); if ($context.length > 0) { $next = $context.next(); if ($next.length === 0) { $next = $("#mrof-container #mrof-list > li").first(); ...
javascript
function _moveNext() { var $context, $next; $context = $currentContext || $("#mrof-container #mrof-list > li.highlight"); if ($context.length > 0) { $next = $context.next(); if ($next.length === 0) { $next = $("#mrof-container #mrof-list > li").first(); ...
[ "function", "_moveNext", "(", ")", "{", "var", "$context", ",", "$next", ";", "$context", "=", "$currentContext", "||", "$", "(", "\"#mrof-container #mrof-list > li.highlight\"", ")", ";", "if", "(", "$context", ".", "length", ">", "0", ")", "{", "$next", "=...
Opens the next item in MROF list if pop over is visible else displays the pop over @private
[ "Opens", "the", "next", "item", "in", "MROF", "list", "if", "pop", "over", "is", "visible", "else", "displays", "the", "pop", "over" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NavigationAndHistory/main.js#L479-L496
2,148
adobe/brackets
src/extensions/default/NavigationAndHistory/main.js
_movePrev
function _movePrev() { var $context, $prev; $context = $currentContext || $("#mrof-container #mrof-list > li.highlight"); if ($context.length > 0) { $prev = $context.prev(); if ($prev.length === 0) { $prev = $("#mrof-container #mrof-list > li").last(); ...
javascript
function _movePrev() { var $context, $prev; $context = $currentContext || $("#mrof-container #mrof-list > li.highlight"); if ($context.length > 0) { $prev = $context.prev(); if ($prev.length === 0) { $prev = $("#mrof-container #mrof-list > li").last(); ...
[ "function", "_movePrev", "(", ")", "{", "var", "$context", ",", "$prev", ";", "$context", "=", "$currentContext", "||", "$", "(", "\"#mrof-container #mrof-list > li.highlight\"", ")", ";", "if", "(", "$context", ".", "length", ">", "0", ")", "{", "$prev", "=...
Opens the previous item in MROF list if pop over is visible else displays the pop over @private
[ "Opens", "the", "previous", "item", "in", "MROF", "list", "if", "pop", "over", "is", "visible", "else", "displays", "the", "pop", "over" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NavigationAndHistory/main.js#L519-L536
2,149
adobe/brackets
src/extensions/default/NavigationAndHistory/main.js
_addToMROFList
function _addToMROFList(file, paneId, cursorPos) { var filePath = file.fullPath; if (!paneId) { // Don't handle this if not a full view/editor return; } // Check existing list for this doc path and pane entry var index = _.findIndex(_mrofList, function (re...
javascript
function _addToMROFList(file, paneId, cursorPos) { var filePath = file.fullPath; if (!paneId) { // Don't handle this if not a full view/editor return; } // Check existing list for this doc path and pane entry var index = _.findIndex(_mrofList, function (re...
[ "function", "_addToMROFList", "(", "file", ",", "paneId", ",", "cursorPos", ")", "{", "var", "filePath", "=", "file", ".", "fullPath", ";", "if", "(", "!", "paneId", ")", "{", "// Don't handle this if not a full view/editor", "return", ";", "}", "// Check existi...
Adds an entry to MROF list @private @param {Editor} editor - editor to extract file information
[ "Adds", "an", "entry", "to", "MROF", "list" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NavigationAndHistory/main.js#L579-L618
2,150
adobe/brackets
src/extensions/default/NavigationAndHistory/main.js
_handleWorkingSetMove
function _handleWorkingSetMove(event, file, sourcePaneId, destinationPaneId) { // Check existing list for this doc path and source pane entry var index = _.findIndex(_mrofList, function (record) { return (record && record.file === file.fullPath && record.paneId === sourcePaneId); }),...
javascript
function _handleWorkingSetMove(event, file, sourcePaneId, destinationPaneId) { // Check existing list for this doc path and source pane entry var index = _.findIndex(_mrofList, function (record) { return (record && record.file === file.fullPath && record.paneId === sourcePaneId); }),...
[ "function", "_handleWorkingSetMove", "(", "event", ",", "file", ",", "sourcePaneId", ",", "destinationPaneId", ")", "{", "// Check existing list for this doc path and source pane entry", "var", "index", "=", "_", ".", "findIndex", "(", "_mrofList", ",", "function", "(",...
To update existing entry if a move has happened
[ "To", "update", "existing", "entry", "if", "a", "move", "has", "happened" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NavigationAndHistory/main.js#L621-L639
2,151
adobe/brackets
src/extensions/default/NavigationAndHistory/main.js
_handlePaneMerge
function _handlePaneMerge(e, paneId) { var index; var targetPaneId = MainViewManager.FIRST_PANE; $.each(_mrofList, function (itrIndex, value) { if (value && value.paneId === paneId) { // We have got an entry which needs merge // Before modifying the actual pane info ...
javascript
function _handlePaneMerge(e, paneId) { var index; var targetPaneId = MainViewManager.FIRST_PANE; $.each(_mrofList, function (itrIndex, value) { if (value && value.paneId === paneId) { // We have got an entry which needs merge // Before modifying the actual pane info ...
[ "function", "_handlePaneMerge", "(", "e", ",", "paneId", ")", "{", "var", "index", ";", "var", "targetPaneId", "=", "MainViewManager", ".", "FIRST_PANE", ";", "$", ".", "each", "(", "_mrofList", ",", "function", "(", "itrIndex", ",", "value", ")", "{", "...
Merges the entries to a single pane if split view have been merged Then purges duplicate entries in mrof list
[ "Merges", "the", "entries", "to", "a", "single", "pane", "if", "split", "view", "have", "been", "merged", "Then", "purges", "duplicate", "entries", "in", "mrof", "list" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NavigationAndHistory/main.js#L701-L723
2,152
adobe/brackets
src/extensions/default/NavigationAndHistory/main.js
handleCurrentFileChange
function handleCurrentFileChange(e, newFile, newPaneId, oldFile) { if (newFile) { if (_mrofList.length === 0) { _initRecentFilesList(); } _addToMROFList(newFile, newPaneId); } }
javascript
function handleCurrentFileChange(e, newFile, newPaneId, oldFile) { if (newFile) { if (_mrofList.length === 0) { _initRecentFilesList(); } _addToMROFList(newFile, newPaneId); } }
[ "function", "handleCurrentFileChange", "(", "e", ",", "newFile", ",", "newPaneId", ",", "oldFile", ")", "{", "if", "(", "newFile", ")", "{", "if", "(", "_mrofList", ".", "length", "===", "0", ")", "{", "_initRecentFilesList", "(", ")", ";", "}", "_addToM...
Handle current file change
[ "Handle", "current", "file", "change" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NavigationAndHistory/main.js#L771-L779
2,153
adobe/brackets
src/extensions/default/NavigationAndHistory/main.js
_handleActiveEditorChange
function _handleActiveEditorChange(event, current, previous) { if (current) { // Handle only full editors if (_mrofList.length === 0) { _initRecentFilesList(); } var file = current.document.file; var paneId = current._paneId; _addToMRO...
javascript
function _handleActiveEditorChange(event, current, previous) { if (current) { // Handle only full editors if (_mrofList.length === 0) { _initRecentFilesList(); } var file = current.document.file; var paneId = current._paneId; _addToMRO...
[ "function", "_handleActiveEditorChange", "(", "event", ",", "current", ",", "previous", ")", "{", "if", "(", "current", ")", "{", "// Handle only full editors", "if", "(", "_mrofList", ".", "length", "===", "0", ")", "{", "_initRecentFilesList", "(", ")", ";",...
Handle Active Editor change to update mrof information
[ "Handle", "Active", "Editor", "change", "to", "update", "mrof", "information" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/NavigationAndHistory/main.js#L782-L796
2,154
adobe/brackets
src/extensions/default/JavaScriptRefactoring/ExtractToFunction.js
handleExtractToFunction
function handleExtractToFunction() { var editor = EditorManager.getActiveEditor(); var result = new $.Deferred(); // used only for testing purpose if (editor.getSelections().length > 1) { editor.displayErrorMessageAtCursor(Strings.ERROR_EXTRACTTO_FUNCTION_MULTICURSORS); ...
javascript
function handleExtractToFunction() { var editor = EditorManager.getActiveEditor(); var result = new $.Deferred(); // used only for testing purpose if (editor.getSelections().length > 1) { editor.displayErrorMessageAtCursor(Strings.ERROR_EXTRACTTO_FUNCTION_MULTICURSORS); ...
[ "function", "handleExtractToFunction", "(", ")", "{", "var", "editor", "=", "EditorManager", ".", "getActiveEditor", "(", ")", ";", "var", "result", "=", "new", "$", ".", "Deferred", "(", ")", ";", "// used only for testing purpose", "if", "(", "editor", ".", ...
Main function that handles extract to function
[ "Main", "function", "that", "handles", "extract", "to", "function" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/JavaScriptRefactoring/ExtractToFunction.js#L265-L328
2,155
adobe/brackets
src/JSUtils/ScopeManager.js
initTernEnv
function initTernEnv() { var path = [_absoluteModulePath, "node/node_modules/tern/defs/"].join("/"), files = builtinFiles, library; files.forEach(function (i) { FileSystem.resolve(path + i, function (err, file) { if (!err) { FileUt...
javascript
function initTernEnv() { var path = [_absoluteModulePath, "node/node_modules/tern/defs/"].join("/"), files = builtinFiles, library; files.forEach(function (i) { FileSystem.resolve(path + i, function (err, file) { if (!err) { FileUt...
[ "function", "initTernEnv", "(", ")", "{", "var", "path", "=", "[", "_absoluteModulePath", ",", "\"node/node_modules/tern/defs/\"", "]", ".", "join", "(", "\"/\"", ")", ",", "files", "=", "builtinFiles", ",", "library", ";", "files", ".", "forEach", "(", "fun...
Read in the json files that have type information for the builtins, dom,etc
[ "Read", "in", "the", "json", "files", "that", "have", "type", "information", "for", "the", "builtins", "dom", "etc" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L93-L113
2,156
adobe/brackets
src/JSUtils/ScopeManager.js
initPreferences
function initPreferences(projectRootPath) { // Reject the old preferences if they have not completed. if (deferredPreferences && deferredPreferences.state() === "pending") { deferredPreferences.reject(); } deferredPreferences = $.Deferred(); var pr = ProjectManager....
javascript
function initPreferences(projectRootPath) { // Reject the old preferences if they have not completed. if (deferredPreferences && deferredPreferences.state() === "pending") { deferredPreferences.reject(); } deferredPreferences = $.Deferred(); var pr = ProjectManager....
[ "function", "initPreferences", "(", "projectRootPath", ")", "{", "// Reject the old preferences if they have not completed.", "if", "(", "deferredPreferences", "&&", "deferredPreferences", ".", "state", "(", ")", "===", "\"pending\"", ")", "{", "deferredPreferences", ".", ...
Init preferences from a file in the project root or builtin defaults if no file is found; @param {string=} projectRootPath - new project root path. Only needed for unit tests.
[ "Init", "preferences", "from", "a", "file", "in", "the", "project", "root", "or", "builtin", "defaults", "if", "no", "file", "is", "found", ";" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L124-L170
2,157
adobe/brackets
src/JSUtils/ScopeManager.js
isDirectoryExcluded
function isDirectoryExcluded(path) { var excludes = preferences.getExcludedDirectories(); if (!excludes) { return false; } var testPath = ProjectManager.makeProjectRelativeIfPossible(path); testPath = FileUtils.stripTrailingSlash(testPath); return excludes....
javascript
function isDirectoryExcluded(path) { var excludes = preferences.getExcludedDirectories(); if (!excludes) { return false; } var testPath = ProjectManager.makeProjectRelativeIfPossible(path); testPath = FileUtils.stripTrailingSlash(testPath); return excludes....
[ "function", "isDirectoryExcluded", "(", "path", ")", "{", "var", "excludes", "=", "preferences", ".", "getExcludedDirectories", "(", ")", ";", "if", "(", "!", "excludes", ")", "{", "return", "false", ";", "}", "var", "testPath", "=", "ProjectManager", ".", ...
Test if the directory should be excluded from analysis. @param {!string} path - full directory path. @return {boolean} true if excluded, false otherwise.
[ "Test", "if", "the", "directory", "should", "be", "excluded", "from", "analysis", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L198-L209
2,158
adobe/brackets
src/JSUtils/ScopeManager.js
isFileBeingEdited
function isFileBeingEdited(filePath) { var currentEditor = EditorManager.getActiveEditor(), currentDoc = currentEditor && currentEditor.document; return (currentDoc && currentDoc.file.fullPath === filePath); }
javascript
function isFileBeingEdited(filePath) { var currentEditor = EditorManager.getActiveEditor(), currentDoc = currentEditor && currentEditor.document; return (currentDoc && currentDoc.file.fullPath === filePath); }
[ "function", "isFileBeingEdited", "(", "filePath", ")", "{", "var", "currentEditor", "=", "EditorManager", ".", "getActiveEditor", "(", ")", ",", "currentDoc", "=", "currentEditor", "&&", "currentEditor", ".", "document", ";", "return", "(", "currentDoc", "&&", "...
Test if the file path is in current editor @param {string} filePath file path to test for exclusion. @return {boolean} true if in editor, false otherwise.
[ "Test", "if", "the", "file", "path", "is", "in", "current", "editor" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L217-L222
2,159
adobe/brackets
src/JSUtils/ScopeManager.js
isFileExcludedInternal
function isFileExcludedInternal(path) { // The detectedExclusions are files detected to be troublesome with current versions of Tern. // detectedExclusions is an array of full paths. var detectedExclusions = PreferencesManager.get("jscodehints.detectedExclusions") || []; if (detectedExcl...
javascript
function isFileExcludedInternal(path) { // The detectedExclusions are files detected to be troublesome with current versions of Tern. // detectedExclusions is an array of full paths. var detectedExclusions = PreferencesManager.get("jscodehints.detectedExclusions") || []; if (detectedExcl...
[ "function", "isFileExcludedInternal", "(", "path", ")", "{", "// The detectedExclusions are files detected to be troublesome with current versions of Tern.", "// detectedExclusions is an array of full paths.", "var", "detectedExclusions", "=", "PreferencesManager", ".", "get", "(", "\"...
Test if the file path is an internal exclusion. @param {string} path file path to test for exclusion. @return {boolean} true if excluded, false otherwise.
[ "Test", "if", "the", "file", "path", "is", "an", "internal", "exclusion", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L230-L239
2,160
adobe/brackets
src/JSUtils/ScopeManager.js
isFileExcluded
function isFileExcluded(file) { if (file.name[0] === ".") { return true; } var languageID = LanguageManager.getLanguageForPath(file.fullPath).getId(); if (languageID !== HintUtils.LANGUAGE_ID) { return true; } var excludes = preferences.getExclud...
javascript
function isFileExcluded(file) { if (file.name[0] === ".") { return true; } var languageID = LanguageManager.getLanguageForPath(file.fullPath).getId(); if (languageID !== HintUtils.LANGUAGE_ID) { return true; } var excludes = preferences.getExclud...
[ "function", "isFileExcluded", "(", "file", ")", "{", "if", "(", "file", ".", "name", "[", "0", "]", "===", "\".\"", ")", "{", "return", "true", ";", "}", "var", "languageID", "=", "LanguageManager", ".", "getLanguageForPath", "(", "file", ".", "fullPath"...
Test if the file should be excluded from analysis. @param {!File} file - file to test for exclusion. @return {boolean} true if excluded, false otherwise.
[ "Test", "if", "the", "file", "should", "be", "excluded", "from", "analysis", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L247-L267
2,161
adobe/brackets
src/JSUtils/ScopeManager.js
addPendingRequest
function addPendingRequest(file, offset, type) { var requests, key = file + "@" + offset.line + "@" + offset.ch, $deferredRequest; // Reject detected exclusions if (isFileExcludedInternal(file)) { return (new $.Deferred()).reject().promise(); } ...
javascript
function addPendingRequest(file, offset, type) { var requests, key = file + "@" + offset.line + "@" + offset.ch, $deferredRequest; // Reject detected exclusions if (isFileExcludedInternal(file)) { return (new $.Deferred()).reject().promise(); } ...
[ "function", "addPendingRequest", "(", "file", ",", "offset", ",", "type", ")", "{", "var", "requests", ",", "key", "=", "file", "+", "\"@\"", "+", "offset", ".", "line", "+", "\"@\"", "+", "offset", ".", "ch", ",", "$deferredRequest", ";", "// Reject det...
Add a pending request waiting for the tern-module to complete. If file is a detected exclusion, then reject request. @param {string} file - the name of the file @param {{line: number, ch: number}} offset - the offset into the file the request is for @param {string} type - the type of request @return {jQuery.Promise} -...
[ "Add", "a", "pending", "request", "waiting", "for", "the", "tern", "-", "module", "to", "complete", ".", "If", "file", "is", "a", "detected", "exclusion", "then", "reject", "request", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L278-L301
2,162
adobe/brackets
src/JSUtils/ScopeManager.js
getJumptoDef
function getJumptoDef(fileInfo, offset) { postMessage({ type: MessageIds.TERN_JUMPTODEF_MSG, fileInfo: fileInfo, offset: offset }); return addPendingRequest(fileInfo.name, offset, MessageIds.TERN_JUMPTODEF_MSG); }
javascript
function getJumptoDef(fileInfo, offset) { postMessage({ type: MessageIds.TERN_JUMPTODEF_MSG, fileInfo: fileInfo, offset: offset }); return addPendingRequest(fileInfo.name, offset, MessageIds.TERN_JUMPTODEF_MSG); }
[ "function", "getJumptoDef", "(", "fileInfo", ",", "offset", ")", "{", "postMessage", "(", "{", "type", ":", "MessageIds", ".", "TERN_JUMPTODEF_MSG", ",", "fileInfo", ":", "fileInfo", ",", "offset", ":", "offset", "}", ")", ";", "return", "addPendingRequest", ...
Get a Promise for the definition from TernJS, for the file & offset passed in. @param {{type: string, name: string, offsetLines: number, text: string}} fileInfo - type of update, name of file, and the text of the update. For "full" updates, the whole text of the file is present. For "part" updates, the changed portion ...
[ "Get", "a", "Promise", "for", "the", "definition", "from", "TernJS", "for", "the", "file", "&", "offset", "passed", "in", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L345-L353
2,163
adobe/brackets
src/JSUtils/ScopeManager.js
filterText
function filterText(text) { var newText = text; if (text.length > preferences.getMaxFileSize()) { newText = ""; } return newText; }
javascript
function filterText(text) { var newText = text; if (text.length > preferences.getMaxFileSize()) { newText = ""; } return newText; }
[ "function", "filterText", "(", "text", ")", "{", "var", "newText", "=", "text", ";", "if", "(", "text", ".", "length", ">", "preferences", ".", "getMaxFileSize", "(", ")", ")", "{", "newText", "=", "\"\"", ";", "}", "return", "newText", ";", "}" ]
check to see if the text we are sending to Tern is too long. @param {string} the text to check @return {string} the text, or the empty text if the original was too long
[ "check", "to", "see", "if", "the", "text", "we", "are", "sending", "to", "Tern", "is", "too", "long", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L360-L366
2,164
adobe/brackets
src/JSUtils/ScopeManager.js
handleRename
function handleRename(response) { if (response.error) { EditorManager.getActiveEditor().displayErrorMessageAtCursor(response.error); return; } var file = response.file, offset = response.offset; var $deferredFindRefs = getPendingRequest(file, offset...
javascript
function handleRename(response) { if (response.error) { EditorManager.getActiveEditor().displayErrorMessageAtCursor(response.error); return; } var file = response.file, offset = response.offset; var $deferredFindRefs = getPendingRequest(file, offset...
[ "function", "handleRename", "(", "response", ")", "{", "if", "(", "response", ".", "error", ")", "{", "EditorManager", ".", "getActiveEditor", "(", ")", ".", "displayErrorMessageAtCursor", "(", "response", ".", "error", ")", ";", "return", ";", "}", "var", ...
Handle the response from the tern node domain when it responds with the references @param response - the response from the node domain
[ "Handle", "the", "response", "from", "the", "tern", "node", "domain", "when", "it", "responds", "with", "the", "references" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L386-L401
2,165
adobe/brackets
src/JSUtils/ScopeManager.js
requestJumptoDef
function requestJumptoDef(session, document, offset) { var path = document.file.fullPath, fileInfo = { type: MessageIds.TERN_FILE_INFO_TYPE_FULL, name: path, offsetLines: 0, text: filterText(session.getJavascriptText()) }...
javascript
function requestJumptoDef(session, document, offset) { var path = document.file.fullPath, fileInfo = { type: MessageIds.TERN_FILE_INFO_TYPE_FULL, name: path, offsetLines: 0, text: filterText(session.getJavascriptText()) }...
[ "function", "requestJumptoDef", "(", "session", ",", "document", ",", "offset", ")", "{", "var", "path", "=", "document", ".", "file", ".", "fullPath", ",", "fileInfo", "=", "{", "type", ":", "MessageIds", ".", "TERN_FILE_INFO_TYPE_FULL", ",", "name", ":", ...
Request Jump-To-Definition from Tern. @param {session} session - the session @param {Document} document - the document @param {{line: number, ch: number}} offset - the offset into the document @return {jQuery.Promise} - The promise will not complete until tern has completed.
[ "Request", "Jump", "-", "To", "-", "Definition", "from", "Tern", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L412-L424
2,166
adobe/brackets
src/JSUtils/ScopeManager.js
handleJumptoDef
function handleJumptoDef(response) { var file = response.file, offset = response.offset; var $deferredJump = getPendingRequest(file, offset, MessageIds.TERN_JUMPTODEF_MSG); if ($deferredJump) { response.fullPath = getResolvedPath(response.resultFile); $defe...
javascript
function handleJumptoDef(response) { var file = response.file, offset = response.offset; var $deferredJump = getPendingRequest(file, offset, MessageIds.TERN_JUMPTODEF_MSG); if ($deferredJump) { response.fullPath = getResolvedPath(response.resultFile); $defe...
[ "function", "handleJumptoDef", "(", "response", ")", "{", "var", "file", "=", "response", ".", "file", ",", "offset", "=", "response", ".", "offset", ";", "var", "$deferredJump", "=", "getPendingRequest", "(", "file", ",", "offset", ",", "MessageIds", ".", ...
Handle the response from the tern node domain when it responds with the definition @param response - the response from the node domain
[ "Handle", "the", "response", "from", "the", "tern", "node", "domain", "when", "it", "responds", "with", "the", "definition" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L432-L443
2,167
adobe/brackets
src/JSUtils/ScopeManager.js
handleScopeData
function handleScopeData(response) { var file = response.file, offset = response.offset; var $deferredJump = getPendingRequest(file, offset, MessageIds.TERN_SCOPEDATA_MSG); if ($deferredJump) { $deferredJump.resolveWith(null, [response]); } }
javascript
function handleScopeData(response) { var file = response.file, offset = response.offset; var $deferredJump = getPendingRequest(file, offset, MessageIds.TERN_SCOPEDATA_MSG); if ($deferredJump) { $deferredJump.resolveWith(null, [response]); } }
[ "function", "handleScopeData", "(", "response", ")", "{", "var", "file", "=", "response", ".", "file", ",", "offset", "=", "response", ".", "offset", ";", "var", "$deferredJump", "=", "getPendingRequest", "(", "file", ",", "offset", ",", "MessageIds", ".", ...
Handle the response from the tern node domain when it responds with the scope data @param response - the response from the node domain
[ "Handle", "the", "response", "from", "the", "tern", "node", "domain", "when", "it", "responds", "with", "the", "scope", "data" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L451-L460
2,168
adobe/brackets
src/JSUtils/ScopeManager.js
getTernHints
function getTernHints(fileInfo, offset, isProperty) { /** * If the document is large and we have modified a small portions of it that * we are asking hints for, then send a partial document. */ postMessage({ type: MessageIds.TERN_COMPLETIONS_MSG, fil...
javascript
function getTernHints(fileInfo, offset, isProperty) { /** * If the document is large and we have modified a small portions of it that * we are asking hints for, then send a partial document. */ postMessage({ type: MessageIds.TERN_COMPLETIONS_MSG, fil...
[ "function", "getTernHints", "(", "fileInfo", ",", "offset", ",", "isProperty", ")", "{", "/**\n * If the document is large and we have modified a small portions of it that\n * we are asking hints for, then send a partial document.\n */", "postMessage", "(", "{", ...
Get a Promise for the completions from TernJS, for the file & offset passed in. @param {{type: string, name: string, offsetLines: number, text: string}} fileInfo - type of update, name of file, and the text of the update. For "full" updates, the whole text of the file is present. For "part" updates, the changed portio...
[ "Get", "a", "Promise", "for", "the", "completions", "from", "TernJS", "for", "the", "file", "&", "offset", "passed", "in", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L476-L490
2,169
adobe/brackets
src/JSUtils/ScopeManager.js
getTernFunctionType
function getTernFunctionType(fileInfo, offset) { postMessage({ type: MessageIds.TERN_CALLED_FUNC_TYPE_MSG, fileInfo: fileInfo, offset: offset }); return addPendingRequest(fileInfo.name, offset, MessageIds.TERN_CALLED_FUNC_TYPE_MSG); }
javascript
function getTernFunctionType(fileInfo, offset) { postMessage({ type: MessageIds.TERN_CALLED_FUNC_TYPE_MSG, fileInfo: fileInfo, offset: offset }); return addPendingRequest(fileInfo.name, offset, MessageIds.TERN_CALLED_FUNC_TYPE_MSG); }
[ "function", "getTernFunctionType", "(", "fileInfo", ",", "offset", ")", "{", "postMessage", "(", "{", "type", ":", "MessageIds", ".", "TERN_CALLED_FUNC_TYPE_MSG", ",", "fileInfo", ":", "fileInfo", ",", "offset", ":", "offset", "}", ")", ";", "return", "addPend...
Get a Promise for the function type from TernJS. @param {{type: string, name: string, offsetLines: number, text: string}} fileInfo - type of update, name of file, and the text of the update. For "full" updates, the whole text of the file is present. For "part" updates, the changed portion of the text. For "empty" updat...
[ "Get", "a", "Promise", "for", "the", "function", "type", "from", "TernJS", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L502-L510
2,170
adobe/brackets
src/JSUtils/ScopeManager.js
getFragmentAround
function getFragmentAround(session, start) { var minIndent = null, minLine = null, endLine, cm = session.editor._codeMirror, tabSize = cm.getOption("tabSize"), document = session.editor.document, p, min, ...
javascript
function getFragmentAround(session, start) { var minIndent = null, minLine = null, endLine, cm = session.editor._codeMirror, tabSize = cm.getOption("tabSize"), document = session.editor.document, p, min, ...
[ "function", "getFragmentAround", "(", "session", ",", "start", ")", "{", "var", "minIndent", "=", "null", ",", "minLine", "=", "null", ",", "endLine", ",", "cm", "=", "session", ".", "editor", ".", "_codeMirror", ",", "tabSize", "=", "cm", ".", "getOptio...
Given a starting and ending position, get a code fragment that is self contained enough to be compiled. @param {!Session} session - the current session @param {{line: number, ch: number}} start - the starting position of the changes @return {{type: string, name: string, offsetLines: number, text: string}}
[ "Given", "a", "starting", "and", "ending", "position", "get", "a", "code", "fragment", "that", "is", "self", "contained", "enough", "to", "be", "compiled", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L521-L579
2,171
adobe/brackets
src/JSUtils/ScopeManager.js
getFileInfo
function getFileInfo(session, preventPartialUpdates) { var start = session.getCursor(), end = start, document = session.editor.document, path = document.file.fullPath, isHtmlFile = LanguageManager.getLanguageForPath(path).getId() === "html", result; ...
javascript
function getFileInfo(session, preventPartialUpdates) { var start = session.getCursor(), end = start, document = session.editor.document, path = document.file.fullPath, isHtmlFile = LanguageManager.getLanguageForPath(path).getId() === "html", result; ...
[ "function", "getFileInfo", "(", "session", ",", "preventPartialUpdates", ")", "{", "var", "start", "=", "session", ".", "getCursor", "(", ")", ",", "end", "=", "start", ",", "document", "=", "session", ".", "editor", ".", "document", ",", "path", "=", "d...
Get an object that describes what tern needs to know about the updated file to produce a hint. As a side-effect of this calls the document changes are reset. @param {!Session} session - the current session @param {boolean=} preventPartialUpdates - if true, disallow partial updates. Optional, defaults to false. @return...
[ "Get", "an", "object", "that", "describes", "what", "tern", "needs", "to", "know", "about", "the", "updated", "file", "to", "produce", "a", "hint", ".", "As", "a", "side", "-", "effect", "of", "this", "calls", "the", "document", "changes", "are", "reset"...
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L592-L621
2,172
adobe/brackets
src/JSUtils/ScopeManager.js
getOffset
function getOffset(session, fileInfo, offset) { var newOffset; if (offset) { newOffset = {line: offset.line, ch: offset.ch}; } else { newOffset = session.getCursor(); } if (fileInfo.type === MessageIds.TERN_FILE_INFO_TYPE_PART) { newOffset.li...
javascript
function getOffset(session, fileInfo, offset) { var newOffset; if (offset) { newOffset = {line: offset.line, ch: offset.ch}; } else { newOffset = session.getCursor(); } if (fileInfo.type === MessageIds.TERN_FILE_INFO_TYPE_PART) { newOffset.li...
[ "function", "getOffset", "(", "session", ",", "fileInfo", ",", "offset", ")", "{", "var", "newOffset", ";", "if", "(", "offset", ")", "{", "newOffset", "=", "{", "line", ":", "offset", ".", "line", ",", "ch", ":", "offset", ".", "ch", "}", ";", "}"...
Get the current offset. The offset is adjusted for "part" updates. @param {!Session} session - the current session @param {{type: string, name: string, offsetLines: number, text: string}} fileInfo - type of update, name of file, and the text of the update. For "full" updates, the whole text of the file is present. For...
[ "Get", "the", "current", "offset", ".", "The", "offset", "is", "adjusted", "for", "part", "updates", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L636-L650
2,173
adobe/brackets
src/JSUtils/ScopeManager.js
requestGuesses
function requestGuesses(session, document) { var $deferred = $.Deferred(), fileInfo = getFileInfo(session), offset = getOffset(session, fileInfo); postMessage({ type: MessageIds.TERN_GET_GUESSES_MSG, fileInfo: fileInfo, offset: offset ...
javascript
function requestGuesses(session, document) { var $deferred = $.Deferred(), fileInfo = getFileInfo(session), offset = getOffset(session, fileInfo); postMessage({ type: MessageIds.TERN_GET_GUESSES_MSG, fileInfo: fileInfo, offset: offset ...
[ "function", "requestGuesses", "(", "session", ",", "document", ")", "{", "var", "$deferred", "=", "$", ".", "Deferred", "(", ")", ",", "fileInfo", "=", "getFileInfo", "(", "session", ")", ",", "offset", "=", "getOffset", "(", "session", ",", "fileInfo", ...
Get a Promise for all of the known properties from TernJS, for the directory and file. The properties will be used as guesses in tern. @param {Session} session - the active hinting session @param {Document} document - the document for which scope info is desired @return {jQuery.Promise} - The promise will not complete ...
[ "Get", "a", "Promise", "for", "all", "of", "the", "known", "properties", "from", "TernJS", "for", "the", "directory", "and", "file", ".", "The", "properties", "will", "be", "used", "as", "guesses", "in", "tern", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L661-L681
2,174
adobe/brackets
src/JSUtils/ScopeManager.js
handleTernCompletions
function handleTernCompletions(response) { var file = response.file, offset = response.offset, completions = response.completions, properties = response.properties, fnType = response.fnType, type = response.type, error = response.error, ...
javascript
function handleTernCompletions(response) { var file = response.file, offset = response.offset, completions = response.completions, properties = response.properties, fnType = response.fnType, type = response.type, error = response.error, ...
[ "function", "handleTernCompletions", "(", "response", ")", "{", "var", "file", "=", "response", ".", "file", ",", "offset", "=", "response", ".", "offset", ",", "completions", "=", "response", ".", "completions", ",", "properties", "=", "response", ".", "pro...
Handle the response from the tern node domain when it responds with the list of completions @param {{file: string, offset: {line: number, ch: number}, completions:Array.<string>, properties:Array.<string>}} response - the response from node domain
[ "Handle", "the", "response", "from", "the", "tern", "node", "domain", "when", "it", "responds", "with", "the", "list", "of", "completions" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L690-L712
2,175
adobe/brackets
src/JSUtils/ScopeManager.js
handleGetGuesses
function handleGetGuesses(response) { var path = response.file, type = response.type, offset = response.offset, $deferredHints = getPendingRequest(path, offset, type); if ($deferredHints) { $deferredHints.resolveWith(null, [response.properties]); ...
javascript
function handleGetGuesses(response) { var path = response.file, type = response.type, offset = response.offset, $deferredHints = getPendingRequest(path, offset, type); if ($deferredHints) { $deferredHints.resolveWith(null, [response.properties]); ...
[ "function", "handleGetGuesses", "(", "response", ")", "{", "var", "path", "=", "response", ".", "file", ",", "type", "=", "response", ".", "type", ",", "offset", "=", "response", ".", "offset", ",", "$deferredHints", "=", "getPendingRequest", "(", "path", ...
Handle the response from the tern node domain when it responds to the get guesses message. @param {{file: string, type: string, offset: {line: number, ch: number}, properties: Array.<string>}} response - the response from node domain contains the guesses for a property lookup.
[ "Handle", "the", "response", "from", "the", "tern", "node", "domain", "when", "it", "responds", "to", "the", "get", "guesses", "message", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L723-L732
2,176
adobe/brackets
src/JSUtils/ScopeManager.js
handleUpdateFile
function handleUpdateFile(response) { var path = response.path, type = response.type, $deferredHints = getPendingRequest(path, OFFSET_ZERO, type); if ($deferredHints) { $deferredHints.resolve(); } }
javascript
function handleUpdateFile(response) { var path = response.path, type = response.type, $deferredHints = getPendingRequest(path, OFFSET_ZERO, type); if ($deferredHints) { $deferredHints.resolve(); } }
[ "function", "handleUpdateFile", "(", "response", ")", "{", "var", "path", "=", "response", ".", "path", ",", "type", "=", "response", ".", "type", ",", "$deferredHints", "=", "getPendingRequest", "(", "path", ",", "OFFSET_ZERO", ",", "type", ")", ";", "if"...
Handle the response from the tern node domain when it responds to the update file message. @param {{path: string, type: string}} response - the response from node domain
[ "Handle", "the", "response", "from", "the", "tern", "node", "domain", "when", "it", "responds", "to", "the", "update", "file", "message", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L740-L749
2,177
adobe/brackets
src/JSUtils/ScopeManager.js
handleTimedOut
function handleTimedOut(response) { var detectedExclusions = PreferencesManager.get("jscodehints.detectedExclusions") || [], filePath = response.file; // Don't exclude the file currently being edited if (isFileBeingEdited(filePath)) { return; } ...
javascript
function handleTimedOut(response) { var detectedExclusions = PreferencesManager.get("jscodehints.detectedExclusions") || [], filePath = response.file; // Don't exclude the file currently being edited if (isFileBeingEdited(filePath)) { return; } ...
[ "function", "handleTimedOut", "(", "response", ")", "{", "var", "detectedExclusions", "=", "PreferencesManager", ".", "get", "(", "\"jscodehints.detectedExclusions\"", ")", "||", "[", "]", ",", "filePath", "=", "response", ".", "file", ";", "// Don't exclude the fil...
Handle timed out inference @param {{path: string, type: string}} response - the response from node domain
[ "Handle", "timed", "out", "inference" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L756-L792
2,178
adobe/brackets
src/JSUtils/ScopeManager.js
postMessage
function postMessage(msg) { addFilesPromise.done(function (ternModule) { // If an error came up during file handling, bail out now if (!_ternNodeDomain) { return; } if (config.debug) { console.debug("Sen...
javascript
function postMessage(msg) { addFilesPromise.done(function (ternModule) { // If an error came up during file handling, bail out now if (!_ternNodeDomain) { return; } if (config.debug) { console.debug("Sen...
[ "function", "postMessage", "(", "msg", ")", "{", "addFilesPromise", ".", "done", "(", "function", "(", "ternModule", ")", "{", "// If an error came up during file handling, bail out now", "if", "(", "!", "_ternNodeDomain", ")", "{", "return", ";", "}", "if", "(", ...
Send a message to the tern node domain - if the module is being initialized, the message will not be posted until initialization is complete
[ "Send", "a", "message", "to", "the", "tern", "node", "domain", "-", "if", "the", "module", "is", "being", "initialized", "the", "message", "will", "not", "be", "posted", "until", "initialization", "is", "complete" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L852-L864
2,179
adobe/brackets
src/JSUtils/ScopeManager.js
_postMessageByPass
function _postMessageByPass(msg) { ternPromise.done(function (ternModule) { if (config.debug) { console.debug("Sending message", msg); } _ternNodeDomain.exec("invokeTernCommand", msg); }); }
javascript
function _postMessageByPass(msg) { ternPromise.done(function (ternModule) { if (config.debug) { console.debug("Sending message", msg); } _ternNodeDomain.exec("invokeTernCommand", msg); }); }
[ "function", "_postMessageByPass", "(", "msg", ")", "{", "ternPromise", ".", "done", "(", "function", "(", "ternModule", ")", "{", "if", "(", "config", ".", "debug", ")", "{", "console", ".", "debug", "(", "\"Sending message\"", ",", "msg", ")", ";", "}",...
Send a message to the tern node domain - this is only for messages that need to be sent before and while the addFilesPromise is being resolved.
[ "Send", "a", "message", "to", "the", "tern", "node", "domain", "-", "this", "is", "only", "for", "messages", "that", "need", "to", "be", "sent", "before", "and", "while", "the", "addFilesPromise", "is", "being", "resolved", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L870-L877
2,180
adobe/brackets
src/JSUtils/ScopeManager.js
updateTernFile
function updateTernFile(document) { var path = document.file.fullPath; _postMessageByPass({ type : MessageIds.TERN_UPDATE_FILE_MSG, path : path, text : getTextFromDocument(document) }); return addPending...
javascript
function updateTernFile(document) { var path = document.file.fullPath; _postMessageByPass({ type : MessageIds.TERN_UPDATE_FILE_MSG, path : path, text : getTextFromDocument(document) }); return addPending...
[ "function", "updateTernFile", "(", "document", ")", "{", "var", "path", "=", "document", ".", "file", ".", "fullPath", ";", "_postMessageByPass", "(", "{", "type", ":", "MessageIds", ".", "TERN_UPDATE_FILE_MSG", ",", "path", ":", "path", ",", "text", ":", ...
Update tern with the new contents of a given file. @param {Document} document - the document to update @return {jQuery.Promise} - the promise for the request
[ "Update", "tern", "with", "the", "new", "contents", "of", "a", "given", "file", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L885-L895
2,181
adobe/brackets
src/JSUtils/ScopeManager.js
handleTernGetFile
function handleTernGetFile(request) { function replyWith(name, txt) { _postMessageByPass({ type: MessageIds.TERN_GET_FILE_MSG, file: name, text: txt }); } var name = request.file; ...
javascript
function handleTernGetFile(request) { function replyWith(name, txt) { _postMessageByPass({ type: MessageIds.TERN_GET_FILE_MSG, file: name, text: txt }); } var name = request.file; ...
[ "function", "handleTernGetFile", "(", "request", ")", "{", "function", "replyWith", "(", "name", ",", "txt", ")", "{", "_postMessageByPass", "(", "{", "type", ":", "MessageIds", ".", "TERN_GET_FILE_MSG", ",", "file", ":", "name", ",", "text", ":", "txt", "...
Handle a request from the tern node domain for text of a file @param {{file:string}} request - the request from the tern node domain. Should be an Object containing the name of the file tern wants the contents of
[ "Handle", "a", "request", "from", "the", "tern", "node", "domain", "for", "text", "of", "a", "file" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L903-L985
2,182
adobe/brackets
src/JSUtils/ScopeManager.js
primePump
function primePump(path, isUntitledDoc) { _postMessageByPass({ type : MessageIds.TERN_PRIME_PUMP_MSG, path : path, isUntitledDoc : isUntitledDoc }); return addPendingRequest(path, OFFSET_ZERO, MessageIds.TERN_PR...
javascript
function primePump(path, isUntitledDoc) { _postMessageByPass({ type : MessageIds.TERN_PRIME_PUMP_MSG, path : path, isUntitledDoc : isUntitledDoc }); return addPendingRequest(path, OFFSET_ZERO, MessageIds.TERN_PR...
[ "function", "primePump", "(", "path", ",", "isUntitledDoc", ")", "{", "_postMessageByPass", "(", "{", "type", ":", "MessageIds", ".", "TERN_PRIME_PUMP_MSG", ",", "path", ":", "path", ",", "isUntitledDoc", ":", "isUntitledDoc", "}", ")", ";", "return", "addPend...
Prime the pump for a fast first lookup. @param {string} path - full path of file @return {jQuery.Promise} - the promise for the request
[ "Prime", "the", "pump", "for", "a", "fast", "first", "lookup", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L993-L1001
2,183
adobe/brackets
src/JSUtils/ScopeManager.js
handlePrimePumpCompletion
function handlePrimePumpCompletion(response) { var path = response.path, type = response.type, $deferredHints = getPendingRequest(path, OFFSET_ZERO, type); if ($deferredHints) { $deferredHints.resolve(); } }
javascript
function handlePrimePumpCompletion(response) { var path = response.path, type = response.type, $deferredHints = getPendingRequest(path, OFFSET_ZERO, type); if ($deferredHints) { $deferredHints.resolve(); } }
[ "function", "handlePrimePumpCompletion", "(", "response", ")", "{", "var", "path", "=", "response", ".", "path", ",", "type", "=", "response", ".", "type", ",", "$deferredHints", "=", "getPendingRequest", "(", "path", ",", "OFFSET_ZERO", ",", "type", ")", ";...
Handle the response from the tern node domain when it responds to the prime pump message. @param {{path: string, type: string}} response - the response from node domain
[ "Handle", "the", "response", "from", "the", "tern", "node", "domain", "when", "it", "responds", "to", "the", "prime", "pump", "message", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L1009-L1018
2,184
adobe/brackets
src/JSUtils/ScopeManager.js
addFilesToTern
function addFilesToTern(files) { // limit the number of files added to tern. var maxFileCount = preferences.getMaxFileCount(); if (numResolvedFiles + numAddedFiles < maxFileCount) { var available = maxFileCount - numResolvedFiles - numAddedFiles; if (...
javascript
function addFilesToTern(files) { // limit the number of files added to tern. var maxFileCount = preferences.getMaxFileCount(); if (numResolvedFiles + numAddedFiles < maxFileCount) { var available = maxFileCount - numResolvedFiles - numAddedFiles; if (...
[ "function", "addFilesToTern", "(", "files", ")", "{", "// limit the number of files added to tern.", "var", "maxFileCount", "=", "preferences", ".", "getMaxFileCount", "(", ")", ";", "if", "(", "numResolvedFiles", "+", "numAddedFiles", "<", "maxFileCount", ")", "{", ...
Add new files to tern, keeping any previous files. The tern server must be initialized before making this call. @param {Array.<string>} files - array of file to add to tern. @return {boolean} - true if more files may be added, false if maximum has been reached.
[ "Add", "new", "files", "to", "tern", "keeping", "any", "previous", "files", ".", "The", "tern", "server", "must", "be", "initialized", "before", "making", "this", "call", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L1028-L1056
2,185
adobe/brackets
src/JSUtils/ScopeManager.js
addAllFilesAndSubdirectories
function addAllFilesAndSubdirectories(dir, doneCallback) { FileSystem.resolve(dir, function (err, directory) { function visitor(entry) { if (entry.isFile) { if (!isFileExcluded(entry)) { // ignore .dotfiles and non-.js files ...
javascript
function addAllFilesAndSubdirectories(dir, doneCallback) { FileSystem.resolve(dir, function (err, directory) { function visitor(entry) { if (entry.isFile) { if (!isFileExcluded(entry)) { // ignore .dotfiles and non-.js files ...
[ "function", "addAllFilesAndSubdirectories", "(", "dir", ",", "doneCallback", ")", "{", "FileSystem", ".", "resolve", "(", "dir", ",", "function", "(", "err", ",", "directory", ")", "{", "function", "visitor", "(", "entry", ")", "{", "if", "(", "entry", "."...
Add the files in the directory and subdirectories of a given directory to tern. @param {string} dir - the root directory to add. @param {function ()} doneCallback - called when all files have been added to tern.
[ "Add", "the", "files", "in", "the", "directory", "and", "subdirectories", "of", "a", "given", "directory", "to", "tern", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L1066-L1091
2,186
adobe/brackets
src/JSUtils/ScopeManager.js
initTernModule
function initTernModule() { var moduleDeferred = $.Deferred(); ternPromise = moduleDeferred.promise(); function prepareTern() { _ternNodeDomain.exec("setInterface", { messageIds : MessageIds }); _tern...
javascript
function initTernModule() { var moduleDeferred = $.Deferred(); ternPromise = moduleDeferred.promise(); function prepareTern() { _ternNodeDomain.exec("setInterface", { messageIds : MessageIds }); _tern...
[ "function", "initTernModule", "(", ")", "{", "var", "moduleDeferred", "=", "$", ".", "Deferred", "(", ")", ";", "ternPromise", "=", "moduleDeferred", ".", "promise", "(", ")", ";", "function", "prepareTern", "(", ")", "{", "_ternNodeDomain", ".", "exec", "...
Init the Tern module that does all the code hinting work.
[ "Init", "the", "Tern", "module", "that", "does", "all", "the", "code", "hinting", "work", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L1096-L1163
2,187
adobe/brackets
src/JSUtils/ScopeManager.js
doEditorChange
function doEditorChange(session, document, previousDocument) { var file = document.file, path = file.fullPath, dir = file.parentPath, pr; var addFilesDeferred = $.Deferred(); documentChanges = null; a...
javascript
function doEditorChange(session, document, previousDocument) { var file = document.file, path = file.fullPath, dir = file.parentPath, pr; var addFilesDeferred = $.Deferred(); documentChanges = null; a...
[ "function", "doEditorChange", "(", "session", ",", "document", ",", "previousDocument", ")", "{", "var", "file", "=", "document", ".", "file", ",", "path", "=", "file", ".", "fullPath", ",", "dir", "=", "file", ".", "parentPath", ",", "pr", ";", "var", ...
Do the work to initialize a code hinting session. @param {Session} session - the active hinting session (TODO: currently unused) @param {!Document} document - the document the editor has changed to @param {?Document} previousDocument - the document the editor has changed from
[ "Do", "the", "work", "to", "initialize", "a", "code", "hinting", "session", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L1208-L1310
2,188
adobe/brackets
src/JSUtils/ScopeManager.js
resetModule
function resetModule() { function resetTernServer() { if (_ternNodeDomain.ready()) { _ternNodeDomain.exec('resetTernServer'); } } if (_ternNodeDomain) { if (addFilesPromise) { // If w...
javascript
function resetModule() { function resetTernServer() { if (_ternNodeDomain.ready()) { _ternNodeDomain.exec('resetTernServer'); } } if (_ternNodeDomain) { if (addFilesPromise) { // If w...
[ "function", "resetModule", "(", ")", "{", "function", "resetTernServer", "(", ")", "{", "if", "(", "_ternNodeDomain", ".", "ready", "(", ")", ")", "{", "_ternNodeDomain", ".", "exec", "(", "'resetTernServer'", ")", ";", "}", "}", "if", "(", "_ternNodeDomai...
Do some cleanup when a project is closed. We can clean up the node tern server we use to calculate hints now, since we know we will need to re-init it in any new project that is opened.
[ "Do", "some", "cleanup", "when", "a", "project", "is", "closed", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L1335-L1351
2,189
adobe/brackets
src/JSUtils/ScopeManager.js
_maybeReset
function _maybeReset(session, document, force) { var newTernModule; // if we're in the middle of a reset, don't have to check // the new module will be online soon if (!resettingDeferred) { // We don't reset if the debugging flag is set // because it's easier to ...
javascript
function _maybeReset(session, document, force) { var newTernModule; // if we're in the middle of a reset, don't have to check // the new module will be online soon if (!resettingDeferred) { // We don't reset if the debugging flag is set // because it's easier to ...
[ "function", "_maybeReset", "(", "session", ",", "document", ",", "force", ")", "{", "var", "newTernModule", ";", "// if we're in the middle of a reset, don't have to check", "// the new module will be online soon", "if", "(", "!", "resettingDeferred", ")", "{", "// We don't...
reset the tern module, if necessary. During debugging, you can turn this automatic resetting behavior off by running this in the console: brackets._configureJSCodeHints({ noReset: true }) This function is also used in unit testing with the "force" flag to reset the module for each test to start with a clean environme...
[ "reset", "the", "tern", "module", "if", "necessary", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L1384-L1418
2,190
adobe/brackets
src/JSUtils/ScopeManager.js
requestParameterHint
function requestParameterHint(session, functionOffset) { var $deferredHints = $.Deferred(), fileInfo = getFileInfo(session, true), offset = getOffset(session, fileInfo, functionOffset), fnTypePromise = getTernFunctionType(fileInfo, offset); $.when(fnTypePromise).done...
javascript
function requestParameterHint(session, functionOffset) { var $deferredHints = $.Deferred(), fileInfo = getFileInfo(session, true), offset = getOffset(session, fileInfo, functionOffset), fnTypePromise = getTernFunctionType(fileInfo, offset); $.when(fnTypePromise).done...
[ "function", "requestParameterHint", "(", "session", ",", "functionOffset", ")", "{", "var", "$deferredHints", "=", "$", ".", "Deferred", "(", ")", ",", "fileInfo", "=", "getFileInfo", "(", "session", ",", "true", ")", ",", "offset", "=", "getOffset", "(", ...
Request a parameter hint from Tern. @param {Session} session - the active hinting session @param {{line: number, ch: number}} functionOffset - the offset of the function call. @return {jQuery.Promise} - The promise will not complete until the hint has completed.
[ "Request", "a", "parameter", "hint", "from", "Tern", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L1428-L1445
2,191
adobe/brackets
src/JSUtils/ScopeManager.js
requestHints
function requestHints(session, document) { var $deferredHints = $.Deferred(), hintPromise, sessionType = session.getType(), fileInfo = getFileInfo(session), offset = getOffset(session, fileInfo, null); _maybeReset(session, document); hintPromise ...
javascript
function requestHints(session, document) { var $deferredHints = $.Deferred(), hintPromise, sessionType = session.getType(), fileInfo = getFileInfo(session), offset = getOffset(session, fileInfo, null); _maybeReset(session, document); hintPromise ...
[ "function", "requestHints", "(", "session", ",", "document", ")", "{", "var", "$deferredHints", "=", "$", ".", "Deferred", "(", ")", ",", "hintPromise", ",", "sessionType", "=", "session", ".", "getType", "(", ")", ",", "fileInfo", "=", "getFileInfo", "(",...
Request hints from Tern. Note that successive calls to getScope may return the same objects, so clients that wish to modify those objects (e.g., by annotating them based on some temporary context) should copy them first. See, e.g., Session.getHints(). @param {Session} session - the active hinting session @param {Docu...
[ "Request", "hints", "from", "Tern", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L1461-L1489
2,192
adobe/brackets
src/JSUtils/ScopeManager.js
trackChange
function trackChange(changeList) { var changed = documentChanges, i; if (changed === null) { documentChanges = changed = {from: changeList[0].from.line, to: changeList[0].from.line}; if (config.debug) { console.debug("ScopeManager: document has changed"); ...
javascript
function trackChange(changeList) { var changed = documentChanges, i; if (changed === null) { documentChanges = changed = {from: changeList[0].from.line, to: changeList[0].from.line}; if (config.debug) { console.debug("ScopeManager: document has changed"); ...
[ "function", "trackChange", "(", "changeList", ")", "{", "var", "changed", "=", "documentChanges", ",", "i", ";", "if", "(", "changed", "===", "null", ")", "{", "documentChanges", "=", "changed", "=", "{", "from", ":", "changeList", "[", "0", "]", ".", ...
Track the update area of the current document so we can tell if we can send partial updates to tern or not. @param {Array.<{from: {line:number, ch: number}, to: {line:number, ch: number}, text: Array<string>}>} changeList - the document changes from the current change event
[ "Track", "the", "update", "area", "of", "the", "current", "document", "so", "we", "can", "tell", "if", "we", "can", "send", "partial", "updates", "to", "tern", "or", "not", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/ScopeManager.js#L1498-L1522
2,193
adobe/brackets
src/extensibility/node/ExtensionManagerDomain.js
_removeFailedInstallation
function _removeFailedInstallation(installDirectory) { fs.remove(installDirectory, function (err) { if (err) { console.error("Error while removing directory after failed installation", installDirectory, err); } }); }
javascript
function _removeFailedInstallation(installDirectory) { fs.remove(installDirectory, function (err) { if (err) { console.error("Error while removing directory after failed installation", installDirectory, err); } }); }
[ "function", "_removeFailedInstallation", "(", "installDirectory", ")", "{", "fs", ".", "remove", "(", "installDirectory", ",", "function", "(", "err", ")", "{", "if", "(", "err", ")", "{", "console", ".", "error", "(", "\"Error while removing directory after faile...
Private function to remove the installation directory if the installation fails. This does not call any callbacks. It's assumed that the callback has already been called and this cleanup routine will do its best to complete in the background. If there's a problem here, it is simply logged with console.error. @param {s...
[ "Private", "function", "to", "remove", "the", "installation", "directory", "if", "the", "installation", "fails", ".", "This", "does", "not", "call", "any", "callbacks", ".", "It", "s", "assumed", "that", "the", "callback", "has", "already", "been", "called", ...
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/node/ExtensionManagerDomain.js#L74-L80
2,194
adobe/brackets
src/extensibility/node/ExtensionManagerDomain.js
_performInstall
function _performInstall(packagePath, installDirectory, validationResult, callback) { validationResult.installedTo = installDirectory; function fail(err) { _removeFailedInstallation(installDirectory); callback(err, null); } function finish() { // The status may have already bee...
javascript
function _performInstall(packagePath, installDirectory, validationResult, callback) { validationResult.installedTo = installDirectory; function fail(err) { _removeFailedInstallation(installDirectory); callback(err, null); } function finish() { // The status may have already bee...
[ "function", "_performInstall", "(", "packagePath", ",", "installDirectory", ",", "validationResult", ",", "callback", ")", "{", "validationResult", ".", "installedTo", "=", "installDirectory", ";", "function", "fail", "(", "err", ")", "{", "_removeFailedInstallation",...
Private function to unzip to the correct directory. @param {string} Absolute path to the package zip file @param {string} Absolute path to the destination directory for unzipping @param {Object} the return value with the useful information for the client @param {Function} callback function that is called at the end of...
[ "Private", "function", "to", "unzip", "to", "the", "correct", "directory", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/node/ExtensionManagerDomain.js#L90-L121
2,195
adobe/brackets
src/extensibility/node/ExtensionManagerDomain.js
_removeAndInstall
function _removeAndInstall(packagePath, installDirectory, validationResult, callback) { // If this extension was previously installed but disabled, we will overwrite the // previous installation in that directory. fs.remove(installDirectory, function (err) { if (err) { callback(err); ...
javascript
function _removeAndInstall(packagePath, installDirectory, validationResult, callback) { // If this extension was previously installed but disabled, we will overwrite the // previous installation in that directory. fs.remove(installDirectory, function (err) { if (err) { callback(err); ...
[ "function", "_removeAndInstall", "(", "packagePath", ",", "installDirectory", ",", "validationResult", ",", "callback", ")", "{", "// If this extension was previously installed but disabled, we will overwrite the", "// previous installation in that directory.", "fs", ".", "remove", ...
Private function to remove the target directory and then install. @param {string} Absolute path to the package zip file @param {string} Absolute path to the destination directory for unzipping @param {Object} the return value with the useful information for the client @param {Function} callback function that is called...
[ "Private", "function", "to", "remove", "the", "target", "directory", "and", "then", "install", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/node/ExtensionManagerDomain.js#L131-L141
2,196
adobe/brackets
src/extensibility/node/ExtensionManagerDomain.js
legacyPackageCheck
function legacyPackageCheck(legacyDirectory) { return fs.existsSync(legacyDirectory) && !fs.existsSync(path.join(legacyDirectory, "package.json")); }
javascript
function legacyPackageCheck(legacyDirectory) { return fs.existsSync(legacyDirectory) && !fs.existsSync(path.join(legacyDirectory, "package.json")); }
[ "function", "legacyPackageCheck", "(", "legacyDirectory", ")", "{", "return", "fs", ".", "existsSync", "(", "legacyDirectory", ")", "&&", "!", "fs", ".", "existsSync", "(", "path", ".", "join", "(", "legacyDirectory", ",", "\"package.json\"", ")", ")", ";", ...
A "legacy package" is an extension that was installed based on the GitHub name without a package.json file. Checking for the presence of these legacy extensions will help users upgrade if the extension developer puts a different name in package.json than the name of the GitHub project. @param {string} legacyDirectory ...
[ "A", "legacy", "package", "is", "an", "extension", "that", "was", "installed", "based", "on", "the", "GitHub", "name", "without", "a", "package", ".", "json", "file", ".", "Checking", "for", "the", "presence", "of", "these", "legacy", "extensions", "will", ...
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/node/ExtensionManagerDomain.js#L185-L187
2,197
adobe/brackets
src/extensibility/node/ExtensionManagerDomain.js
_cmdInstall
function _cmdInstall(packagePath, destinationDirectory, options, callback, pCallback, _doUpdate) { if (!options || !options.disabledDirectory || !options.apiVersion || !options.systemExtensionDirectory) { callback(new Error(Errors.MISSING_REQUIRED_OPTIONS), null); return; } function validat...
javascript
function _cmdInstall(packagePath, destinationDirectory, options, callback, pCallback, _doUpdate) { if (!options || !options.disabledDirectory || !options.apiVersion || !options.systemExtensionDirectory) { callback(new Error(Errors.MISSING_REQUIRED_OPTIONS), null); return; } function validat...
[ "function", "_cmdInstall", "(", "packagePath", ",", "destinationDirectory", ",", "options", ",", "callback", ",", "pCallback", ",", "_doUpdate", ")", "{", "if", "(", "!", "options", "||", "!", "options", ".", "disabledDirectory", "||", "!", "options", ".", "...
Implements the "install" command in the "extensions" domain. There is no need to call validate independently. Validation is the first thing that is done here. After the extension is validated, it is installed in destinationDirectory unless the extension is already present there. If it is already present, a determinat...
[ "Implements", "the", "install", "command", "in", "the", "extensions", "domain", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/node/ExtensionManagerDomain.js#L217-L313
2,198
adobe/brackets
src/extensibility/node/ExtensionManagerDomain.js
deleteTempAndCallback
function deleteTempAndCallback(err) { if (validationResult.extractDir) { fs.remove(validationResult.extractDir); delete validationResult.extractDir; } callback(err, validationResult); }
javascript
function deleteTempAndCallback(err) { if (validationResult.extractDir) { fs.remove(validationResult.extractDir); delete validationResult.extractDir; } callback(err, validationResult); }
[ "function", "deleteTempAndCallback", "(", "err", ")", "{", "if", "(", "validationResult", ".", "extractDir", ")", "{", "fs", ".", "remove", "(", "validationResult", ".", "extractDir", ")", ";", "delete", "validationResult", ".", "extractDir", ";", "}", "callba...
This is a wrapper for the callback that will delete the temporary directory to which the package was unzipped.
[ "This", "is", "a", "wrapper", "for", "the", "callback", "that", "will", "delete", "the", "temporary", "directory", "to", "which", "the", "package", "was", "unzipped", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/node/ExtensionManagerDomain.js#L228-L234
2,199
adobe/brackets
src/extensibility/node/ExtensionManagerDomain.js
_cmdUpdate
function _cmdUpdate(packagePath, destinationDirectory, options, callback, pCallback) { _cmdInstall(packagePath, destinationDirectory, options, callback, pCallback, true); }
javascript
function _cmdUpdate(packagePath, destinationDirectory, options, callback, pCallback) { _cmdInstall(packagePath, destinationDirectory, options, callback, pCallback, true); }
[ "function", "_cmdUpdate", "(", "packagePath", ",", "destinationDirectory", ",", "options", ",", "callback", ",", "pCallback", ")", "{", "_cmdInstall", "(", "packagePath", ",", "destinationDirectory", ",", "options", ",", "callback", ",", "pCallback", ",", "true", ...
Implements the "update" command in the "extensions" domain. Currently, this just wraps _cmdInstall, but will remove the existing directory first. There is no need to call validate independently. Validation is the first thing that is done here. After the extension is validated, it is installed in destinationDirectory...
[ "Implements", "the", "update", "command", "in", "the", "extensions", "domain", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/node/ExtensionManagerDomain.js#L345-L347