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,200
adobe/brackets
src/extensibility/node/ExtensionManagerDomain.js
_cmdDownloadFile
function _cmdDownloadFile(downloadId, url, proxy, callback, pCallback) { // Backwards compatibility check, added in 0.37 if (typeof proxy === "function") { callback = proxy; proxy = undefined; } if (pendingDownloads[downloadId]) { callback(Errors.DOWNLOAD_ID_IN_USE, null); ...
javascript
function _cmdDownloadFile(downloadId, url, proxy, callback, pCallback) { // Backwards compatibility check, added in 0.37 if (typeof proxy === "function") { callback = proxy; proxy = undefined; } if (pendingDownloads[downloadId]) { callback(Errors.DOWNLOAD_ID_IN_USE, null); ...
[ "function", "_cmdDownloadFile", "(", "downloadId", ",", "url", ",", "proxy", ",", "callback", ",", "pCallback", ")", "{", "// Backwards compatibility check, added in 0.37", "if", "(", "typeof", "proxy", "===", "\"function\"", ")", "{", "callback", "=", "proxy", ";...
Implements "downloadFile" command, asynchronously.
[ "Implements", "downloadFile", "command", "asynchronously", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/node/ExtensionManagerDomain.js#L386-L429
2,201
adobe/brackets
src/extensibility/node/ExtensionManagerDomain.js
_cmdAbortDownload
function _cmdAbortDownload(downloadId) { if (!pendingDownloads[downloadId]) { // This may mean the download already completed return false; } else { _endDownload(downloadId, Errors.CANCELED); return true; } }
javascript
function _cmdAbortDownload(downloadId) { if (!pendingDownloads[downloadId]) { // This may mean the download already completed return false; } else { _endDownload(downloadId, Errors.CANCELED); return true; } }
[ "function", "_cmdAbortDownload", "(", "downloadId", ")", "{", "if", "(", "!", "pendingDownloads", "[", "downloadId", "]", ")", "{", "// This may mean the download already completed", "return", "false", ";", "}", "else", "{", "_endDownload", "(", "downloadId", ",", ...
Implements "abortDownload" command, synchronously.
[ "Implements", "abortDownload", "command", "synchronously", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/node/ExtensionManagerDomain.js#L434-L442
2,202
adobe/brackets
src/extensibility/node/ExtensionManagerDomain.js
_cmdRemove
function _cmdRemove(extensionDir, callback, pCallback) { fs.remove(extensionDir, function (err) { if (err) { callback(err); } else { callback(null); } }); }
javascript
function _cmdRemove(extensionDir, callback, pCallback) { fs.remove(extensionDir, function (err) { if (err) { callback(err); } else { callback(null); } }); }
[ "function", "_cmdRemove", "(", "extensionDir", ",", "callback", ",", "pCallback", ")", "{", "fs", ".", "remove", "(", "extensionDir", ",", "function", "(", "err", ")", "{", "if", "(", "err", ")", "{", "callback", "(", "err", ")", ";", "}", "else", "{...
Implements the remove extension command.
[ "Implements", "the", "remove", "extension", "command", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/node/ExtensionManagerDomain.js#L447-L455
2,203
adobe/brackets
src/filesystem/FileSystem.js
registerProtocolAdapter
function registerProtocolAdapter(protocol, adapter) { var adapters; if (protocol) { adapters = _fileProtocolPlugins[protocol] || []; adapters.push(adapter); // We will keep a sorted adapter list on 'priority' // If priority is not provided a default of '0...
javascript
function registerProtocolAdapter(protocol, adapter) { var adapters; if (protocol) { adapters = _fileProtocolPlugins[protocol] || []; adapters.push(adapter); // We will keep a sorted adapter list on 'priority' // If priority is not provided a default of '0...
[ "function", "registerProtocolAdapter", "(", "protocol", ",", "adapter", ")", "{", "var", "adapters", ";", "if", "(", "protocol", ")", "{", "adapters", "=", "_fileProtocolPlugins", "[", "protocol", "]", "||", "[", "]", ";", "adapters", ".", "push", "(", "ad...
Typical signature of a file protocol adapter. @typedef {Object} FileProtocol~Adapter @property {Number} priority - Indicates the priority. @property {Object} fileImpl - Handle for the custom file implementation prototype. @property {function} canRead - To check if this impl can read a file for a given path. FileSyste...
[ "Typical", "signature", "of", "a", "file", "protocol", "adapter", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/filesystem/FileSystem.js#L118-L132
2,204
adobe/brackets
src/extensibility/ExtensionManager.js
downloadRegistry
function downloadRegistry() { if (pendingDownloadRegistry) { return pendingDownloadRegistry.promise(); } pendingDownloadRegistry = new $.Deferred(); $.ajax({ url: brackets.config.extension_registry, dataType: "json", cache: false ...
javascript
function downloadRegistry() { if (pendingDownloadRegistry) { return pendingDownloadRegistry.promise(); } pendingDownloadRegistry = new $.Deferred(); $.ajax({ url: brackets.config.extension_registry, dataType: "json", cache: false ...
[ "function", "downloadRegistry", "(", ")", "{", "if", "(", "pendingDownloadRegistry", ")", "{", "return", "pendingDownloadRegistry", ".", "promise", "(", ")", ";", "}", "pendingDownloadRegistry", "=", "new", "$", ".", "Deferred", "(", ")", ";", "$", ".", "aja...
Downloads the registry of Brackets extensions and stores the information in our extension info. @return {$.Promise} a promise that's resolved with the registry JSON data or rejected if the server can't be reached.
[ "Downloads", "the", "registry", "of", "Brackets", "extensions", "and", "stores", "the", "information", "in", "our", "extension", "info", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/ExtensionManager.js#L205-L238
2,205
adobe/brackets
src/extensibility/ExtensionManager.js
getCompatibilityInfo
function getCompatibilityInfo(entry, apiVersion) { if (!entry.versions) { var fallback = getCompatibilityInfoForVersion(entry.metadata, apiVersion); if (fallback.isCompatible) { fallback.isLatestVersion = true; } return fallback; } ...
javascript
function getCompatibilityInfo(entry, apiVersion) { if (!entry.versions) { var fallback = getCompatibilityInfoForVersion(entry.metadata, apiVersion); if (fallback.isCompatible) { fallback.isLatestVersion = true; } return fallback; } ...
[ "function", "getCompatibilityInfo", "(", "entry", ",", "apiVersion", ")", "{", "if", "(", "!", "entry", ".", "versions", ")", "{", "var", "fallback", "=", "getCompatibilityInfoForVersion", "(", "entry", ".", "metadata", ",", "apiVersion", ")", ";", "if", "("...
Finds the newest version of the entry that is compatible with the given Brackets API version, if any. @param {Object} entry The registry entry to check. @param {string} apiVersion The Brackets API version to check against. @return {{isCompatible: boolean, requiresNewer: ?boolean, compatibleVersion: ?string, isLatestVer...
[ "Finds", "the", "newest", "version", "of", "the", "entry", "that", "is", "compatible", "with", "the", "given", "Brackets", "API", "version", "if", "any", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/ExtensionManager.js#L348-L377
2,206
adobe/brackets
src/extensibility/ExtensionManager.js
getExtensionURL
function getExtensionURL(id, version) { return StringUtils.format(brackets.config.extension_url, id, version); }
javascript
function getExtensionURL(id, version) { return StringUtils.format(brackets.config.extension_url, id, version); }
[ "function", "getExtensionURL", "(", "id", ",", "version", ")", "{", "return", "StringUtils", ".", "format", "(", "brackets", ".", "config", ".", "extension_url", ",", "id", ",", "version", ")", ";", "}" ]
Given an extension id and version number, returns the URL for downloading that extension from the repository. Does not guarantee that the extension exists at that URL. @param {string} id The extension's name from the metadata. @param {string} version The version to download. @return {string} The URL to download the ext...
[ "Given", "an", "extension", "id", "and", "version", "number", "returns", "the", "URL", "for", "downloading", "that", "extension", "from", "the", "repository", ".", "Does", "not", "guarantee", "that", "the", "extension", "exists", "at", "that", "URL", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/ExtensionManager.js#L386-L388
2,207
adobe/brackets
src/extensibility/ExtensionManager.js
remove
function remove(id) { var result = new $.Deferred(); if (extensions[id] && extensions[id].installInfo) { Package.remove(extensions[id].installInfo.path) .done(function () { extensions[id].installInfo = null; result.resolve(); ...
javascript
function remove(id) { var result = new $.Deferred(); if (extensions[id] && extensions[id].installInfo) { Package.remove(extensions[id].installInfo.path) .done(function () { extensions[id].installInfo = null; result.resolve(); ...
[ "function", "remove", "(", "id", ")", "{", "var", "result", "=", "new", "$", ".", "Deferred", "(", ")", ";", "if", "(", "extensions", "[", "id", "]", "&&", "extensions", "[", "id", "]", ".", "installInfo", ")", "{", "Package", ".", "remove", "(", ...
Removes the installed extension with the given id. @param {string} id The id of the extension to remove. @return {$.Promise} A promise that's resolved when the extension is removed or rejected with an error if there's a problem with the removal.
[ "Removes", "the", "installed", "extension", "with", "the", "given", "id", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/ExtensionManager.js#L396-L412
2,208
adobe/brackets
src/extensibility/ExtensionManager.js
update
function update(id, packagePath, keepFile) { return Package.installUpdate(packagePath, id).done(function () { if (!keepFile) { FileSystem.getFileForPath(packagePath).unlink(); } }); }
javascript
function update(id, packagePath, keepFile) { return Package.installUpdate(packagePath, id).done(function () { if (!keepFile) { FileSystem.getFileForPath(packagePath).unlink(); } }); }
[ "function", "update", "(", "id", ",", "packagePath", ",", "keepFile", ")", "{", "return", "Package", ".", "installUpdate", "(", "packagePath", ",", "id", ")", ".", "done", "(", "function", "(", ")", "{", "if", "(", "!", "keepFile", ")", "{", "FileSyste...
Updates an installed extension with the given package file. @param {string} id of the extension @param {string} packagePath path to the package file @param {boolean=} keepFile Flag to keep extension package file, default=false @return {$.Promise} A promise that's resolved when the extension is updated or rejected with ...
[ "Updates", "an", "installed", "extension", "with", "the", "given", "package", "file", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/ExtensionManager.js#L474-L480
2,209
adobe/brackets
src/extensibility/ExtensionManager.js
cleanupUpdates
function cleanupUpdates() { Object.keys(_idsToUpdate).forEach(function (id) { var installResult = _idsToUpdate[id], keepFile = installResult.keepFile, filename = installResult.localPath; if (filename && !keepFile) { FileSystem.getFileForPa...
javascript
function cleanupUpdates() { Object.keys(_idsToUpdate).forEach(function (id) { var installResult = _idsToUpdate[id], keepFile = installResult.keepFile, filename = installResult.localPath; if (filename && !keepFile) { FileSystem.getFileForPa...
[ "function", "cleanupUpdates", "(", ")", "{", "Object", ".", "keys", "(", "_idsToUpdate", ")", ".", "forEach", "(", "function", "(", "id", ")", "{", "var", "installResult", "=", "_idsToUpdate", "[", "id", "]", ",", "keepFile", "=", "installResult", ".", "...
Deletes any temporary files left behind by extensions that were marked for update.
[ "Deletes", "any", "temporary", "files", "left", "behind", "by", "extensions", "that", "were", "marked", "for", "update", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/ExtensionManager.js#L486-L497
2,210
adobe/brackets
src/extensibility/ExtensionManager.js
markForRemoval
function markForRemoval(id, mark) { if (mark) { _idsToRemove[id] = true; } else { delete _idsToRemove[id]; } exports.trigger("statusChange", id); }
javascript
function markForRemoval(id, mark) { if (mark) { _idsToRemove[id] = true; } else { delete _idsToRemove[id]; } exports.trigger("statusChange", id); }
[ "function", "markForRemoval", "(", "id", ",", "mark", ")", "{", "if", "(", "mark", ")", "{", "_idsToRemove", "[", "id", "]", "=", "true", ";", "}", "else", "{", "delete", "_idsToRemove", "[", "id", "]", ";", "}", "exports", ".", "trigger", "(", "\"...
Marks an extension for later removal, or unmarks an extension previously marked. @param {string} id The id of the extension to mark for removal. @param {boolean} mark Whether to mark or unmark it.
[ "Marks", "an", "extension", "for", "later", "removal", "or", "unmarks", "an", "extension", "previously", "marked", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/ExtensionManager.js#L511-L518
2,211
adobe/brackets
src/extensibility/ExtensionManager.js
markForDisabling
function markForDisabling(id, mark) { if (mark) { _idsToDisable[id] = true; } else { delete _idsToDisable[id]; } exports.trigger("statusChange", id); }
javascript
function markForDisabling(id, mark) { if (mark) { _idsToDisable[id] = true; } else { delete _idsToDisable[id]; } exports.trigger("statusChange", id); }
[ "function", "markForDisabling", "(", "id", ",", "mark", ")", "{", "if", "(", "mark", ")", "{", "_idsToDisable", "[", "id", "]", "=", "true", ";", "}", "else", "{", "delete", "_idsToDisable", "[", "id", "]", ";", "}", "exports", ".", "trigger", "(", ...
Marks an extension for disabling later, or unmarks an extension previously marked. @param {string} id The id of the extension @param {boolean} mark Whether to mark or unmark the extension.
[ "Marks", "an", "extension", "for", "disabling", "later", "or", "unmarks", "an", "extension", "previously", "marked", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/ExtensionManager.js#L543-L550
2,212
adobe/brackets
src/extensibility/ExtensionManager.js
updateFromDownload
function updateFromDownload(installationResult) { if (installationResult.keepFile === undefined) { installationResult.keepFile = false; } var installationStatus = installationResult.installationStatus; if (installationStatus === Package.InstallationStatuses.ALREADY_INSTALLED...
javascript
function updateFromDownload(installationResult) { if (installationResult.keepFile === undefined) { installationResult.keepFile = false; } var installationStatus = installationResult.installationStatus; if (installationStatus === Package.InstallationStatuses.ALREADY_INSTALLED...
[ "function", "updateFromDownload", "(", "installationResult", ")", "{", "if", "(", "installationResult", ".", "keepFile", "===", "undefined", ")", "{", "installationResult", ".", "keepFile", "=", "false", ";", "}", "var", "installationStatus", "=", "installationResul...
If a downloaded package appears to be an update, mark the extension for update. If an extension was previously marked for removal, marking for update will turn off the removal mark. @param {Object} installationResult info about the install provided by the Package.download function
[ "If", "a", "downloaded", "package", "appears", "to", "be", "an", "update", "mark", "the", "extension", "for", "update", ".", "If", "an", "extension", "was", "previously", "marked", "for", "removal", "marking", "for", "update", "will", "turn", "off", "the", ...
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/ExtensionManager.js#L583-L598
2,213
adobe/brackets
src/extensibility/ExtensionManager.js
removeUpdate
function removeUpdate(id) { var installationResult = _idsToUpdate[id]; if (!installationResult) { return; } if (installationResult.localPath && !installationResult.keepFile) { FileSystem.getFileForPath(installationResult.localPath).unlink(); } dele...
javascript
function removeUpdate(id) { var installationResult = _idsToUpdate[id]; if (!installationResult) { return; } if (installationResult.localPath && !installationResult.keepFile) { FileSystem.getFileForPath(installationResult.localPath).unlink(); } dele...
[ "function", "removeUpdate", "(", "id", ")", "{", "var", "installationResult", "=", "_idsToUpdate", "[", "id", "]", ";", "if", "(", "!", "installationResult", ")", "{", "return", ";", "}", "if", "(", "installationResult", ".", "localPath", "&&", "!", "insta...
Removes the mark for an extension to be updated on restart. Also deletes the downloaded package file. @param {string} id The id of the extension for which the update is being removed
[ "Removes", "the", "mark", "for", "an", "extension", "to", "be", "updated", "on", "restart", ".", "Also", "deletes", "the", "downloaded", "package", "file", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/ExtensionManager.js#L605-L615
2,214
adobe/brackets
src/extensibility/ExtensionManager.js
updateExtensions
function updateExtensions() { return Async.doInParallel_aggregateErrors( Object.keys(_idsToUpdate), function (id) { var installationResult = _idsToUpdate[id]; return update(installationResult.name, installationResult.localPath, installationResult.keepFile)...
javascript
function updateExtensions() { return Async.doInParallel_aggregateErrors( Object.keys(_idsToUpdate), function (id) { var installationResult = _idsToUpdate[id]; return update(installationResult.name, installationResult.localPath, installationResult.keepFile)...
[ "function", "updateExtensions", "(", ")", "{", "return", "Async", ".", "doInParallel_aggregateErrors", "(", "Object", ".", "keys", "(", "_idsToUpdate", ")", ",", "function", "(", "id", ")", "{", "var", "installationResult", "=", "_idsToUpdate", "[", "id", "]",...
Updates extensions previously marked for update. @return {$.Promise} A promise that's resolved when all extensions are updated, or rejected if one or more extensions can't be updated. When rejected, the argument will be an array of error objects, each of which contains an "item" property with the id of the failed exten...
[ "Updates", "extensions", "previously", "marked", "for", "update", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/ExtensionManager.js#L676-L684
2,215
adobe/brackets
src/extensibility/ExtensionManager.js
getAvailableUpdates
function getAvailableUpdates() { var result = []; Object.keys(extensions).forEach(function (extensionId) { var extensionInfo = extensions[extensionId]; // skip extensions that are not installed or are not in the registry if (!extensionInfo.installInfo || !extensionInf...
javascript
function getAvailableUpdates() { var result = []; Object.keys(extensions).forEach(function (extensionId) { var extensionInfo = extensions[extensionId]; // skip extensions that are not installed or are not in the registry if (!extensionInfo.installInfo || !extensionInf...
[ "function", "getAvailableUpdates", "(", ")", "{", "var", "result", "=", "[", "]", ";", "Object", ".", "keys", "(", "extensions", ")", ".", "forEach", "(", "function", "(", "extensionId", ")", "{", "var", "extensionInfo", "=", "extensions", "[", "extensionI...
Gets an array of extensions that are currently installed and can be updated to a new version @return {Array.<{id: string, installVersion: string, registryVersion: string}>} where id = extensionId installVersion = currently installed version of extension registryVersion = latest version compatible with current Brackets
[ "Gets", "an", "array", "of", "extensions", "that", "are", "currently", "installed", "and", "can", "be", "updated", "to", "a", "new", "version" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/ExtensionManager.js#L693-L710
2,216
adobe/brackets
src/extensions/default/JavaScriptRefactoring/ExtractToVariable.js
extract
function extract(scopes, parentStatement, expns, text, insertPosition) { var varType = "var", varName = RefactoringUtils.getUniqueIdentifierName(scopes, "extracted"), varDeclaration = varType + " " + varName + " = " + text + ";\n", parentStatementStartPos ...
javascript
function extract(scopes, parentStatement, expns, text, insertPosition) { var varType = "var", varName = RefactoringUtils.getUniqueIdentifierName(scopes, "extracted"), varDeclaration = varType + " " + varName + " = " + text + ";\n", parentStatementStartPos ...
[ "function", "extract", "(", "scopes", ",", "parentStatement", ",", "expns", ",", "text", ",", "insertPosition", ")", "{", "var", "varType", "=", "\"var\"", ",", "varName", "=", "RefactoringUtils", ".", "getUniqueIdentifierName", "(", "scopes", ",", "\"extracted\...
Does the actual extraction. i.e Replacing the text, Creating a variable and multi select variable names
[ "Does", "the", "actual", "extraction", ".", "i", ".", "e", "Replacing", "the", "text", "Creating", "a", "variable", "and", "multi", "select", "variable", "names" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/JavaScriptRefactoring/ExtractToVariable.js#L40-L97
2,217
adobe/brackets
src/extensions/default/JavaScriptRefactoring/ExtractToVariable.js
findAllExpressions
function findAllExpressions(parentBlockStatement, expn, text) { var doc = session.editor.document, obj = {}, expns = []; // find all references of the expression obj[expn.type] = function(node) { if (text === doc.getText().substr(node.start, node.end - no...
javascript
function findAllExpressions(parentBlockStatement, expn, text) { var doc = session.editor.document, obj = {}, expns = []; // find all references of the expression obj[expn.type] = function(node) { if (text === doc.getText().substr(node.start, node.end - no...
[ "function", "findAllExpressions", "(", "parentBlockStatement", ",", "expn", ",", "text", ")", "{", "var", "doc", "=", "session", ".", "editor", ".", "document", ",", "obj", "=", "{", "}", ",", "expns", "=", "[", "]", ";", "// find all references of the expre...
Find all expressions in the parentBlockStatement that are same as expn @param {!ASTNode} parentBlockStatement @param {!ASTNode} expn @param {!string} text - text of the expression @return {!Array.<ASTNode>}
[ "Find", "all", "expressions", "in", "the", "parentBlockStatement", "that", "are", "same", "as", "expn" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/JavaScriptRefactoring/ExtractToVariable.js#L106-L120
2,218
adobe/brackets
src/extensions/default/JavaScriptRefactoring/ExtractToVariable.js
getExpressions
function getExpressions(ast, start, end) { var expns = [], s = start, e = end, expn; while (true) { expn = RefactoringUtils.findSurroundExpression(ast, {start: s, end: e}); if (!expn) { break; } ...
javascript
function getExpressions(ast, start, end) { var expns = [], s = start, e = end, expn; while (true) { expn = RefactoringUtils.findSurroundExpression(ast, {start: s, end: e}); if (!expn) { break; } ...
[ "function", "getExpressions", "(", "ast", ",", "start", ",", "end", ")", "{", "var", "expns", "=", "[", "]", ",", "s", "=", "start", ",", "e", "=", "end", ",", "expn", ";", "while", "(", "true", ")", "{", "expn", "=", "RefactoringUtils", ".", "fi...
Gets the surrounding expressions of start and end offset @param {!ASTNode} ast - the ast of the complete file @param {!number} start - the start offset @param {!number} end - the end offset @return {!Array.<ASTNode>}
[ "Gets", "the", "surrounding", "expressions", "of", "start", "and", "end", "offset" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/JavaScriptRefactoring/ExtractToVariable.js#L129-L167
2,219
adobe/brackets
src/command/Menus.js
removeMenuItemEventListeners
function removeMenuItemEventListeners(menuItem) { menuItem._command .off("enabledStateChange", menuItem._enabledChanged) .off("checkedStateChange", menuItem._checkedChanged) .off("nameChange", menuItem._nameChanged) .off("keyBindingAdded", menuItem._keyBindingAdde...
javascript
function removeMenuItemEventListeners(menuItem) { menuItem._command .off("enabledStateChange", menuItem._enabledChanged) .off("checkedStateChange", menuItem._checkedChanged) .off("nameChange", menuItem._nameChanged) .off("keyBindingAdded", menuItem._keyBindingAdde...
[ "function", "removeMenuItemEventListeners", "(", "menuItem", ")", "{", "menuItem", ".", "_command", ".", "off", "(", "\"enabledStateChange\"", ",", "menuItem", ".", "_enabledChanged", ")", ".", "off", "(", "\"checkedStateChange\"", ",", "menuItem", ".", "_checkedCha...
Removes the attached event listeners from the corresponding object. @param {ManuItem} menuItem
[ "Removes", "the", "attached", "event", "listeners", "from", "the", "corresponding", "object", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/command/Menus.js#L186-L193
2,220
adobe/brackets
src/command/Menus.js
_insertInList
function _insertInList($list, $element, position, $relativeElement) { // Determine where to insert. Default is LAST. var inserted = false; if (position) { // Adjust relative position for menu section positions since $relativeElement // has already been resolved by _getRe...
javascript
function _insertInList($list, $element, position, $relativeElement) { // Determine where to insert. Default is LAST. var inserted = false; if (position) { // Adjust relative position for menu section positions since $relativeElement // has already been resolved by _getRe...
[ "function", "_insertInList", "(", "$list", ",", "$element", ",", "position", ",", "$relativeElement", ")", "{", "// Determine where to insert. Default is LAST.", "var", "inserted", "=", "false", ";", "if", "(", "position", ")", "{", "// Adjust relative position for menu...
Help function for inserting elements into a list
[ "Help", "function", "for", "inserting", "elements", "into", "a", "list" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/command/Menus.js#L256-L287
2,221
adobe/brackets
src/command/Menus.js
MenuItem
function MenuItem(id, command) { this.id = id; this.isDivider = (command === DIVIDER); this.isNative = false; if (!this.isDivider && command !== SUBMENU) { // Bind event handlers this._enabledChanged = this._enabledChanged.bind(this); this._checkedCha...
javascript
function MenuItem(id, command) { this.id = id; this.isDivider = (command === DIVIDER); this.isNative = false; if (!this.isDivider && command !== SUBMENU) { // Bind event handlers this._enabledChanged = this._enabledChanged.bind(this); this._checkedCha...
[ "function", "MenuItem", "(", "id", ",", "command", ")", "{", "this", ".", "id", "=", "id", ";", "this", ".", "isDivider", "=", "(", "command", "===", "DIVIDER", ")", ";", "this", ".", "isNative", "=", "false", ";", "if", "(", "!", "this", ".", "i...
MenuItem represents a single menu item that executes a Command or a menu divider. MenuItems may have a sub-menu. A MenuItem may correspond to an HTML-based menu item or a native menu item if Brackets is running in a native application shell Since MenuItems may have a native implementation clients should create MenuIte...
[ "MenuItem", "represents", "a", "single", "menu", "item", "that", "executes", "a", "Command", "or", "a", "menu", "divider", ".", "MenuItems", "may", "have", "a", "sub", "-", "menu", ".", "A", "MenuItem", "may", "correspond", "to", "an", "HTML", "-", "base...
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/command/Menus.js#L309-L330
2,222
adobe/brackets
src/command/Menus.js
addMenu
function addMenu(name, id, position, relativeID) { name = _.escape(name); var $menubar = $("#titlebar .nav"), menu; if (!name || !id) { console.error("call to addMenu() is missing required parameters"); return null; } // Guard against duplica...
javascript
function addMenu(name, id, position, relativeID) { name = _.escape(name); var $menubar = $("#titlebar .nav"), menu; if (!name || !id) { console.error("call to addMenu() is missing required parameters"); return null; } // Guard against duplica...
[ "function", "addMenu", "(", "name", ",", "id", ",", "position", ",", "relativeID", ")", "{", "name", "=", "_", ".", "escape", "(", "name", ")", ";", "var", "$menubar", "=", "$", "(", "\"#titlebar .nav\"", ")", ",", "menu", ";", "if", "(", "!", "nam...
Adds a top-level menu to the application menu bar which may be native or HTML-based. @param {!string} name - display text for menu @param {!string} id - unique identifier for a menu. Core Menus in Brackets use a simple title as an id, for example "file-menu". Extensions should use the following format: "author.myexte...
[ "Adds", "a", "top", "-", "level", "menu", "to", "the", "application", "menu", "bar", "which", "may", "be", "native", "or", "HTML", "-", "based", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/command/Menus.js#L1044-L1104
2,223
adobe/brackets
src/command/Menus.js
removeMenu
function removeMenu(id) { var menu, commandID = ""; if (!id) { console.error("removeMenu(): missing required parameter: id"); return; } if (!menuMap[id]) { console.error("removeMenu(): menu id not found: %s", id); return; ...
javascript
function removeMenu(id) { var menu, commandID = ""; if (!id) { console.error("removeMenu(): missing required parameter: id"); return; } if (!menuMap[id]) { console.error("removeMenu(): menu id not found: %s", id); return; ...
[ "function", "removeMenu", "(", "id", ")", "{", "var", "menu", ",", "commandID", "=", "\"\"", ";", "if", "(", "!", "id", ")", "{", "console", ".", "error", "(", "\"removeMenu(): missing required parameter: id\"", ")", ";", "return", ";", "}", "if", "(", "...
Removes a top-level menu from the application menu bar which may be native or HTML-based. @param {!string} id - unique identifier for a menu. Core Menus in Brackets use a simple title as an id, for example "file-menu". Extensions should use the following format: "author.myextension.mymenuname".
[ "Removes", "a", "top", "-", "level", "menu", "from", "the", "application", "menu", "bar", "which", "may", "be", "native", "or", "HTML", "-", "based", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/command/Menus.js#L1113-L1152
2,224
adobe/brackets
src/command/Menus.js
ContextMenu
function ContextMenu(id) { Menu.apply(this, arguments); var $newMenu = $("<li class='dropdown context-menu' id='" + StringUtils.jQueryIdEscape(id) + "'></li>"), $popUp = $("<ul class='dropdown-menu'></ul>"), $toggle = $("<a href='#' class='dropdown-toggle' data-toggle='dropdown'...
javascript
function ContextMenu(id) { Menu.apply(this, arguments); var $newMenu = $("<li class='dropdown context-menu' id='" + StringUtils.jQueryIdEscape(id) + "'></li>"), $popUp = $("<ul class='dropdown-menu'></ul>"), $toggle = $("<a href='#' class='dropdown-toggle' data-toggle='dropdown'...
[ "function", "ContextMenu", "(", "id", ")", "{", "Menu", ".", "apply", "(", "this", ",", "arguments", ")", ";", "var", "$newMenu", "=", "$", "(", "\"<li class='dropdown context-menu' id='\"", "+", "StringUtils", ".", "jQueryIdEscape", "(", "id", ")", "+", "\"...
Represents a context menu that can open at a specific location in the UI. Clients should not create this object directly and should instead use registerContextMenu() to create new ContextMenu objects. Context menus in brackets may be HTML-based or native so clients should not reach into the HTML and should instead ma...
[ "Represents", "a", "context", "menu", "that", "can", "open", "at", "a", "specific", "location", "in", "the", "UI", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/command/Menus.js#L1170-L1192
2,225
adobe/brackets
src/command/Menus.js
registerContextMenu
function registerContextMenu(id) { if (!id) { console.error("call to registerContextMenu() is missing required parameters"); return null; } // Guard against duplicate menu ids if (contextMenuMap[id]) { console.log("Context Menu added with same name an...
javascript
function registerContextMenu(id) { if (!id) { console.error("call to registerContextMenu() is missing required parameters"); return null; } // Guard against duplicate menu ids if (contextMenuMap[id]) { console.log("Context Menu added with same name an...
[ "function", "registerContextMenu", "(", "id", ")", "{", "if", "(", "!", "id", ")", "{", "console", ".", "error", "(", "\"call to registerContextMenu() is missing required parameters\"", ")", ";", "return", "null", ";", "}", "// Guard against duplicate menu ids", "if",...
Registers new context menu with Brackets. Extensions should generally use the predefined context menus built into Brackets. Use this API to add a new context menu to UI that is specific to an extension. After registering a new context menu clients should: - use addMenuItem() to add items to the context menu - call o...
[ "Registers", "new", "context", "menu", "with", "Brackets", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/command/Menus.js#L1371-L1386
2,226
adobe/brackets
src/LiveDevelopment/LiveDevServerManager.js
getServer
function getServer(localPath) { var provider, server, i; for (i = 0; i < _serverProviders.length; i++) { provider = _serverProviders[i]; server = provider.create(); if (server.canServe(localPath)) { return server; } } ret...
javascript
function getServer(localPath) { var provider, server, i; for (i = 0; i < _serverProviders.length; i++) { provider = _serverProviders[i]; server = provider.create(); if (server.canServe(localPath)) { return server; } } ret...
[ "function", "getServer", "(", "localPath", ")", "{", "var", "provider", ",", "server", ",", "i", ";", "for", "(", "i", "=", "0", ";", "i", "<", "_serverProviders", ".", "length", ";", "i", "++", ")", "{", "provider", "=", "_serverProviders", "[", "i"...
Determines which provider can serve a file with a local path. @param {string} localPath A local path to file being served. @return {?BaseServer} A server no null if no servers can serve the file
[ "Determines", "which", "provider", "can", "serve", "a", "file", "with", "a", "local", "path", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/LiveDevServerManager.js#L63-L76
2,227
adobe/brackets
src/LiveDevelopment/LiveDevServerManager.js
registerServer
function registerServer(provider, priority) { if (!provider.create) { console.error("Incompatible live development server provider"); return; } var providerObj = {}; providerObj.create = provider.create; providerObj.priority = priority || 0; _se...
javascript
function registerServer(provider, priority) { if (!provider.create) { console.error("Incompatible live development server provider"); return; } var providerObj = {}; providerObj.create = provider.create; providerObj.priority = priority || 0; _se...
[ "function", "registerServer", "(", "provider", ",", "priority", ")", "{", "if", "(", "!", "provider", ".", "create", ")", "{", "console", ".", "error", "(", "\"Incompatible live development server provider\"", ")", ";", "return", ";", "}", "var", "providerObj", ...
The method by which a server registers itself. It returns an object handler that can be used to remove that server from the list. @param {BaseServer|{create: function():BaseServer}} provider The provider to be registered, described below. @param {number} priority A non-negative number used to break ties among provider...
[ "The", "method", "by", "which", "a", "server", "registers", "itself", ".", "It", "returns", "an", "object", "handler", "that", "can", "be", "used", "to", "remove", "that", "server", "from", "the", "list", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/LiveDevServerManager.js#L91-L106
2,228
adobe/brackets
src/LiveDevelopment/LiveDevServerManager.js
removeServer
function removeServer(provider) { var i; for (i = 0; i < _serverProviders.length; i++) { if (provider === _serverProviders[i]) { _serverProviders.splice(i, 1); } } }
javascript
function removeServer(provider) { var i; for (i = 0; i < _serverProviders.length; i++) { if (provider === _serverProviders[i]) { _serverProviders.splice(i, 1); } } }
[ "function", "removeServer", "(", "provider", ")", "{", "var", "i", ";", "for", "(", "i", "=", "0", ";", "i", "<", "_serverProviders", ".", "length", ";", "i", "++", ")", "{", "if", "(", "provider", "===", "_serverProviders", "[", "i", "]", ")", "{"...
Remove a server from the list of the registered providers. @param {{object}} provider The provider to be removed.
[ "Remove", "a", "server", "from", "the", "list", "of", "the", "registered", "providers", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/LiveDevServerManager.js#L113-L120
2,229
adobe/brackets
src/JSUtils/Preferences.js
settingsToRegExp
function settingsToRegExp(settings, baseRegExp, defaultRegExp) { var regExpString = ""; if (settings instanceof Array && settings.length > 0) { // Append base settings to user settings. The base // settings are builtin and cannot be overridden. if (baseRegExp) { ...
javascript
function settingsToRegExp(settings, baseRegExp, defaultRegExp) { var regExpString = ""; if (settings instanceof Array && settings.length > 0) { // Append base settings to user settings. The base // settings are builtin and cannot be overridden. if (baseRegExp) { ...
[ "function", "settingsToRegExp", "(", "settings", ",", "baseRegExp", ",", "defaultRegExp", ")", "{", "var", "regExpString", "=", "\"\"", ";", "if", "(", "settings", "instanceof", "Array", "&&", "settings", ".", "length", ">", "0", ")", "{", "// Append base sett...
Convert an array of strings with optional wildcards, to an equivalent regular expression. @param {Array.<string|RegExp>} settings from the file (note: this may be mutated by this function) @param {?RegExp} baseRegExp - base regular expression that is always used @param {?RegExp} defaultRegExp - additional regular expr...
[ "Convert", "an", "array", "of", "strings", "with", "optional", "wildcards", "to", "an", "equivalent", "regular", "expression", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/Preferences.js#L80-L138
2,230
adobe/brackets
src/JSUtils/Preferences.js
Preferences
function Preferences(prefs) { var BASE_EXCLUDED_DIRECTORIES = null, /* if the user has settings, we don't exclude anything by default */ // exclude node_modules for performance reasons and because we don't do full hinting for those anyhow. DEFAULT_EXCLUDED_DIRECTORIES = /node_modules/, ...
javascript
function Preferences(prefs) { var BASE_EXCLUDED_DIRECTORIES = null, /* if the user has settings, we don't exclude anything by default */ // exclude node_modules for performance reasons and because we don't do full hinting for those anyhow. DEFAULT_EXCLUDED_DIRECTORIES = /node_modules/, ...
[ "function", "Preferences", "(", "prefs", ")", "{", "var", "BASE_EXCLUDED_DIRECTORIES", "=", "null", ",", "/* if the user has settings, we don't exclude anything by default */", "// exclude node_modules for performance reasons and because we don't do full hinting for those anyhow.", "DEFAUL...
Constructor to create a default preference object. @constructor @param {Object=} prefs - preference object
[ "Constructor", "to", "create", "a", "default", "preference", "object", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/Preferences.js#L146-L179
2,231
adobe/brackets
src/widgets/InlineMenu.js
InlineMenu
function InlineMenu(editor, menuText) { /** * The list of items to display * * @type {Array.<{id: number, name: string>} */ this.items = []; /** * The selected position in the list; otherwise -1. * * @type {number} */ ...
javascript
function InlineMenu(editor, menuText) { /** * The list of items to display * * @type {Array.<{id: number, name: string>} */ this.items = []; /** * The selected position in the list; otherwise -1. * * @type {number} */ ...
[ "function", "InlineMenu", "(", "editor", ",", "menuText", ")", "{", "/**\n * The list of items to display\n *\n * @type {Array.<{id: number, name: string>}\n */", "this", ".", "items", "=", "[", "]", ";", "/**\n * The selected position in the l...
Displays a popup list of items for a given editor context @constructor @param {Editor} editor @param {string} menuText
[ "Displays", "a", "popup", "list", "of", "items", "for", "a", "given", "editor", "context" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/widgets/InlineMenu.js#L46-L108
2,232
adobe/brackets
src/view/MainViewManager.js
_findFileInMRUList
function _findFileInMRUList(paneId, file) { return _.findIndex(_mruList, function (record) { return (record.file.fullPath === file.fullPath && record.paneId === paneId); }); }
javascript
function _findFileInMRUList(paneId, file) { return _.findIndex(_mruList, function (record) { return (record.file.fullPath === file.fullPath && record.paneId === paneId); }); }
[ "function", "_findFileInMRUList", "(", "paneId", ",", "file", ")", "{", "return", "_", ".", "findIndex", "(", "_mruList", ",", "function", "(", "record", ")", "{", "return", "(", "record", ".", "file", ".", "fullPath", "===", "file", ".", "fullPath", "&&...
Locates the first MRU entry of a file for the requested pane @param {!string} paneId - the paneId @param {!File} File - the file @return {{file:File, paneId:string}} @private
[ "Locates", "the", "first", "MRU", "entry", "of", "a", "file", "for", "the", "requested", "pane" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L260-L264
2,233
adobe/brackets
src/view/MainViewManager.js
isExclusiveToPane
function isExclusiveToPane(file, paneId) { paneId = paneId === ACTIVE_PANE && _activePaneId ? _activePaneId : paneId; var index = _.findIndex(_mruList, function (record) { return (record.file.fullPath === file.fullPath && record.paneId !== paneId); }); return index === -1; ...
javascript
function isExclusiveToPane(file, paneId) { paneId = paneId === ACTIVE_PANE && _activePaneId ? _activePaneId : paneId; var index = _.findIndex(_mruList, function (record) { return (record.file.fullPath === file.fullPath && record.paneId !== paneId); }); return index === -1; ...
[ "function", "isExclusiveToPane", "(", "file", ",", "paneId", ")", "{", "paneId", "=", "paneId", "===", "ACTIVE_PANE", "&&", "_activePaneId", "?", "_activePaneId", ":", "paneId", ";", "var", "index", "=", "_", ".", "findIndex", "(", "_mruList", ",", "function...
Checks whether a file is listed exclusively in the provided pane @param {!File} File - the file @return {{file:File, paneId:string}}
[ "Checks", "whether", "a", "file", "is", "listed", "exclusively", "in", "the", "provided", "pane" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L271-L277
2,234
adobe/brackets
src/view/MainViewManager.js
_getPane
function _getPane(paneId) { paneId = _resolvePaneId(paneId); if (_panes[paneId]) { return _panes[paneId]; } return null; }
javascript
function _getPane(paneId) { paneId = _resolvePaneId(paneId); if (_panes[paneId]) { return _panes[paneId]; } return null; }
[ "function", "_getPane", "(", "paneId", ")", "{", "paneId", "=", "_resolvePaneId", "(", "paneId", ")", ";", "if", "(", "_panes", "[", "paneId", "]", ")", "{", "return", "_panes", "[", "paneId", "]", ";", "}", "return", "null", ";", "}" ]
Retrieves the Pane object for the given paneId @param {!string} paneId - id of the pane to retrieve @return {?Pane} the Pane object or null if a pane object doesn't exist for the pane @private
[ "Retrieves", "the", "Pane", "object", "for", "the", "given", "paneId" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L306-L314
2,235
adobe/brackets
src/view/MainViewManager.js
_makeFileMostRecent
function _makeFileMostRecent(paneId, file) { var index, entry, pane = _getPane(paneId); if (!_traversingFileList) { pane.makeViewMostRecent(file); index = _findFileInMRUList(pane.id, file); entry = _makeMRUListEntry(file, pane.id); ...
javascript
function _makeFileMostRecent(paneId, file) { var index, entry, pane = _getPane(paneId); if (!_traversingFileList) { pane.makeViewMostRecent(file); index = _findFileInMRUList(pane.id, file); entry = _makeMRUListEntry(file, pane.id); ...
[ "function", "_makeFileMostRecent", "(", "paneId", ",", "file", ")", "{", "var", "index", ",", "entry", ",", "pane", "=", "_getPane", "(", "paneId", ")", ";", "if", "(", "!", "_traversingFileList", ")", "{", "pane", ".", "makeViewMostRecent", "(", "file", ...
Makes the file the most recent for the pane and the global mru lists @param {!string} paneId - id of the pane to mae th file most recent or ACTIVE_PANE @param {!File} file - File object to make most recent @private
[ "Makes", "the", "file", "the", "most", "recent", "for", "the", "pane", "and", "the", "global", "mru", "lists" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L338-L361
2,236
adobe/brackets
src/view/MainViewManager.js
_makePaneMostRecent
function _makePaneMostRecent(paneId) { var pane = _getPane(paneId); if (pane.getCurrentlyViewedFile()) { _makeFileMostRecent(paneId, pane.getCurrentlyViewedFile()); } }
javascript
function _makePaneMostRecent(paneId) { var pane = _getPane(paneId); if (pane.getCurrentlyViewedFile()) { _makeFileMostRecent(paneId, pane.getCurrentlyViewedFile()); } }
[ "function", "_makePaneMostRecent", "(", "paneId", ")", "{", "var", "pane", "=", "_getPane", "(", "paneId", ")", ";", "if", "(", "pane", ".", "getCurrentlyViewedFile", "(", ")", ")", "{", "_makeFileMostRecent", "(", "paneId", ",", "pane", ".", "getCurrentlyVi...
Makes the Pane's current file the most recent @param {!string} paneId - id of the pane to make the file most recent, or ACTIVE_PANE @param {!File} file - File object to make most recent @private
[ "Makes", "the", "Pane", "s", "current", "file", "the", "most", "recent" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L369-L375
2,237
adobe/brackets
src/view/MainViewManager.js
_activeEditorChange
function _activeEditorChange(e, current) { if (current) { var $container = current.$el.parent().parent(), pane = _getPaneFromElement($container); if (pane) { // Editor is a full editor if (pane.id !== _activePaneId) { /...
javascript
function _activeEditorChange(e, current) { if (current) { var $container = current.$el.parent().parent(), pane = _getPaneFromElement($container); if (pane) { // Editor is a full editor if (pane.id !== _activePaneId) { /...
[ "function", "_activeEditorChange", "(", "e", ",", "current", ")", "{", "if", "(", "current", ")", "{", "var", "$container", "=", "current", ".", "$el", ".", "parent", "(", ")", ".", "parent", "(", ")", ",", "pane", "=", "_getPaneFromElement", "(", "$co...
EditorManager.activeEditorChange handler This event is triggered when an visible editor gains focus Therefore we need to Activate the pane that the active editor belongs to @private @param {!jQuery.Event} e - jQuery Event object @param {Editor=} current - editor being made the current editor
[ "EditorManager", ".", "activeEditorChange", "handler", "This", "event", "is", "triggered", "when", "an", "visible", "editor", "gains", "focus", "Therefore", "we", "need", "to", "Activate", "the", "pane", "that", "the", "active", "editor", "belongs", "to" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L446-L476
2,238
adobe/brackets
src/view/MainViewManager.js
_forEachPaneOrPanes
function _forEachPaneOrPanes(paneId, callback) { if (paneId === ALL_PANES) { _.forEach(_panes, callback); } else { callback(_getPane(paneId)); } }
javascript
function _forEachPaneOrPanes(paneId, callback) { if (paneId === ALL_PANES) { _.forEach(_panes, callback); } else { callback(_getPane(paneId)); } }
[ "function", "_forEachPaneOrPanes", "(", "paneId", ",", "callback", ")", "{", "if", "(", "paneId", "===", "ALL_PANES", ")", "{", "_", ".", "forEach", "(", "_panes", ",", "callback", ")", ";", "}", "else", "{", "callback", "(", "_getPane", "(", "paneId", ...
Iterates over the pane or ALL_PANES and calls the callback function for each. @param {!string} paneId - id of the pane in which to adjust the scroll state, ALL_PANES or ACTIVE_PANE @param {!function(!pane:Pane):boolean} callback - function to callback on to perform work. The callback will receive a Pane and should retu...
[ "Iterates", "over", "the", "pane", "or", "ALL_PANES", "and", "calls", "the", "callback", "function", "for", "each", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L486-L492
2,239
adobe/brackets
src/view/MainViewManager.js
cacheScrollState
function cacheScrollState(paneId) { _forEachPaneOrPanes(paneId, function (pane) { _paneScrollStates[pane.id] = pane.getScrollState(); }); }
javascript
function cacheScrollState(paneId) { _forEachPaneOrPanes(paneId, function (pane) { _paneScrollStates[pane.id] = pane.getScrollState(); }); }
[ "function", "cacheScrollState", "(", "paneId", ")", "{", "_forEachPaneOrPanes", "(", "paneId", ",", "function", "(", "pane", ")", "{", "_paneScrollStates", "[", "pane", ".", "id", "]", "=", "pane", ".", "getScrollState", "(", ")", ";", "}", ")", ";", "}"...
Caches the specified pane's current scroll state If there was already cached state for the specified pane, it is discarded and overwritten @param {!string} paneId - id of the pane in which to cache the scroll state, ALL_PANES or ACTIVE_PANE
[ "Caches", "the", "specified", "pane", "s", "current", "scroll", "state", "If", "there", "was", "already", "cached", "state", "for", "the", "specified", "pane", "it", "is", "discarded", "and", "overwritten" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L500-L504
2,240
adobe/brackets
src/view/MainViewManager.js
restoreAdjustedScrollState
function restoreAdjustedScrollState(paneId, heightDelta) { _forEachPaneOrPanes(paneId, function (pane) { pane.restoreAndAdjustScrollState(_paneScrollStates[pane.id], heightDelta); delete _paneScrollStates[pane.id]; }); }
javascript
function restoreAdjustedScrollState(paneId, heightDelta) { _forEachPaneOrPanes(paneId, function (pane) { pane.restoreAndAdjustScrollState(_paneScrollStates[pane.id], heightDelta); delete _paneScrollStates[pane.id]; }); }
[ "function", "restoreAdjustedScrollState", "(", "paneId", ",", "heightDelta", ")", "{", "_forEachPaneOrPanes", "(", "paneId", ",", "function", "(", "pane", ")", "{", "pane", ".", "restoreAndAdjustScrollState", "(", "_paneScrollStates", "[", "pane", ".", "id", "]", ...
Restores the scroll state from cache and applies the heightDelta The view implementation is responsible for applying or ignoring the heightDelta. This is used primarily when a modal bar opens to keep the editor from scrolling the current page out of view in order to maintain the appearance. The state is removed from th...
[ "Restores", "the", "scroll", "state", "from", "cache", "and", "applies", "the", "heightDelta", "The", "view", "implementation", "is", "responsible", "for", "applying", "or", "ignoring", "the", "heightDelta", ".", "This", "is", "used", "primarily", "when", "a", ...
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L517-L522
2,241
adobe/brackets
src/view/MainViewManager.js
getWorkingSet
function getWorkingSet(paneId) { var result = []; _forEachPaneOrPanes(paneId, function (pane) { var viewList = pane.getViewList(); result = _.union(result, viewList); }); return result; }
javascript
function getWorkingSet(paneId) { var result = []; _forEachPaneOrPanes(paneId, function (pane) { var viewList = pane.getViewList(); result = _.union(result, viewList); }); return result; }
[ "function", "getWorkingSet", "(", "paneId", ")", "{", "var", "result", "=", "[", "]", ";", "_forEachPaneOrPanes", "(", "paneId", ",", "function", "(", "pane", ")", "{", "var", "viewList", "=", "pane", ".", "getViewList", "(", ")", ";", "result", "=", "...
Retrieves the WorkingSet for the given paneId not including temporary views @param {!string} paneId - id of the pane in which to get the view list, ALL_PANES or ACTIVE_PANE @return {Array.<File>}
[ "Retrieves", "the", "WorkingSet", "for", "the", "given", "paneId", "not", "including", "temporary", "views" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L530-L539
2,242
adobe/brackets
src/view/MainViewManager.js
getAllOpenFiles
function getAllOpenFiles() { var result = getWorkingSet(ALL_PANES); _.forEach(_panes, function (pane) { var file = pane.getCurrentlyViewedFile(); if (file) { result = _.union(result, [file]); } }); return result; }
javascript
function getAllOpenFiles() { var result = getWorkingSet(ALL_PANES); _.forEach(_panes, function (pane) { var file = pane.getCurrentlyViewedFile(); if (file) { result = _.union(result, [file]); } }); return result; }
[ "function", "getAllOpenFiles", "(", ")", "{", "var", "result", "=", "getWorkingSet", "(", "ALL_PANES", ")", ";", "_", ".", "forEach", "(", "_panes", ",", "function", "(", "pane", ")", "{", "var", "file", "=", "pane", ".", "getCurrentlyViewedFile", "(", "...
Retrieves the list of all open files including temporary views @return {array.<File>} the list of all open files in all open panes
[ "Retrieves", "the", "list", "of", "all", "open", "files", "including", "temporary", "views" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L546-L555
2,243
adobe/brackets
src/view/MainViewManager.js
getWorkingSetSize
function getWorkingSetSize(paneId) { var result = 0; _forEachPaneOrPanes(paneId, function (pane) { result += pane.getViewListSize(); }); return result; }
javascript
function getWorkingSetSize(paneId) { var result = 0; _forEachPaneOrPanes(paneId, function (pane) { result += pane.getViewListSize(); }); return result; }
[ "function", "getWorkingSetSize", "(", "paneId", ")", "{", "var", "result", "=", "0", ";", "_forEachPaneOrPanes", "(", "paneId", ",", "function", "(", "pane", ")", "{", "result", "+=", "pane", ".", "getViewListSize", "(", ")", ";", "}", ")", ";", "return"...
Retrieves the size of the selected pane's view list @param {!string} paneId - id of the pane in which to get the workingset size. Can use `ALL_PANES` or `ACTIVE_PANE` @return {!number} the number of items in the specified pane
[ "Retrieves", "the", "size", "of", "the", "selected", "pane", "s", "view", "list" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L571-L577
2,244
adobe/brackets
src/view/MainViewManager.js
findInAllWorkingSets
function findInAllWorkingSets(fullPath) { var index, result = []; _.forEach(_panes, function (pane) { index = pane.findInViewList(fullPath); if (index >= 0) { result.push({paneId: pane.id, index: index}); } }); return resu...
javascript
function findInAllWorkingSets(fullPath) { var index, result = []; _.forEach(_panes, function (pane) { index = pane.findInViewList(fullPath); if (index >= 0) { result.push({paneId: pane.id, index: index}); } }); return resu...
[ "function", "findInAllWorkingSets", "(", "fullPath", ")", "{", "var", "index", ",", "result", "=", "[", "]", ";", "_", ".", "forEach", "(", "_panes", ",", "function", "(", "pane", ")", "{", "index", "=", "pane", ".", "findInViewList", "(", "fullPath", ...
Finds all instances of the specified file in all working sets. If there is a temporary view of the file, it is not part of the result set @param {!string} fullPath - path of the file to find views of @return {Array.<{pane:string, index:number}>} an array of paneId/index records
[ "Finds", "all", "instances", "of", "the", "specified", "file", "in", "all", "working", "sets", ".", "If", "there", "is", "a", "temporary", "view", "of", "the", "file", "it", "is", "not", "part", "of", "the", "result", "set" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L623-L635
2,245
adobe/brackets
src/view/MainViewManager.js
addToWorkingSet
function addToWorkingSet(paneId, file, index, force) { // look for the file to have already been added to another pane var pane = _getPane(paneId); if (!pane) { throw new Error("invalid pane id: " + paneId); } var result = pane.reorderItem(file, index, force), ...
javascript
function addToWorkingSet(paneId, file, index, force) { // look for the file to have already been added to another pane var pane = _getPane(paneId); if (!pane) { throw new Error("invalid pane id: " + paneId); } var result = pane.reorderItem(file, index, force), ...
[ "function", "addToWorkingSet", "(", "paneId", ",", "file", ",", "index", ",", "force", ")", "{", "// look for the file to have already been added to another pane", "var", "pane", "=", "_getPane", "(", "paneId", ")", ";", "if", "(", "!", "pane", ")", "{", "throw"...
Adds the given file to the end of the workingset, if it is not already there. This API does not create a view of the file, it just adds it to the working set Views of files in the working set are persisted and are not destroyed until the user closes the file using FILE_CLOSE; Views are created using FILE_OPEN and, when...
[ "Adds", "the", "given", "file", "to", "the", "end", "of", "the", "workingset", "if", "it", "is", "not", "already", "there", ".", "This", "API", "does", "not", "create", "a", "view", "of", "the", "file", "it", "just", "adds", "it", "to", "the", "worki...
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L709-L739
2,246
adobe/brackets
src/view/MainViewManager.js
addListToWorkingSet
function addListToWorkingSet(paneId, fileList) { var uniqueFileList, pane = _getPane(paneId); uniqueFileList = pane.addListToViewList(fileList); uniqueFileList.forEach(function (file) { if (_findFileInMRUList(pane.id, file) !== -1) { console.log(file.ful...
javascript
function addListToWorkingSet(paneId, fileList) { var uniqueFileList, pane = _getPane(paneId); uniqueFileList = pane.addListToViewList(fileList); uniqueFileList.forEach(function (file) { if (_findFileInMRUList(pane.id, file) !== -1) { console.log(file.ful...
[ "function", "addListToWorkingSet", "(", "paneId", ",", "fileList", ")", "{", "var", "uniqueFileList", ",", "pane", "=", "_getPane", "(", "paneId", ")", ";", "uniqueFileList", "=", "pane", ".", "addListToViewList", "(", "fileList", ")", ";", "uniqueFileList", "...
Adds the given file list to the end of the workingset. @param {!string} paneId - The id of the pane in which to add the file object to or ACTIVE_PANE @param {!Array.<File>} fileList - Array of files to add to the pane
[ "Adds", "the", "given", "file", "list", "to", "the", "end", "of", "the", "workingset", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L746-L772
2,247
adobe/brackets
src/view/MainViewManager.js
_removeFileFromMRU
function _removeFileFromMRU(paneId, file) { var index, compare = function (record) { return (record.file === file && record.paneId === paneId); }; // find and remove all instances do { index = _.findIndex(_mruList, compare); if (in...
javascript
function _removeFileFromMRU(paneId, file) { var index, compare = function (record) { return (record.file === file && record.paneId === paneId); }; // find and remove all instances do { index = _.findIndex(_mruList, compare); if (in...
[ "function", "_removeFileFromMRU", "(", "paneId", ",", "file", ")", "{", "var", "index", ",", "compare", "=", "function", "(", "record", ")", "{", "return", "(", "record", ".", "file", "===", "file", "&&", "record", ".", "paneId", "===", "paneId", ")", ...
Removes a file from the global MRU list. Future versions of this implementation may support the ALL_PANES constant but FOCUS_PANE is not allowed @param {!string} paneId - Must be a valid paneId (not a shortcut e.g. ALL_PANES) @ @param {File} file The file object to remove. @private
[ "Removes", "a", "file", "from", "the", "global", "MRU", "list", ".", "Future", "versions", "of", "this", "implementation", "may", "support", "the", "ALL_PANES", "constant", "but", "FOCUS_PANE", "is", "not", "allowed" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L781-L794
2,248
adobe/brackets
src/view/MainViewManager.js
_removeView
function _removeView(paneId, file, suppressRedraw) { var pane = _getPane(paneId); if (pane.removeView(file)) { _removeFileFromMRU(pane.id, file); exports.trigger("workingSetRemove", file, suppressRedraw, pane.id); } }
javascript
function _removeView(paneId, file, suppressRedraw) { var pane = _getPane(paneId); if (pane.removeView(file)) { _removeFileFromMRU(pane.id, file); exports.trigger("workingSetRemove", file, suppressRedraw, pane.id); } }
[ "function", "_removeView", "(", "paneId", ",", "file", ",", "suppressRedraw", ")", "{", "var", "pane", "=", "_getPane", "(", "paneId", ")", ";", "if", "(", "pane", ".", "removeView", "(", "file", ")", ")", "{", "_removeFileFromMRU", "(", "pane", ".", "...
Removes a file the specified pane @param {!string} paneId - Must be a valid paneId (not a shortcut e.g. ALL_PANES) @param {!File} file - the File to remove @param {boolean=} suppressRedraw - true to tell listeners not to redraw Use the suppressRedraw flag when calling this function along with many changes to prevent fl...
[ "Removes", "a", "file", "the", "specified", "pane" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L804-L811
2,249
adobe/brackets
src/view/MainViewManager.js
_moveView
function _moveView(sourcePaneId, destinationPaneId, file, destinationIndex) { var result = new $.Deferred(), sourcePane = _getPane(sourcePaneId), destinationPane = _getPane(destinationPaneId); sourcePane.moveView(file, destinationPane, destinationIndex) .done(functio...
javascript
function _moveView(sourcePaneId, destinationPaneId, file, destinationIndex) { var result = new $.Deferred(), sourcePane = _getPane(sourcePaneId), destinationPane = _getPane(destinationPaneId); sourcePane.moveView(file, destinationPane, destinationIndex) .done(functio...
[ "function", "_moveView", "(", "sourcePaneId", ",", "destinationPaneId", ",", "file", ",", "destinationIndex", ")", "{", "var", "result", "=", "new", "$", ".", "Deferred", "(", ")", ",", "sourcePane", "=", "_getPane", "(", "sourcePaneId", ")", ",", "destinati...
moves a view from one pane to another @param {!string} sourcePaneId - id of the source pane @param {!string} destinationPaneId - id of the destination pane @param {!File} file - the File to move @param {Number} destinationIndex - the working set index of the file in the destination pane @return {jQuery.Promise} a promi...
[ "moves", "a", "view", "from", "one", "pane", "to", "another" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L822-L844
2,250
adobe/brackets
src/view/MainViewManager.js
_removeDeletedFileFromMRU
function _removeDeletedFileFromMRU(e, fullPath) { var index, compare = function (record) { return (record.file.fullPath === fullPath); }; // find and remove all instances do { index = _.findIndex(_mruList, compare); if (index !== -...
javascript
function _removeDeletedFileFromMRU(e, fullPath) { var index, compare = function (record) { return (record.file.fullPath === fullPath); }; // find and remove all instances do { index = _.findIndex(_mruList, compare); if (index !== -...
[ "function", "_removeDeletedFileFromMRU", "(", "e", ",", "fullPath", ")", "{", "var", "index", ",", "compare", "=", "function", "(", "record", ")", "{", "return", "(", "record", ".", "file", ".", "fullPath", "===", "fullPath", ")", ";", "}", ";", "// find...
DocumentManager.pathDeleted Event handler to remove a file from the MRU list @param {!jQuery.event} e - @param {!string} fullPath - path of the file to remove @private
[ "DocumentManager", ".", "pathDeleted", "Event", "handler", "to", "remove", "a", "file", "from", "the", "MRU", "list" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L866-L879
2,251
adobe/brackets
src/view/MainViewManager.js
_sortWorkingSet
function _sortWorkingSet(paneId, compareFn) { _forEachPaneOrPanes(paneId, function (pane) { pane.sortViewList(compareFn); exports.trigger("workingSetSort", pane.id); }); }
javascript
function _sortWorkingSet(paneId, compareFn) { _forEachPaneOrPanes(paneId, function (pane) { pane.sortViewList(compareFn); exports.trigger("workingSetSort", pane.id); }); }
[ "function", "_sortWorkingSet", "(", "paneId", ",", "compareFn", ")", "{", "_forEachPaneOrPanes", "(", "paneId", ",", "function", "(", "pane", ")", "{", "pane", ".", "sortViewList", "(", "compareFn", ")", ";", "exports", ".", "trigger", "(", "\"workingSetSort\"...
sorts the pane's view list @param {!string} paneId - id of the pane to sort, ALL_PANES or ACTIVE_PANE @param {sortFunctionCallback} compareFn - callback to determine sort order (called on each item) @see {@link Pane#sortViewList} for more information @see {@link https://developer.mozilla.org/en-US/docs/JavaScript/Refer...
[ "sorts", "the", "pane", "s", "view", "list" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L889-L894
2,252
adobe/brackets
src/view/MainViewManager.js
_moveWorkingSetItem
function _moveWorkingSetItem(paneId, fromIndex, toIndex) { var pane = _getPane(paneId); pane.moveWorkingSetItem(fromIndex, toIndex); exports.trigger("workingSetSort", pane.id); exports.trigger("_workingSetDisableAutoSort", pane.id); }
javascript
function _moveWorkingSetItem(paneId, fromIndex, toIndex) { var pane = _getPane(paneId); pane.moveWorkingSetItem(fromIndex, toIndex); exports.trigger("workingSetSort", pane.id); exports.trigger("_workingSetDisableAutoSort", pane.id); }
[ "function", "_moveWorkingSetItem", "(", "paneId", ",", "fromIndex", ",", "toIndex", ")", "{", "var", "pane", "=", "_getPane", "(", "paneId", ")", ";", "pane", ".", "moveWorkingSetItem", "(", "fromIndex", ",", "toIndex", ")", ";", "exports", ".", "trigger", ...
moves a working set item from one index to another shifting the items after in the working set up and reinserting it at the desired location @param {!string} paneId - id of the pane to sort @param {!number} fromIndex - the index of the item to move @param {!number} toIndex - the index to move to @private
[ "moves", "a", "working", "set", "item", "from", "one", "index", "to", "another", "shifting", "the", "items", "after", "in", "the", "working", "set", "up", "and", "reinserting", "it", "at", "the", "desired", "location" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L904-L910
2,253
adobe/brackets
src/view/MainViewManager.js
_swapWorkingSetListIndexes
function _swapWorkingSetListIndexes(paneId, index1, index2) { var pane = _getPane(paneId); pane.swapViewListIndexes(index1, index2); exports.trigger("workingSetSort", pane.id); exports.trigger("_workingSetDisableAutoSort", pane.id); }
javascript
function _swapWorkingSetListIndexes(paneId, index1, index2) { var pane = _getPane(paneId); pane.swapViewListIndexes(index1, index2); exports.trigger("workingSetSort", pane.id); exports.trigger("_workingSetDisableAutoSort", pane.id); }
[ "function", "_swapWorkingSetListIndexes", "(", "paneId", ",", "index1", ",", "index2", ")", "{", "var", "pane", "=", "_getPane", "(", "paneId", ")", ";", "pane", ".", "swapViewListIndexes", "(", "index1", ",", "index2", ")", ";", "exports", ".", "trigger", ...
Mutually exchanges the files at the indexes passed by parameters. @param {!string} paneId - id of the pane to swap indices or ACTIVE_PANE @param {!number} index1 - the index on the left @param {!number} index2 - the index on the rigth @private
[ "Mutually", "exchanges", "the", "files", "at", "the", "indexes", "passed", "by", "parameters", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L919-L925
2,254
adobe/brackets
src/view/MainViewManager.js
traverseToNextViewByMRU
function traverseToNextViewByMRU(direction) { var file = getCurrentlyViewedFile(), paneId = getActivePaneId(), index = _.findIndex(_mruList, function (record) { return (record.file === file && record.paneId === paneId); }); return ViewUtils.traverseVi...
javascript
function traverseToNextViewByMRU(direction) { var file = getCurrentlyViewedFile(), paneId = getActivePaneId(), index = _.findIndex(_mruList, function (record) { return (record.file === file && record.paneId === paneId); }); return ViewUtils.traverseVi...
[ "function", "traverseToNextViewByMRU", "(", "direction", ")", "{", "var", "file", "=", "getCurrentlyViewedFile", "(", ")", ",", "paneId", "=", "getActivePaneId", "(", ")", ",", "index", "=", "_", ".", "findIndex", "(", "_mruList", ",", "function", "(", "reco...
Get the next or previous file in the MRU list. @param {!number} direction - Must be 1 or -1 to traverse forward or backward @return {?{file:File, paneId:string}} The File object of the next item in the traversal order or null if there aren't any files to traverse. May return current file if there are no other files to ...
[ "Get", "the", "next", "or", "previous", "file", "in", "the", "MRU", "list", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L933-L941
2,255
adobe/brackets
src/view/MainViewManager.js
traverseToNextViewInListOrder
function traverseToNextViewInListOrder(direction) { var file = getCurrentlyViewedFile(), curPaneId = getActivePaneId(), allFiles = [], index; getPaneIdList().forEach(function (paneId) { var paneFiles = getWorkingSet(paneId).map(function (file) { ...
javascript
function traverseToNextViewInListOrder(direction) { var file = getCurrentlyViewedFile(), curPaneId = getActivePaneId(), allFiles = [], index; getPaneIdList().forEach(function (paneId) { var paneFiles = getWorkingSet(paneId).map(function (file) { ...
[ "function", "traverseToNextViewInListOrder", "(", "direction", ")", "{", "var", "file", "=", "getCurrentlyViewedFile", "(", ")", ",", "curPaneId", "=", "getActivePaneId", "(", ")", ",", "allFiles", "=", "[", "]", ",", "index", ";", "getPaneIdList", "(", ")", ...
Get the next or previous file in list order. @param {!number} direction - Must be 1 or -1 to traverse forward or backward @return {?{file:File, paneId:string}} The File object of the next item in the traversal order or null if there aren't any files to traverse. May return current file if there are no other files to tr...
[ "Get", "the", "next", "or", "previous", "file", "in", "list", "order", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L949-L967
2,256
adobe/brackets
src/view/MainViewManager.js
_synchronizePaneSize
function _synchronizePaneSize(pane, forceRefresh) { var available; if (_orientation === VERTICAL) { available = _$el.innerWidth(); } else { available = _$el.innerHeight(); } // Update the pane's sizer element if it has one and update the max size ...
javascript
function _synchronizePaneSize(pane, forceRefresh) { var available; if (_orientation === VERTICAL) { available = _$el.innerWidth(); } else { available = _$el.innerHeight(); } // Update the pane's sizer element if it has one and update the max size ...
[ "function", "_synchronizePaneSize", "(", "pane", ",", "forceRefresh", ")", "{", "var", "available", ";", "if", "(", "_orientation", "===", "VERTICAL", ")", "{", "available", "=", "_$el", ".", "innerWidth", "(", ")", ";", "}", "else", "{", "available", "=",...
Synchronizes the pane's sizer element, updates the pane's resizer maxsize value and tells the pane to update its layout @param {boolean} forceRefresh - true to force a resize and refresh of the entire view @private
[ "Synchronizes", "the", "pane", "s", "sizer", "element", "updates", "the", "pane", "s", "resizer", "maxsize", "value", "and", "tells", "the", "pane", "to", "update", "its", "layout" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L997-L1010
2,257
adobe/brackets
src/view/MainViewManager.js
_updateLayout
function _updateLayout(event, viewAreaHeight, forceRefresh) { var available; if (_orientation === VERTICAL) { available = _$el.innerWidth(); } else { available = _$el.innerHeight(); } _.forEach(_panes, function (pane) { // For VERTICAL orient...
javascript
function _updateLayout(event, viewAreaHeight, forceRefresh) { var available; if (_orientation === VERTICAL) { available = _$el.innerWidth(); } else { available = _$el.innerHeight(); } _.forEach(_panes, function (pane) { // For VERTICAL orient...
[ "function", "_updateLayout", "(", "event", ",", "viewAreaHeight", ",", "forceRefresh", ")", "{", "var", "available", ";", "if", "(", "_orientation", "===", "VERTICAL", ")", "{", "available", "=", "_$el", ".", "innerWidth", "(", ")", ";", "}", "else", "{", ...
Event handler for "workspaceUpdateLayout" to update the layout @param {jQuery.Event} event - jQuery event object @param {number} viewAreaHeight - unused @param {boolean} forceRefresh - true to force a resize and refresh of the entire view @private
[ "Event", "handler", "for", "workspaceUpdateLayout", "to", "update", "the", "layout" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L1020-L1041
2,258
adobe/brackets
src/view/MainViewManager.js
_initialLayout
function _initialLayout(forceRefresh) { var panes = Object.keys(_panes), size = 100 / panes.length; _.forEach(_panes, function (pane) { if (pane.id === FIRST_PANE) { if (_orientation === VERTICAL) { pane.$el.css({height: "100%", ...
javascript
function _initialLayout(forceRefresh) { var panes = Object.keys(_panes), size = 100 / panes.length; _.forEach(_panes, function (pane) { if (pane.id === FIRST_PANE) { if (_orientation === VERTICAL) { pane.$el.css({height: "100%", ...
[ "function", "_initialLayout", "(", "forceRefresh", ")", "{", "var", "panes", "=", "Object", ".", "keys", "(", "_panes", ")", ",", "size", "=", "100", "/", "panes", ".", "length", ";", "_", ".", "forEach", "(", "_panes", ",", "function", "(", "pane", ...
Sets up the initial layout so panes are evenly distributed This also sets css properties that aid in the layout when _updateLayout is called @param {boolean} forceRefresh - true to force a resize and refresh of the entire view @private
[ "Sets", "up", "the", "initial", "layout", "so", "panes", "are", "evenly", "distributed", "This", "also", "sets", "css", "properties", "that", "aid", "in", "the", "layout", "when", "_updateLayout", "is", "called" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L1049-L1080
2,259
adobe/brackets
src/view/MainViewManager.js
_createPaneIfNecessary
function _createPaneIfNecessary(paneId) { var newPane; if (!_panes.hasOwnProperty(paneId)) { newPane = new Pane(paneId, _$el); _panes[paneId] = newPane; exports.trigger("paneCreate", newPane.id); newPane.$el.on("click.mainview dragover.mainview", functi...
javascript
function _createPaneIfNecessary(paneId) { var newPane; if (!_panes.hasOwnProperty(paneId)) { newPane = new Pane(paneId, _$el); _panes[paneId] = newPane; exports.trigger("paneCreate", newPane.id); newPane.$el.on("click.mainview dragover.mainview", functi...
[ "function", "_createPaneIfNecessary", "(", "paneId", ")", "{", "var", "newPane", ";", "if", "(", "!", "_panes", ".", "hasOwnProperty", "(", "paneId", ")", ")", "{", "newPane", "=", "new", "Pane", "(", "paneId", ",", "_$el", ")", ";", "_panes", "[", "pa...
Creates a pane for paneId if one doesn't already exist @param {!string} paneId - id of the pane to create @private @return {?Pane} - the pane object of the new pane, or undefined if no pane created
[ "Creates", "a", "pane", "for", "paneId", "if", "one", "doesn", "t", "already", "exist" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L1098-L1130
2,260
adobe/brackets
src/view/MainViewManager.js
_makeFirstPaneResizable
function _makeFirstPaneResizable() { var firstPane = _panes[FIRST_PANE]; Resizer.makeResizable(firstPane.$el, _orientation === HORIZONTAL ? Resizer.DIRECTION_VERTICAL : Resizer.DIRECTION_HORIZONTAL, _orientation === HORIZONTAL ? Resizer.POSITIO...
javascript
function _makeFirstPaneResizable() { var firstPane = _panes[FIRST_PANE]; Resizer.makeResizable(firstPane.$el, _orientation === HORIZONTAL ? Resizer.DIRECTION_VERTICAL : Resizer.DIRECTION_HORIZONTAL, _orientation === HORIZONTAL ? Resizer.POSITIO...
[ "function", "_makeFirstPaneResizable", "(", ")", "{", "var", "firstPane", "=", "_panes", "[", "FIRST_PANE", "]", ";", "Resizer", ".", "makeResizable", "(", "firstPane", ".", "$el", ",", "_orientation", "===", "HORIZONTAL", "?", "Resizer", ".", "DIRECTION_VERTICA...
Makes the first pane resizable @private
[ "Makes", "the", "first", "pane", "resizable" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L1136-L1146
2,261
adobe/brackets
src/view/MainViewManager.js
_doSplit
function _doSplit(orientation) { var firstPane, newPane; if (orientation === _orientation) { return; } firstPane = _panes[FIRST_PANE]; Resizer.removeSizable(firstPane.$el); if (_orientation) { _$el.removeClass("split-" + _orientation.toLowerCase...
javascript
function _doSplit(orientation) { var firstPane, newPane; if (orientation === _orientation) { return; } firstPane = _panes[FIRST_PANE]; Resizer.removeSizable(firstPane.$el); if (_orientation) { _$el.removeClass("split-" + _orientation.toLowerCase...
[ "function", "_doSplit", "(", "orientation", ")", "{", "var", "firstPane", ",", "newPane", ";", "if", "(", "orientation", "===", "_orientation", ")", "{", "return", ";", "}", "firstPane", "=", "_panes", "[", "FIRST_PANE", "]", ";", "Resizer", ".", "removeSi...
Creates a split for the specified orientation @private @param {!string} orientation (VERTICAL|HORIZONTAL)
[ "Creates", "a", "split", "for", "the", "specified", "orientation" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L1154-L1184
2,262
adobe/brackets
src/view/MainViewManager.js
_open
function _open(paneId, file, optionsIn) { var result = new $.Deferred(), options = optionsIn || {}; function doPostOpenActivation() { if (!options.noPaneActivate) { setActivePaneId(paneId); } } if (!file || !_getPane(paneId)) { ...
javascript
function _open(paneId, file, optionsIn) { var result = new $.Deferred(), options = optionsIn || {}; function doPostOpenActivation() { if (!options.noPaneActivate) { setActivePaneId(paneId); } } if (!file || !_getPane(paneId)) { ...
[ "function", "_open", "(", "paneId", ",", "file", ",", "optionsIn", ")", "{", "var", "result", "=", "new", "$", ".", "Deferred", "(", ")", ",", "options", "=", "optionsIn", "||", "{", "}", ";", "function", "doPostOpenActivation", "(", ")", "{", "if", ...
Opens a file in the specified pane this can be used to open a file with a custom viewer or a document for editing. If it's a document for editing, edit is called on the document @param {!string} paneId - id of the pane in which to open the document @param {!File} file - file to open @param {{noPaneActivate:boolean=}=}...
[ "Opens", "a", "file", "in", "the", "specified", "pane", "this", "can", "be", "used", "to", "open", "a", "file", "with", "a", "custom", "viewer", "or", "a", "document", "for", "editing", ".", "If", "it", "s", "a", "document", "for", "editing", "edit", ...
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L1227-L1294
2,263
adobe/brackets
src/view/MainViewManager.js
_mergePanes
function _mergePanes() { if (_panes.hasOwnProperty(SECOND_PANE)) { var firstPane = _panes[FIRST_PANE], secondPane = _panes[SECOND_PANE], fileList = secondPane.getViewList(), lastViewed = getCurrentlyViewedFile(); Resizer.removeSizable(fir...
javascript
function _mergePanes() { if (_panes.hasOwnProperty(SECOND_PANE)) { var firstPane = _panes[FIRST_PANE], secondPane = _panes[SECOND_PANE], fileList = secondPane.getViewList(), lastViewed = getCurrentlyViewedFile(); Resizer.removeSizable(fir...
[ "function", "_mergePanes", "(", ")", "{", "if", "(", "_panes", ".", "hasOwnProperty", "(", "SECOND_PANE", ")", ")", "{", "var", "firstPane", "=", "_panes", "[", "FIRST_PANE", "]", ",", "secondPane", "=", "_panes", "[", "SECOND_PANE", "]", ",", "fileList", ...
Merges second pane into first pane and opens the current file @private
[ "Merges", "second", "pane", "into", "first", "pane", "and", "opens", "the", "current", "file" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L1300-L1342
2,264
adobe/brackets
src/view/MainViewManager.js
_close
function _close(paneId, file, optionsIn) { var options = optionsIn || {}; _forEachPaneOrPanes(paneId, function (pane) { if (pane.removeView(file, options.noOpenNextFile) && (paneId === ACTIVE_PANE || pane.id === paneId)) { _removeFileFromMRU(pane.id, file); ex...
javascript
function _close(paneId, file, optionsIn) { var options = optionsIn || {}; _forEachPaneOrPanes(paneId, function (pane) { if (pane.removeView(file, options.noOpenNextFile) && (paneId === ACTIVE_PANE || pane.id === paneId)) { _removeFileFromMRU(pane.id, file); ex...
[ "function", "_close", "(", "paneId", ",", "file", ",", "optionsIn", ")", "{", "var", "options", "=", "optionsIn", "||", "{", "}", ";", "_forEachPaneOrPanes", "(", "paneId", ",", "function", "(", "pane", ")", "{", "if", "(", "pane", ".", "removeView", "...
Closes a file in the specified pane or panes @param {!string} paneId - id of the pane in which to open the document @param {!File} file - file to close @param {Object={noOpenNextFile:boolean}} optionsIn - options This function does not fail if the file is not open
[ "Closes", "a", "file", "in", "the", "specified", "pane", "or", "panes" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L1351-L1360
2,265
adobe/brackets
src/view/MainViewManager.js
_closeList
function _closeList(paneId, fileList) { _forEachPaneOrPanes(paneId, function (pane) { var closedList = pane.removeViews(fileList); closedList.forEach(function (file) { _removeFileFromMRU(pane.id, file); }); exports.trigger("workingSetRemoveList", ...
javascript
function _closeList(paneId, fileList) { _forEachPaneOrPanes(paneId, function (pane) { var closedList = pane.removeViews(fileList); closedList.forEach(function (file) { _removeFileFromMRU(pane.id, file); }); exports.trigger("workingSetRemoveList", ...
[ "function", "_closeList", "(", "paneId", ",", "fileList", ")", "{", "_forEachPaneOrPanes", "(", "paneId", ",", "function", "(", "pane", ")", "{", "var", "closedList", "=", "pane", ".", "removeViews", "(", "fileList", ")", ";", "closedList", ".", "forEach", ...
Closes a list of file in the specified pane or panes @param {!string} paneId - id of the pane in which to open the document @param {!Array.<File>} fileList - files to close This function does not fail if the file is not open
[ "Closes", "a", "list", "of", "file", "in", "the", "specified", "pane", "or", "panes" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L1368-L1377
2,266
adobe/brackets
src/view/MainViewManager.js
_closeAll
function _closeAll(paneId) { _forEachPaneOrPanes(paneId, function (pane) { var closedList = pane.getViewList(); closedList.forEach(function (file) { _removeFileFromMRU(pane.id, file); }); pane._reset(); exports.trigger("workingSetRemov...
javascript
function _closeAll(paneId) { _forEachPaneOrPanes(paneId, function (pane) { var closedList = pane.getViewList(); closedList.forEach(function (file) { _removeFileFromMRU(pane.id, file); }); pane._reset(); exports.trigger("workingSetRemov...
[ "function", "_closeAll", "(", "paneId", ")", "{", "_forEachPaneOrPanes", "(", "paneId", ",", "function", "(", "pane", ")", "{", "var", "closedList", "=", "pane", ".", "getViewList", "(", ")", ";", "closedList", ".", "forEach", "(", "function", "(", "file",...
Closes all files in the specified pane or panes @param {!string} paneId - id of the pane in which to open the document This function does not fail if the file is not open
[ "Closes", "all", "files", "in", "the", "specified", "pane", "or", "panes" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L1384-L1394
2,267
adobe/brackets
src/view/MainViewManager.js
_findPaneForDocument
function _findPaneForDocument(document) { // First check for an editor view of the document var pane = _getPaneFromElement($(document._masterEditor.$el.parent().parent())); if (!pane) { // No view of the document, it may be in a working set and not yet opened var info = ...
javascript
function _findPaneForDocument(document) { // First check for an editor view of the document var pane = _getPaneFromElement($(document._masterEditor.$el.parent().parent())); if (!pane) { // No view of the document, it may be in a working set and not yet opened var info = ...
[ "function", "_findPaneForDocument", "(", "document", ")", "{", "// First check for an editor view of the document", "var", "pane", "=", "_getPaneFromElement", "(", "$", "(", "document", ".", "_masterEditor", ".", "$el", ".", "parent", "(", ")", ".", "parent", "(", ...
Finds which pane a document belongs to @param {!Document} document - the document to locate @return {?Pane} the pane where the document lives or NULL if it isn't in a pane @private
[ "Finds", "which", "pane", "a", "document", "belongs", "to" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L1403-L1416
2,268
adobe/brackets
src/view/MainViewManager.js
_destroyEditorIfNotNeeded
function _destroyEditorIfNotNeeded(document) { if (!(document instanceof DocumentManager.Document)) { throw new Error("_destroyEditorIfUnneeded() should be passed a Document"); } if (document._masterEditor) { // findPaneForDocument tries to locate the pane in which the do...
javascript
function _destroyEditorIfNotNeeded(document) { if (!(document instanceof DocumentManager.Document)) { throw new Error("_destroyEditorIfUnneeded() should be passed a Document"); } if (document._masterEditor) { // findPaneForDocument tries to locate the pane in which the do...
[ "function", "_destroyEditorIfNotNeeded", "(", "document", ")", "{", "if", "(", "!", "(", "document", "instanceof", "DocumentManager", ".", "Document", ")", ")", "{", "throw", "new", "Error", "(", "\"_destroyEditorIfUnneeded() should be passed a Document\"", ")", ";", ...
Destroys an editor object if a document is no longer referenced @param {!Document} doc - document to destroy
[ "Destroys", "an", "editor", "object", "if", "a", "document", "is", "no", "longer", "referenced" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L1422-L1441
2,269
adobe/brackets
src/view/MainViewManager.js
_saveViewState
function _saveViewState() { function _computeSplitPercentage() { var available, used; if (getPaneCount() === 1) { // just short-circuit here and // return 100% to avoid any rounding issues return 1; } else { ...
javascript
function _saveViewState() { function _computeSplitPercentage() { var available, used; if (getPaneCount() === 1) { // just short-circuit here and // return 100% to avoid any rounding issues return 1; } else { ...
[ "function", "_saveViewState", "(", ")", "{", "function", "_computeSplitPercentage", "(", ")", "{", "var", "available", ",", "used", ";", "if", "(", "getPaneCount", "(", ")", "===", "1", ")", "{", "// just short-circuit here and", "// return 100% to avoid any roundi...
Saves the workingset state @private
[ "Saves", "the", "workingset", "state" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L1567-L1612
2,270
adobe/brackets
src/view/MainViewManager.js
_initialize
function _initialize($container) { if (_activePaneId) { throw new Error("MainViewManager has already been initialized"); } _$el = $container; _createPaneIfNecessary(FIRST_PANE); _activePaneId = FIRST_PANE; // One-time init so the pane has the "active" appeara...
javascript
function _initialize($container) { if (_activePaneId) { throw new Error("MainViewManager has already been initialized"); } _$el = $container; _createPaneIfNecessary(FIRST_PANE); _activePaneId = FIRST_PANE; // One-time init so the pane has the "active" appeara...
[ "function", "_initialize", "(", "$container", ")", "{", "if", "(", "_activePaneId", ")", "{", "throw", "new", "Error", "(", "\"MainViewManager has already been initialized\"", ")", ";", "}", "_$el", "=", "$container", ";", "_createPaneIfNecessary", "(", "FIRST_PANE"...
Initializes the MainViewManager's view state @param {jQuery} $container - the container where the main view will live @private
[ "Initializes", "the", "MainViewManager", "s", "view", "state" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L1619-L1639
2,271
adobe/brackets
src/view/MainViewManager.js
setLayoutScheme
function setLayoutScheme(rows, columns) { if ((rows < 1) || (rows > 2) || (columns < 1) || (columns > 2) || (columns === 2 && rows === 2)) { console.error("setLayoutScheme unsupported layout " + rows + ", " + columns); return false; } if (rows === columns) { ...
javascript
function setLayoutScheme(rows, columns) { if ((rows < 1) || (rows > 2) || (columns < 1) || (columns > 2) || (columns === 2 && rows === 2)) { console.error("setLayoutScheme unsupported layout " + rows + ", " + columns); return false; } if (rows === columns) { ...
[ "function", "setLayoutScheme", "(", "rows", ",", "columns", ")", "{", "if", "(", "(", "rows", "<", "1", ")", "||", "(", "rows", ">", "2", ")", "||", "(", "columns", "<", "1", ")", "||", "(", "columns", ">", "2", ")", "||", "(", "columns", "==="...
Changes the layout scheme @param {!number} rows (may be 1 or 2) @param {!number} columns (may be 1 or 2) @summay Rows or Columns may be 1 or 2 but both cannot be 2. 1x2, 2x1 or 1x1 are the legal values
[ "Changes", "the", "layout", "scheme" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L1647-L1661
2,272
adobe/brackets
src/view/MainViewManager.js
getLayoutScheme
function getLayoutScheme() { var result = { rows: 1, columns: 1 }; if (_orientation === HORIZONTAL) { result.rows = 2; } else if (_orientation === VERTICAL) { result.columns = 2; } return result; }
javascript
function getLayoutScheme() { var result = { rows: 1, columns: 1 }; if (_orientation === HORIZONTAL) { result.rows = 2; } else if (_orientation === VERTICAL) { result.columns = 2; } return result; }
[ "function", "getLayoutScheme", "(", ")", "{", "var", "result", "=", "{", "rows", ":", "1", ",", "columns", ":", "1", "}", ";", "if", "(", "_orientation", "===", "HORIZONTAL", ")", "{", "result", ".", "rows", "=", "2", ";", "}", "else", "if", "(", ...
Retrieves the current layout scheme @return {!{rows: number, columns: number>}}
[ "Retrieves", "the", "current", "layout", "scheme" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/MainViewManager.js#L1667-L1680
2,273
adobe/brackets
src/extensions/default/InlineTimingFunctionEditor/InlineTimingFunctionEditor.js
InlineTimingFunctionEditor
function InlineTimingFunctionEditor(timingFunction, startBookmark, endBookmark) { this._timingFunction = timingFunction; this._startBookmark = startBookmark; this._endBookmark = endBookmark; this._isOwnChange = false; this._isHostChange = false; this._origin = "+InlineTim...
javascript
function InlineTimingFunctionEditor(timingFunction, startBookmark, endBookmark) { this._timingFunction = timingFunction; this._startBookmark = startBookmark; this._endBookmark = endBookmark; this._isOwnChange = false; this._isHostChange = false; this._origin = "+InlineTim...
[ "function", "InlineTimingFunctionEditor", "(", "timingFunction", ",", "startBookmark", ",", "endBookmark", ")", "{", "this", ".", "_timingFunction", "=", "timingFunction", ";", "this", ".", "_startBookmark", "=", "startBookmark", ";", "this", ".", "_endBookmark", "=...
Constructor for inline widget containing a BezierCurveEditor control @param {!RegExpMatch} timingFunction RegExp match object of initially selected timingFunction @param {!CodeMirror.Bookmark} startBookmark @param {!CodeMirror.Bookmark} endBookmark
[ "Constructor", "for", "inline", "widget", "containing", "a", "BezierCurveEditor", "control" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineTimingFunctionEditor/InlineTimingFunctionEditor.js#L43-L55
2,274
adobe/brackets
src/extensibility/node/npm-installer.js
performNpmInstallIfRequired
function performNpmInstallIfRequired(npmOptions, validationResult, callback) { function finish() { callback(null, validationResult); } var installDirectory = path.join(validationResult.extractDir, validationResult.commonPrefix); var packageJson; try { packageJson = fs.readJsonSync...
javascript
function performNpmInstallIfRequired(npmOptions, validationResult, callback) { function finish() { callback(null, validationResult); } var installDirectory = path.join(validationResult.extractDir, validationResult.commonPrefix); var packageJson; try { packageJson = fs.readJsonSync...
[ "function", "performNpmInstallIfRequired", "(", "npmOptions", ",", "validationResult", ",", "callback", ")", "{", "function", "finish", "(", ")", "{", "callback", "(", "null", ",", "validationResult", ")", ";", "}", "var", "installDirectory", "=", "path", ".", ...
Checks package.json of the extracted extension for npm dependencies and runs npm install when required. @param {Object} validationResult return value of the validation procedure @param {Function} callback function to be called after the end of validation procedure
[ "Checks", "package", ".", "json", "of", "the", "extracted", "extension", "for", "npm", "dependencies", "and", "runs", "npm", "install", "when", "required", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/node/npm-installer.js#L93-L118
2,275
adobe/brackets
src/view/ThemeSettings.js
showDialog
function showDialog() { var currentSettings = getValues(); var newSettings = {}; var themes = _.map(loadedThemes, function (theme) { return theme; }); var template = $("<div>").append($settings).html(); var $template = $(Mustache.render(template, {"setti...
javascript
function showDialog() { var currentSettings = getValues(); var newSettings = {}; var themes = _.map(loadedThemes, function (theme) { return theme; }); var template = $("<div>").append($settings).html(); var $template = $(Mustache.render(template, {"setti...
[ "function", "showDialog", "(", ")", "{", "var", "currentSettings", "=", "getValues", "(", ")", ";", "var", "newSettings", "=", "{", "}", ";", "var", "themes", "=", "_", ".", "map", "(", "loadedThemes", ",", "function", "(", "theme", ")", "{", "return",...
Opens the settings dialog
[ "Opens", "the", "settings", "dialog" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/ThemeSettings.js#L78-L155
2,276
adobe/brackets
src/document/DocumentManager.js
getCurrentDocument
function getCurrentDocument() { var file = MainViewManager.getCurrentlyViewedFile(MainViewManager.ACTIVE_PANE); if (file) { return getOpenDocumentForPath(file.fullPath); } return null; }
javascript
function getCurrentDocument() { var file = MainViewManager.getCurrentlyViewedFile(MainViewManager.ACTIVE_PANE); if (file) { return getOpenDocumentForPath(file.fullPath); } return null; }
[ "function", "getCurrentDocument", "(", ")", "{", "var", "file", "=", "MainViewManager", ".", "getCurrentlyViewedFile", "(", "MainViewManager", ".", "ACTIVE_PANE", ")", ";", "if", "(", "file", ")", "{", "return", "getOpenDocumentForPath", "(", "file", ".", "fullP...
Returns the Document that is currently open in the editor UI. May be null. @return {?Document}
[ "Returns", "the", "Document", "that", "is", "currently", "open", "in", "the", "editor", "UI", ".", "May", "be", "null", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/document/DocumentManager.js#L140-L148
2,277
adobe/brackets
src/document/DocumentManager.js
getWorkingSet
function getWorkingSet() { DeprecationWarning.deprecationWarning("Use MainViewManager.getWorkingSet() instead of DocumentManager.getWorkingSet()", true); return MainViewManager.getWorkingSet(MainViewManager.ALL_PANES) .filter(function (file) { // Legacy didn't allow for files...
javascript
function getWorkingSet() { DeprecationWarning.deprecationWarning("Use MainViewManager.getWorkingSet() instead of DocumentManager.getWorkingSet()", true); return MainViewManager.getWorkingSet(MainViewManager.ALL_PANES) .filter(function (file) { // Legacy didn't allow for files...
[ "function", "getWorkingSet", "(", ")", "{", "DeprecationWarning", ".", "deprecationWarning", "(", "\"Use MainViewManager.getWorkingSet() instead of DocumentManager.getWorkingSet()\"", ",", "true", ")", ";", "return", "MainViewManager", ".", "getWorkingSet", "(", "MainViewManage...
Returns a list of items in the working set in UI list order. May be 0-length, but never null. @deprecated Use MainViewManager.getWorkingSet() instead @return {Array.<File>}
[ "Returns", "a", "list", "of", "items", "in", "the", "working", "set", "in", "UI", "list", "order", ".", "May", "be", "0", "-", "length", "but", "never", "null", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/document/DocumentManager.js#L156-L163
2,278
adobe/brackets
src/document/DocumentManager.js
findInWorkingSet
function findInWorkingSet(fullPath) { DeprecationWarning.deprecationWarning("Use MainViewManager.findInWorkingSet() instead of DocumentManager.findInWorkingSet()", true); return MainViewManager.findInWorkingSet(MainViewManager.ACTIVE_PANE, fullPath); }
javascript
function findInWorkingSet(fullPath) { DeprecationWarning.deprecationWarning("Use MainViewManager.findInWorkingSet() instead of DocumentManager.findInWorkingSet()", true); return MainViewManager.findInWorkingSet(MainViewManager.ACTIVE_PANE, fullPath); }
[ "function", "findInWorkingSet", "(", "fullPath", ")", "{", "DeprecationWarning", ".", "deprecationWarning", "(", "\"Use MainViewManager.findInWorkingSet() instead of DocumentManager.findInWorkingSet()\"", ",", "true", ")", ";", "return", "MainViewManager", ".", "findInWorkingSet"...
Returns the index of the file matching fullPath in the working set. @deprecated Use MainViewManager.findInWorkingSet() instead @param {!string} fullPath @return {number} index, -1 if not found
[ "Returns", "the", "index", "of", "the", "file", "matching", "fullPath", "in", "the", "working", "set", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/document/DocumentManager.js#L171-L174
2,279
adobe/brackets
src/document/DocumentManager.js
addToWorkingSet
function addToWorkingSet(file, index, forceRedraw) { DeprecationWarning.deprecationWarning("Use MainViewManager.addToWorkingSet() instead of DocumentManager.addToWorkingSet()", true); MainViewManager.addToWorkingSet(MainViewManager.ACTIVE_PANE, file, index, forceRedraw); }
javascript
function addToWorkingSet(file, index, forceRedraw) { DeprecationWarning.deprecationWarning("Use MainViewManager.addToWorkingSet() instead of DocumentManager.addToWorkingSet()", true); MainViewManager.addToWorkingSet(MainViewManager.ACTIVE_PANE, file, index, forceRedraw); }
[ "function", "addToWorkingSet", "(", "file", ",", "index", ",", "forceRedraw", ")", "{", "DeprecationWarning", ".", "deprecationWarning", "(", "\"Use MainViewManager.addToWorkingSet() instead of DocumentManager.addToWorkingSet()\"", ",", "true", ")", ";", "MainViewManager", "....
Adds the given file to the end of the working set list. @deprecated Use MainViewManager.addToWorkingSet() instead @param {!File} file @param {number=} index Position to add to list (defaults to last); -1 is ignored @param {boolean=} forceRedraw If true, a working set change notification is always sent (useful if supp...
[ "Adds", "the", "given", "file", "to", "the", "end", "of", "the", "working", "set", "list", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/document/DocumentManager.js#L202-L205
2,280
adobe/brackets
src/document/DocumentManager.js
removeListFromWorkingSet
function removeListFromWorkingSet(list) { DeprecationWarning.deprecationWarning("Use CommandManager.execute(Commands.FILE_CLOSE_LIST, {PaneId: MainViewManager.ALL_PANES, fileList: list}) instead of DocumentManager.removeListFromWorkingSet()", true); CommandManager.execute(Commands.FILE_CLOSE_LIST, {Pane...
javascript
function removeListFromWorkingSet(list) { DeprecationWarning.deprecationWarning("Use CommandManager.execute(Commands.FILE_CLOSE_LIST, {PaneId: MainViewManager.ALL_PANES, fileList: list}) instead of DocumentManager.removeListFromWorkingSet()", true); CommandManager.execute(Commands.FILE_CLOSE_LIST, {Pane...
[ "function", "removeListFromWorkingSet", "(", "list", ")", "{", "DeprecationWarning", ".", "deprecationWarning", "(", "\"Use CommandManager.execute(Commands.FILE_CLOSE_LIST, {PaneId: MainViewManager.ALL_PANES, fileList: list}) instead of DocumentManager.removeListFromWorkingSet()\"", ",", "tr...
closes a list of files @deprecated Use CommandManager.execute(Commands.FILE_CLOSE_LIST) instead @param {!Array.<File>} list - list of File objectgs to close
[ "closes", "a", "list", "of", "files" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/document/DocumentManager.js#L228-L231
2,281
adobe/brackets
src/document/DocumentManager.js
closeAll
function closeAll() { DeprecationWarning.deprecationWarning("Use CommandManager.execute(Commands.FILE_CLOSE_ALL,{PaneId: MainViewManager.ALL_PANES}) instead of DocumentManager.closeAll()", true); CommandManager.execute(Commands.FILE_CLOSE_ALL, {PaneId: MainViewManager.ALL_PANES}); }
javascript
function closeAll() { DeprecationWarning.deprecationWarning("Use CommandManager.execute(Commands.FILE_CLOSE_ALL,{PaneId: MainViewManager.ALL_PANES}) instead of DocumentManager.closeAll()", true); CommandManager.execute(Commands.FILE_CLOSE_ALL, {PaneId: MainViewManager.ALL_PANES}); }
[ "function", "closeAll", "(", ")", "{", "DeprecationWarning", ".", "deprecationWarning", "(", "\"Use CommandManager.execute(Commands.FILE_CLOSE_ALL,{PaneId: MainViewManager.ALL_PANES}) instead of DocumentManager.closeAll()\"", ",", "true", ")", ";", "CommandManager", ".", "execute", ...
closes all open files @deprecated CommandManager.execute(Commands.FILE_CLOSE_ALL) instead
[ "closes", "all", "open", "files" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/document/DocumentManager.js#L237-L240
2,282
adobe/brackets
src/document/DocumentManager.js
closeFullEditor
function closeFullEditor(file) { DeprecationWarning.deprecationWarning("Use CommandManager.execute(Commands.FILE_CLOSE, {File: file} instead of DocumentManager.closeFullEditor()", true); CommandManager.execute(Commands.FILE_CLOSE, {File: file}); }
javascript
function closeFullEditor(file) { DeprecationWarning.deprecationWarning("Use CommandManager.execute(Commands.FILE_CLOSE, {File: file} instead of DocumentManager.closeFullEditor()", true); CommandManager.execute(Commands.FILE_CLOSE, {File: file}); }
[ "function", "closeFullEditor", "(", "file", ")", "{", "DeprecationWarning", ".", "deprecationWarning", "(", "\"Use CommandManager.execute(Commands.FILE_CLOSE, {File: file} instead of DocumentManager.closeFullEditor()\"", ",", "true", ")", ";", "CommandManager", ".", "execute", "(...
closes the specified file file @deprecated use CommandManager.execute(Commands.FILE_CLOSE, {File: file}) instead @param {!File} file - the file to close
[ "closes", "the", "specified", "file", "file" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/document/DocumentManager.js#L247-L250
2,283
adobe/brackets
src/document/DocumentManager.js
setCurrentDocument
function setCurrentDocument(doc) { DeprecationWarning.deprecationWarning("Use CommandManager.execute(Commands.CMD_OPEN) instead of DocumentManager.setCurrentDocument()", true); CommandManager.execute(Commands.CMD_OPEN, {fullPath: doc.file.fullPath}); }
javascript
function setCurrentDocument(doc) { DeprecationWarning.deprecationWarning("Use CommandManager.execute(Commands.CMD_OPEN) instead of DocumentManager.setCurrentDocument()", true); CommandManager.execute(Commands.CMD_OPEN, {fullPath: doc.file.fullPath}); }
[ "function", "setCurrentDocument", "(", "doc", ")", "{", "DeprecationWarning", ".", "deprecationWarning", "(", "\"Use CommandManager.execute(Commands.CMD_OPEN) instead of DocumentManager.setCurrentDocument()\"", ",", "true", ")", ";", "CommandManager", ".", "execute", "(", "Comm...
opens the specified document for editing in the currently active pane @deprecated use CommandManager.execute(Commands.CMD_OPEN, {fullPath: doc.file.fullPath}) instead @param {!Document} document The Document to make current.
[ "opens", "the", "specified", "document", "for", "editing", "in", "the", "currently", "active", "pane" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/document/DocumentManager.js#L257-L260
2,284
adobe/brackets
src/document/DocumentManager.js
notifyPathDeleted
function notifyPathDeleted(fullPath) { // FileSyncManager.syncOpenDocuments() does all the work prompting // the user to save any unsaved changes and then calls us back // via notifyFileDeleted FileSyncManager.syncOpenDocuments(Strings.FILE_DELETED_TITLE); var projectRoot = Pr...
javascript
function notifyPathDeleted(fullPath) { // FileSyncManager.syncOpenDocuments() does all the work prompting // the user to save any unsaved changes and then calls us back // via notifyFileDeleted FileSyncManager.syncOpenDocuments(Strings.FILE_DELETED_TITLE); var projectRoot = Pr...
[ "function", "notifyPathDeleted", "(", "fullPath", ")", "{", "// FileSyncManager.syncOpenDocuments() does all the work prompting", "// the user to save any unsaved changes and then calls us back", "// via notifyFileDeleted", "FileSyncManager", ".", "syncOpenDocuments", "(", "Strings", "...
Called after a file or folder has been deleted. This function is responsible for updating underlying model data and notifying all views of the change. @param {string} fullPath The path of the file/folder that has been deleted
[ "Called", "after", "a", "file", "or", "folder", "has", "been", "deleted", ".", "This", "function", "is", "responsible", "for", "updating", "underlying", "model", "data", "and", "notifying", "all", "views", "of", "the", "change", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/document/DocumentManager.js#L497-L522
2,285
adobe/brackets
src/document/DocumentManager.js
notifyPathNameChanged
function notifyPathNameChanged(oldName, newName) { // Notify all open documents _.forEach(_openDocuments, function (doc) { // TODO: Only notify affected documents? For now _notifyFilePathChange // just updates the language if the extension changed, so it's fine // to ...
javascript
function notifyPathNameChanged(oldName, newName) { // Notify all open documents _.forEach(_openDocuments, function (doc) { // TODO: Only notify affected documents? For now _notifyFilePathChange // just updates the language if the extension changed, so it's fine // to ...
[ "function", "notifyPathNameChanged", "(", "oldName", ",", "newName", ")", "{", "// Notify all open documents", "_", ".", "forEach", "(", "_openDocuments", ",", "function", "(", "doc", ")", "{", "// TODO: Only notify affected documents? For now _notifyFilePathChange", "// ju...
Called after a file or folder name has changed. This function is responsible for updating underlying model data and notifying all views of the change. @param {string} oldName The old name of the file/folder @param {string} newName The new name of the file/folder
[ "Called", "after", "a", "file", "or", "folder", "name", "has", "changed", ".", "This", "function", "is", "responsible", "for", "updating", "underlying", "model", "data", "and", "notifying", "all", "views", "of", "the", "change", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/document/DocumentManager.js#L531-L542
2,286
adobe/brackets
src/document/DocumentManager.js
_proxyDeprecatedEvent
function _proxyDeprecatedEvent(eventName) { DeprecationWarning.deprecateEvent(exports, MainViewManager, eventName, eventName, ...
javascript
function _proxyDeprecatedEvent(eventName) { DeprecationWarning.deprecateEvent(exports, MainViewManager, eventName, eventName, ...
[ "function", "_proxyDeprecatedEvent", "(", "eventName", ")", "{", "DeprecationWarning", ".", "deprecateEvent", "(", "exports", ",", "MainViewManager", ",", "eventName", ",", "eventName", ",", "\"DocumentManager.\"", "+", "eventName", ",", "\"MainViewManager.\"", "+", "...
Listens for the given event on MainViewManager, and triggers a copy of the event on DocumentManager whenever it occurs
[ "Listens", "for", "the", "given", "event", "on", "MainViewManager", "and", "triggers", "a", "copy", "of", "the", "event", "on", "DocumentManager", "whenever", "it", "occurs" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/document/DocumentManager.js#L651-L658
2,287
adobe/brackets
src/extensions/default/CodeFolding/foldhelpers/foldgutter.js
marker
function marker(spec) { var elt = window.document.createElement("div"); elt.className = spec; return elt; }
javascript
function marker(spec) { var elt = window.document.createElement("div"); elt.className = spec; return elt; }
[ "function", "marker", "(", "spec", ")", "{", "var", "elt", "=", "window", ".", "document", ".", "createElement", "(", "\"div\"", ")", ";", "elt", ".", "className", "=", "spec", ";", "return", "elt", ";", "}" ]
Utility for creating fold markers in fold gutter @param {string} spec the className for the marker @return {HTMLElement} a htmlelement representing the fold marker
[ "Utility", "for", "creating", "fold", "markers", "in", "fold", "gutter" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/foldhelpers/foldgutter.js#L29-L33
2,288
adobe/brackets
src/extensions/default/CodeFolding/foldhelpers/foldgutter.js
updateFoldInfo
function updateFoldInfo(cm, from, to) { var minFoldSize = prefs.getSetting("minFoldSize") || 2; var opts = cm.state.foldGutter.options; var fade = prefs.getSetting("hideUntilMouseover"); var $gutter = $(cm.getGutterElement()); var i = from; function clear(m) { ...
javascript
function updateFoldInfo(cm, from, to) { var minFoldSize = prefs.getSetting("minFoldSize") || 2; var opts = cm.state.foldGutter.options; var fade = prefs.getSetting("hideUntilMouseover"); var $gutter = $(cm.getGutterElement()); var i = from; function clear(m) { ...
[ "function", "updateFoldInfo", "(", "cm", ",", "from", ",", "to", ")", "{", "var", "minFoldSize", "=", "prefs", ".", "getSetting", "(", "\"minFoldSize\"", ")", "||", "2", ";", "var", "opts", "=", "cm", ".", "state", ".", "foldGutter", ".", "options", ";...
Updates the gutter markers for the specified range @param {!CodeMirror} cm the CodeMirror instance for the active editor @param {!number} from the starting line for the update @param {!number} to the ending line for the update
[ "Updates", "the", "gutter", "markers", "for", "the", "specified", "range" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/foldhelpers/foldgutter.js#L50-L122
2,289
adobe/brackets
src/extensions/default/CodeFolding/foldhelpers/foldgutter.js
updateInViewport
function updateInViewport(cm, from, to) { var vp = cm.getViewport(), state = cm.state.foldGutter; from = isNaN(from) ? vp.from : from; to = isNaN(to) ? vp.to : to; if (!state) { return; } cm.operation(function () { updateFoldInfo(cm, from, to); }); st...
javascript
function updateInViewport(cm, from, to) { var vp = cm.getViewport(), state = cm.state.foldGutter; from = isNaN(from) ? vp.from : from; to = isNaN(to) ? vp.to : to; if (!state) { return; } cm.operation(function () { updateFoldInfo(cm, from, to); }); st...
[ "function", "updateInViewport", "(", "cm", ",", "from", ",", "to", ")", "{", "var", "vp", "=", "cm", ".", "getViewport", "(", ")", ",", "state", "=", "cm", ".", "state", ".", "foldGutter", ";", "from", "=", "isNaN", "(", "from", ")", "?", "vp", "...
Updates the fold information in the viewport for the specified range @param {CodeMirror} cm the instance of the CodeMirror object @param {?number} from the starting line number for the update @param {?number} to the end line number for the update
[ "Updates", "the", "fold", "information", "in", "the", "viewport", "for", "the", "specified", "range" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/foldhelpers/foldgutter.js#L130-L141
2,290
adobe/brackets
src/extensions/default/CodeFolding/foldhelpers/foldgutter.js
getFoldOnLine
function getFoldOnLine(cm, line) { var pos = CodeMirror.Pos(line, 0); var folds = cm.findMarksAt(pos) || []; folds = folds.filter(isFold); return folds.length ? folds[0] : undefined; }
javascript
function getFoldOnLine(cm, line) { var pos = CodeMirror.Pos(line, 0); var folds = cm.findMarksAt(pos) || []; folds = folds.filter(isFold); return folds.length ? folds[0] : undefined; }
[ "function", "getFoldOnLine", "(", "cm", ",", "line", ")", "{", "var", "pos", "=", "CodeMirror", ".", "Pos", "(", "line", ",", "0", ")", ";", "var", "folds", "=", "cm", ".", "findMarksAt", "(", "pos", ")", "||", "[", "]", ";", "folds", "=", "folds...
Helper function to return the fold text marker on a line in an editor @param {CodeMirror} cm The CodeMirror instance for the active editor @param {Number} line The line number representing the position of the fold marker @returns {TextMarker} A CodeMirror TextMarker object
[ "Helper", "function", "to", "return", "the", "fold", "text", "marker", "on", "a", "line", "in", "an", "editor" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/foldhelpers/foldgutter.js#L149-L154
2,291
adobe/brackets
src/extensions/default/CodeFolding/foldhelpers/foldgutter.js
syncDocToFoldsCache
function syncDocToFoldsCache(cm, from, lineAdded) { var minFoldSize = prefs.getSetting("minFoldSize") || 2; var i, fold, range; if (lineAdded <= 0) { return; } for (i = from; i <= from + lineAdded; i = i + 1) { fold = getFoldOnLine(cm, i); if ...
javascript
function syncDocToFoldsCache(cm, from, lineAdded) { var minFoldSize = prefs.getSetting("minFoldSize") || 2; var i, fold, range; if (lineAdded <= 0) { return; } for (i = from; i <= from + lineAdded; i = i + 1) { fold = getFoldOnLine(cm, i); if ...
[ "function", "syncDocToFoldsCache", "(", "cm", ",", "from", ",", "lineAdded", ")", "{", "var", "minFoldSize", "=", "prefs", ".", "getSetting", "(", "\"minFoldSize\"", ")", "||", "2", ";", "var", "i", ",", "fold", ",", "range", ";", "if", "(", "lineAdded",...
Synchronises the code folding states in the CM doc to cm._lineFolds cache. When an undo operation is done, if folded code fragments are restored, then we need to update cm._lineFolds with the fragments @param {Object} cm cm the CodeMirror instance for the active editor @param {Object} from starting posit...
[ "Synchronises", "the", "code", "folding", "states", "in", "the", "CM", "doc", "to", "cm", ".", "_lineFolds", "cache", ".", "When", "an", "undo", "operation", "is", "done", "if", "folded", "code", "fragments", "are", "restored", "then", "we", "need", "to", ...
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/foldhelpers/foldgutter.js#L164-L183
2,292
adobe/brackets
src/extensions/default/CodeFolding/foldhelpers/foldgutter.js
moveRange
function moveRange(range, numLines) { return {from: CodeMirror.Pos(range.from.line + numLines, range.from.ch), to: CodeMirror.Pos(range.to.line + numLines, range.to.ch)}; }
javascript
function moveRange(range, numLines) { return {from: CodeMirror.Pos(range.from.line + numLines, range.from.ch), to: CodeMirror.Pos(range.to.line + numLines, range.to.ch)}; }
[ "function", "moveRange", "(", "range", ",", "numLines", ")", "{", "return", "{", "from", ":", "CodeMirror", ".", "Pos", "(", "range", ".", "from", ".", "line", "+", "numLines", ",", "range", ".", "from", ".", "ch", ")", ",", "to", ":", "CodeMirror", ...
Helper function to move a fold range object by the specified number of lines @param {Object} range An object specifying the fold range to move. It contains {from, to} which are CodeMirror.Pos objects. @param {Number} numLines A positive or negative number representing the numbe of lines to move the range by
[ "Helper", "function", "to", "move", "a", "fold", "range", "object", "by", "the", "specified", "number", "of", "lines" ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/foldhelpers/foldgutter.js#L190-L193
2,293
adobe/brackets
src/extensions/default/CodeFolding/foldhelpers/foldgutter.js
onCursorActivity
function onCursorActivity(cm) { var state = cm.state.foldGutter; var vp = cm.getViewport(); window.clearTimeout(state.changeUpdate); state.changeUpdate = window.setTimeout(function () { //need to render the entire visible viewport to remove fold marks rendered from previous s...
javascript
function onCursorActivity(cm) { var state = cm.state.foldGutter; var vp = cm.getViewport(); window.clearTimeout(state.changeUpdate); state.changeUpdate = window.setTimeout(function () { //need to render the entire visible viewport to remove fold marks rendered from previous s...
[ "function", "onCursorActivity", "(", "cm", ")", "{", "var", "state", "=", "cm", ".", "state", ".", "foldGutter", ";", "var", "vp", "=", "cm", ".", "getViewport", "(", ")", ";", "window", ".", "clearTimeout", "(", "state", ".", "changeUpdate", ")", ";",...
Triggered when the cursor moves in the editor and used to detect text selection changes in the editor. @param {!CodeMirror} cm the CodeMirror instance for the active editor
[ "Triggered", "when", "the", "cursor", "moves", "in", "the", "editor", "and", "used", "to", "detect", "text", "selection", "changes", "in", "the", "editor", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/foldhelpers/foldgutter.js#L327-L335
2,294
adobe/brackets
src/extensions/default/CodeFolding/foldhelpers/foldgutter.js
onFold
function onFold(cm, from, to) { var state = cm.state.foldGutter; updateFoldInfo(cm, from.line, from.line + 1); }
javascript
function onFold(cm, from, to) { var state = cm.state.foldGutter; updateFoldInfo(cm, from.line, from.line + 1); }
[ "function", "onFold", "(", "cm", ",", "from", ",", "to", ")", "{", "var", "state", "=", "cm", ".", "state", ".", "foldGutter", ";", "updateFoldInfo", "(", "cm", ",", "from", ".", "line", ",", "from", ".", "line", "+", "1", ")", ";", "}" ]
Triggered when a code segment is folded. @param {!CodeMirror} cm the CodeMirror instance for the active editor @param {!Object} from the ch and line position that designates the start of the region @param {!Object} to the ch and line position that designates the end of the region
[ "Triggered", "when", "a", "code", "segment", "is", "folded", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/foldhelpers/foldgutter.js#L343-L346
2,295
adobe/brackets
src/extensions/default/CodeFolding/foldhelpers/foldgutter.js
onUnFold
function onUnFold(cm, from, to) { var state = cm.state.foldGutter; var vp = cm.getViewport(); delete cm._lineFolds[from.line]; updateFoldInfo(cm, from.line, to.line || vp.to); }
javascript
function onUnFold(cm, from, to) { var state = cm.state.foldGutter; var vp = cm.getViewport(); delete cm._lineFolds[from.line]; updateFoldInfo(cm, from.line, to.line || vp.to); }
[ "function", "onUnFold", "(", "cm", ",", "from", ",", "to", ")", "{", "var", "state", "=", "cm", ".", "state", ".", "foldGutter", ";", "var", "vp", "=", "cm", ".", "getViewport", "(", ")", ";", "delete", "cm", ".", "_lineFolds", "[", "from", ".", ...
Triggered when a folded code segment is unfolded. @param {!CodeMirror} cm the CodeMirror instance for the active editor @param {!{line:number, ch:number}} from the ch and line position that designates the start of the region @param {!{line:number, ch:number}} to the ch and line position that designates the end of the ...
[ "Triggered", "when", "a", "folded", "code", "segment", "is", "unfolded", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/foldhelpers/foldgutter.js#L354-L359
2,296
adobe/brackets
src/extensions/default/CodeFolding/foldhelpers/foldgutter.js
init
function init() { CodeMirror.defineOption("foldGutter", false, function (cm, val, old) { if (old && old !== CodeMirror.Init) { cm.clearGutter(cm.state.foldGutter.options.gutter); cm.state.foldGutter = null; cm.off("gutterClick", old.onGutterClick); ...
javascript
function init() { CodeMirror.defineOption("foldGutter", false, function (cm, val, old) { if (old && old !== CodeMirror.Init) { cm.clearGutter(cm.state.foldGutter.options.gutter); cm.state.foldGutter = null; cm.off("gutterClick", old.onGutterClick); ...
[ "function", "init", "(", ")", "{", "CodeMirror", ".", "defineOption", "(", "\"foldGutter\"", ",", "false", ",", "function", "(", "cm", ",", "val", ",", "old", ")", "{", "if", "(", "old", "&&", "old", "!==", "CodeMirror", ".", "Init", ")", "{", "cm", ...
Initialises the fold gutter and registers event handlers for changes to document, viewport and user interactions.
[ "Initialises", "the", "fold", "gutter", "and", "registers", "event", "handlers", "for", "changes", "to", "document", "viewport", "and", "user", "interactions", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CodeFolding/foldhelpers/foldgutter.js#L365-L391
2,297
adobe/brackets
src/search/FileFilters.js
_getCondensedForm
function _getCondensedForm(filter) { if (!_.isArray(filter)) { return ""; } // Format filter in condensed form if (filter.length > 2) { return filter.slice(0, 2).join(", ") + " " + StringUtils.format(Strings.FILE_FILTER_CLIPPED_SUFFIX, filter.l...
javascript
function _getCondensedForm(filter) { if (!_.isArray(filter)) { return ""; } // Format filter in condensed form if (filter.length > 2) { return filter.slice(0, 2).join(", ") + " " + StringUtils.format(Strings.FILE_FILTER_CLIPPED_SUFFIX, filter.l...
[ "function", "_getCondensedForm", "(", "filter", ")", "{", "if", "(", "!", "_", ".", "isArray", "(", "filter", ")", ")", "{", "return", "\"\"", ";", "}", "// Format filter in condensed form", "if", "(", "filter", ".", "length", ">", "2", ")", "{", "return...
Get the condensed form of the filter set by joining the first two in the set with a comma separator and appending a short message with the number of filters being clipped. @param {Array.<string>} filter @return {string} Condensed form of filter set if `filter` is a valid array. Otherwise, return an empty string.
[ "Get", "the", "condensed", "form", "of", "the", "filter", "set", "by", "joining", "the", "first", "two", "in", "the", "set", "with", "a", "comma", "separator", "and", "appending", "a", "short", "message", "with", "the", "number", "of", "filters", "being", ...
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FileFilters.js#L74-L85
2,298
adobe/brackets
src/search/FileFilters.js
_doPopulate
function _doPopulate() { var dropdownItems = [Strings.NEW_FILE_FILTER, Strings.CLEAR_FILE_FILTER], filterSets = PreferencesManager.get("fileFilters") || []; if (filterSets.length) { dropdownItems.push("---"); // Remove all the empty exclusion sets before concatenati...
javascript
function _doPopulate() { var dropdownItems = [Strings.NEW_FILE_FILTER, Strings.CLEAR_FILE_FILTER], filterSets = PreferencesManager.get("fileFilters") || []; if (filterSets.length) { dropdownItems.push("---"); // Remove all the empty exclusion sets before concatenati...
[ "function", "_doPopulate", "(", ")", "{", "var", "dropdownItems", "=", "[", "Strings", ".", "NEW_FILE_FILTER", ",", "Strings", ".", "CLEAR_FILE_FILTER", "]", ",", "filterSets", "=", "PreferencesManager", ".", "get", "(", "\"fileFilters\"", ")", "||", "[", "]",...
Populate the list of dropdown menu with two filter commands and the list of saved filter sets.
[ "Populate", "the", "list", "of", "dropdown", "menu", "with", "two", "filter", "commands", "and", "the", "list", "of", "saved", "filter", "sets", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FileFilters.js#L91-L108
2,299
adobe/brackets
src/search/FileFilters.js
_getFilterIndex
function _getFilterIndex(filterSets, filter) { var index = -1; if (!filter || !filterSets.length) { return index; } return _.findIndex(filterSets, _.partial(_.isEqual, filter)); }
javascript
function _getFilterIndex(filterSets, filter) { var index = -1; if (!filter || !filterSets.length) { return index; } return _.findIndex(filterSets, _.partial(_.isEqual, filter)); }
[ "function", "_getFilterIndex", "(", "filterSets", ",", "filter", ")", "{", "var", "index", "=", "-", "1", ";", "if", "(", "!", "filter", "||", "!", "filterSets", ".", "length", ")", "{", "return", "index", ";", "}", "return", "_", ".", "findIndex", "...
Find the index of a filter set in the list of saved filter sets. @param {Array.<{name: string, patterns: Array.<string>}>} filterSets @return {{name: string, patterns: Array.<string>}} filter
[ "Find", "the", "index", "of", "a", "filter", "set", "in", "the", "list", "of", "saved", "filter", "sets", "." ]
d5d00d43602c438266d32b8eda8f8a3ca937b524
https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FileFilters.js#L115-L123