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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
1,900 | adobe/brackets | src/extensions/default/AutoUpdate/main.js | initState | function initState() {
var result = $.Deferred();
updateJsonHandler.parse()
.done(function() {
result.resolve();
})
.fail(function (code) {
var logMsg;
switch (code) {
case StateHandlerMessages.FILE_NOT_F... | javascript | function initState() {
var result = $.Deferred();
updateJsonHandler.parse()
.done(function() {
result.resolve();
})
.fail(function (code) {
var logMsg;
switch (code) {
case StateHandlerMessages.FILE_NOT_F... | [
"function",
"initState",
"(",
")",
"{",
"var",
"result",
"=",
"$",
".",
"Deferred",
"(",
")",
";",
"updateJsonHandler",
".",
"parse",
"(",
")",
".",
"done",
"(",
"function",
"(",
")",
"{",
"result",
".",
"resolve",
"(",
")",
";",
"}",
")",
".",
"... | Initializes the state of parsed content from updateHelper.json
returns Promise Object Which is resolved when parsing is success
and rejected if parsing is failed. | [
"Initializes",
"the",
"state",
"of",
"parsed",
"content",
"from",
"updateHelper",
".",
"json",
"returns",
"Promise",
"Object",
"Which",
"is",
"resolved",
"when",
"parsing",
"is",
"success",
"and",
"rejected",
"if",
"parsing",
"is",
"failed",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L287-L313 |
1,901 | adobe/brackets | src/extensions/default/AutoUpdate/main.js | setupAutoUpdate | function setupAutoUpdate() {
updateJsonHandler = new StateHandler(updateJsonPath);
updateDomain.on('data', receiveMessageFromNode);
updateDomain.exec('initNode', {
messageIds: MessageIds,
updateDir: updateDir,
requester: domainID
});
} | javascript | function setupAutoUpdate() {
updateJsonHandler = new StateHandler(updateJsonPath);
updateDomain.on('data', receiveMessageFromNode);
updateDomain.exec('initNode', {
messageIds: MessageIds,
updateDir: updateDir,
requester: domainID
});
} | [
"function",
"setupAutoUpdate",
"(",
")",
"{",
"updateJsonHandler",
"=",
"new",
"StateHandler",
"(",
"updateJsonPath",
")",
";",
"updateDomain",
".",
"on",
"(",
"'data'",
",",
"receiveMessageFromNode",
")",
";",
"updateDomain",
".",
"exec",
"(",
"'initNode'",
","... | Sets up the Auto Update environment | [
"Sets",
"up",
"the",
"Auto",
"Update",
"environment"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L320-L329 |
1,902 | adobe/brackets | src/extensions/default/AutoUpdate/main.js | initializeState | function initializeState() {
var result = $.Deferred();
FileSystem.resolve(updateDir, function (err) {
if (!err) {
result.resolve();
} else {
var directory = FileSystem.getDirectoryForPath(updateDir);
directory.create(function (err... | javascript | function initializeState() {
var result = $.Deferred();
FileSystem.resolve(updateDir, function (err) {
if (!err) {
result.resolve();
} else {
var directory = FileSystem.getDirectoryForPath(updateDir);
directory.create(function (err... | [
"function",
"initializeState",
"(",
")",
"{",
"var",
"result",
"=",
"$",
".",
"Deferred",
"(",
")",
";",
"FileSystem",
".",
"resolve",
"(",
"updateDir",
",",
"function",
"(",
"err",
")",
"{",
"if",
"(",
"!",
"err",
")",
"{",
"result",
".",
"resolve",... | Initializes the state for AutoUpdate process
@returns {$.Deferred} - a jquery promise,
that is resolved with success or failure
of state initialization | [
"Initializes",
"the",
"state",
"for",
"AutoUpdate",
"process"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L338-L358 |
1,903 | adobe/brackets | src/extensions/default/AutoUpdate/main.js | initiateAutoUpdate | function initiateAutoUpdate(updateParams) {
_updateParams = updateParams;
downloadAttemptsRemaining = MAX_DOWNLOAD_ATTEMPTS;
initializeState()
.done(function () {
var setUpdateInProgress = function() {
var initNodeFn = function () {
... | javascript | function initiateAutoUpdate(updateParams) {
_updateParams = updateParams;
downloadAttemptsRemaining = MAX_DOWNLOAD_ATTEMPTS;
initializeState()
.done(function () {
var setUpdateInProgress = function() {
var initNodeFn = function () {
... | [
"function",
"initiateAutoUpdate",
"(",
"updateParams",
")",
"{",
"_updateParams",
"=",
"updateParams",
";",
"downloadAttemptsRemaining",
"=",
"MAX_DOWNLOAD_ATTEMPTS",
";",
"initializeState",
"(",
")",
".",
"done",
"(",
"function",
"(",
")",
"{",
"var",
"setUpdateInP... | Handles the auto update event, which is triggered when user clicks GetItNow in UpdateNotification dialog
@param {object} updateParams - json object containing update information {
installerName - name of the installer
downloadURL - download URL
latestBuildNumber - build number
checksum - checksum } | [
"Handles",
"the",
"auto",
"update",
"event",
"which",
"is",
"triggered",
"when",
"user",
"clicks",
"GetItNow",
"in",
"UpdateNotification",
"dialog"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L370-L419 |
1,904 | adobe/brackets | src/extensions/default/AutoUpdate/main.js | resetStateInFailure | function resetStateInFailure(message) {
updateJsonHandler.reset();
UpdateInfoBar.showUpdateBar({
type: "error",
title: Strings.UPDATE_FAILED,
description: ""
});
enableCheckForUpdateEntry(true);
console.error(message);
} | javascript | function resetStateInFailure(message) {
updateJsonHandler.reset();
UpdateInfoBar.showUpdateBar({
type: "error",
title: Strings.UPDATE_FAILED,
description: ""
});
enableCheckForUpdateEntry(true);
console.error(message);
} | [
"function",
"resetStateInFailure",
"(",
"message",
")",
"{",
"updateJsonHandler",
".",
"reset",
"(",
")",
";",
"UpdateInfoBar",
".",
"showUpdateBar",
"(",
"{",
"type",
":",
"\"error\"",
",",
"title",
":",
"Strings",
".",
"UPDATE_FAILED",
",",
"description",
":... | Resets the update state in updatehelper.json in case of failure,
and logs an error with the message
@param {string} message - the message to be logged onto console | [
"Resets",
"the",
"update",
"state",
"in",
"updatehelper",
".",
"json",
"in",
"case",
"of",
"failure",
"and",
"logs",
"an",
"error",
"with",
"the",
"message"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L611-L623 |
1,905 | adobe/brackets | src/extensions/default/AutoUpdate/main.js | setUpdateStateInJSON | function setUpdateStateInJSON(key, value) {
var result = $.Deferred();
updateJsonHandler.set(key, value)
.done(function () {
result.resolve();
})
.fail(function () {
resetStateInFailure("AutoUpdate : Could not modify updatehelper.json... | javascript | function setUpdateStateInJSON(key, value) {
var result = $.Deferred();
updateJsonHandler.set(key, value)
.done(function () {
result.resolve();
})
.fail(function () {
resetStateInFailure("AutoUpdate : Could not modify updatehelper.json... | [
"function",
"setUpdateStateInJSON",
"(",
"key",
",",
"value",
")",
"{",
"var",
"result",
"=",
"$",
".",
"Deferred",
"(",
")",
";",
"updateJsonHandler",
".",
"set",
"(",
"key",
",",
"value",
")",
".",
"done",
"(",
"function",
"(",
")",
"{",
"result",
... | Sets the update state in updateHelper.json in Appdata
@param {string} key - key to be set
@param {string} value - value to be set
@returns {$.Deferred} - a jquery promise, that is resolved with
success or failure of state update in json file | [
"Sets",
"the",
"update",
"state",
"in",
"updateHelper",
".",
"json",
"in",
"Appdata"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L632-L644 |
1,906 | adobe/brackets | src/extensions/default/AutoUpdate/main.js | handleSafeToDownload | function handleSafeToDownload() {
var downloadFn = function () {
if (isFirstIterationDownload()) {
// For the first iteration of download, show download
//status info in Status bar, and pass download to node
UpdateStatus.showUpdateStatus("initial-downl... | javascript | function handleSafeToDownload() {
var downloadFn = function () {
if (isFirstIterationDownload()) {
// For the first iteration of download, show download
//status info in Status bar, and pass download to node
UpdateStatus.showUpdateStatus("initial-downl... | [
"function",
"handleSafeToDownload",
"(",
")",
"{",
"var",
"downloadFn",
"=",
"function",
"(",
")",
"{",
"if",
"(",
"isFirstIterationDownload",
"(",
")",
")",
"{",
"// For the first iteration of download, show download",
"//status info in Status bar, and pass download to node"... | Handles a safe download of the latest installer,
safety is ensured by cleaning up any pre-existing installers
from update directory before beginning a fresh download | [
"Handles",
"a",
"safe",
"download",
"of",
"the",
"latest",
"installer",
"safety",
"is",
"ensured",
"by",
"cleaning",
"up",
"any",
"pre",
"-",
"existing",
"installers",
"from",
"update",
"directory",
"before",
"beginning",
"a",
"fresh",
"download"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L651-L692 |
1,907 | adobe/brackets | src/extensions/default/AutoUpdate/main.js | attemptToDownload | function attemptToDownload() {
if (checkIfOnline()) {
postMessageToNode(MessageIds.PERFORM_CLEANUP, ['.json'], true);
} else {
enableCheckForUpdateEntry(true);
UpdateStatus.cleanUpdateStatus();
HealthLogger.sendAnalyticsData(
autoUpdateEven... | javascript | function attemptToDownload() {
if (checkIfOnline()) {
postMessageToNode(MessageIds.PERFORM_CLEANUP, ['.json'], true);
} else {
enableCheckForUpdateEntry(true);
UpdateStatus.cleanUpdateStatus();
HealthLogger.sendAnalyticsData(
autoUpdateEven... | [
"function",
"attemptToDownload",
"(",
")",
"{",
"if",
"(",
"checkIfOnline",
"(",
")",
")",
"{",
"postMessageToNode",
"(",
"MessageIds",
".",
"PERFORM_CLEANUP",
",",
"[",
"'.json'",
"]",
",",
"true",
")",
";",
"}",
"else",
"{",
"enableCheckForUpdateEntry",
"(... | Attempts a download of the latest installer, while cleaning up any existing downloaded installers | [
"Attempts",
"a",
"download",
"of",
"the",
"latest",
"installer",
"while",
"cleaning",
"up",
"any",
"existing",
"downloaded",
"installers"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L705-L726 |
1,908 | adobe/brackets | src/extensions/default/AutoUpdate/main.js | showStatusInfo | function showStatusInfo(statusObj) {
if (statusObj.target === "initial-download") {
HealthLogger.sendAnalyticsData(
autoUpdateEventNames.AUTOUPDATE_DOWNLOAD_START,
"autoUpdate",
"download",
"started",
""
);
... | javascript | function showStatusInfo(statusObj) {
if (statusObj.target === "initial-download") {
HealthLogger.sendAnalyticsData(
autoUpdateEventNames.AUTOUPDATE_DOWNLOAD_START,
"autoUpdate",
"download",
"started",
""
);
... | [
"function",
"showStatusInfo",
"(",
"statusObj",
")",
"{",
"if",
"(",
"statusObj",
".",
"target",
"===",
"\"initial-download\"",
")",
"{",
"HealthLogger",
".",
"sendAnalyticsData",
"(",
"autoUpdateEventNames",
".",
"AUTOUPDATE_DOWNLOAD_START",
",",
"\"autoUpdate\"",
",... | Handles the show status information callback from Node.
It modifies the info displayed on Status bar.
@param {object} statusObj - json containing status info {
target - id of string to display,
spans - Array containing json objects of type - {
id - span id,
val - string to fill the span element with }
} | [
"Handles",
"the",
"show",
"status",
"information",
"callback",
"from",
"Node",
".",
"It",
"modifies",
"the",
"info",
"displayed",
"on",
"Status",
"bar",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L760-L772 |
1,909 | adobe/brackets | src/extensions/default/AutoUpdate/main.js | showErrorMessage | function showErrorMessage(message) {
var analyticsDescriptionMessage = "";
switch (message) {
case _nodeErrorMessages.UPDATEDIR_READ_FAILED:
analyticsDescriptionMessage = "Update directory could not be read.";
break;
case _nodeErrorMessages.UPDATEDIR_CLEAN_FAILED... | javascript | function showErrorMessage(message) {
var analyticsDescriptionMessage = "";
switch (message) {
case _nodeErrorMessages.UPDATEDIR_READ_FAILED:
analyticsDescriptionMessage = "Update directory could not be read.";
break;
case _nodeErrorMessages.UPDATEDIR_CLEAN_FAILED... | [
"function",
"showErrorMessage",
"(",
"message",
")",
"{",
"var",
"analyticsDescriptionMessage",
"=",
"\"\"",
";",
"switch",
"(",
"message",
")",
"{",
"case",
"_nodeErrorMessages",
".",
"UPDATEDIR_READ_FAILED",
":",
"analyticsDescriptionMessage",
"=",
"\"Update directory... | Handles the error messages from Node, in a popup displayed to the user.
@param {string} message - error string | [
"Handles",
"the",
"error",
"messages",
"from",
"Node",
"in",
"a",
"popup",
"displayed",
"to",
"the",
"user",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L778-L797 |
1,910 | adobe/brackets | src/extensions/default/AutoUpdate/main.js | initiateUpdateProcess | function initiateUpdateProcess(formattedInstallerPath, formattedLogFilePath, installStatusFilePath) {
// Get additional update parameters on Mac : installDir, appName, and updateDir
function getAdditionalParams() {
var retval = {};
var installDir = FileUtils.getNativeBracketsDir... | javascript | function initiateUpdateProcess(formattedInstallerPath, formattedLogFilePath, installStatusFilePath) {
// Get additional update parameters on Mac : installDir, appName, and updateDir
function getAdditionalParams() {
var retval = {};
var installDir = FileUtils.getNativeBracketsDir... | [
"function",
"initiateUpdateProcess",
"(",
"formattedInstallerPath",
",",
"formattedLogFilePath",
",",
"installStatusFilePath",
")",
"{",
"// Get additional update parameters on Mac : installDir, appName, and updateDir",
"function",
"getAdditionalParams",
"(",
")",
"{",
"var",
"retv... | Initiates the update process, when user clicks UpdateNow in the update popup
@param {string} formattedInstallerPath - formatted path to the latest installer
@param {string} formattedLogFilePath - formatted path to the installer log file
@param {string} installStatusFilePath - path to the install status log file | [
"Initiates",
"the",
"update",
"process",
"when",
"user",
"clicks",
"UpdateNow",
"in",
"the",
"update",
"popup"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L829-L885 |
1,911 | adobe/brackets | src/extensions/default/AutoUpdate/main.js | function () {
var infoObj = {
installerPath: formattedInstallerPath,
logFilePath: formattedLogFilePath,
installStatusFilePath: installStatusFilePath
};
if (brackets.platform === "mac") {
var additionalParams = getAdditi... | javascript | function () {
var infoObj = {
installerPath: formattedInstallerPath,
logFilePath: formattedLogFilePath,
installStatusFilePath: installStatusFilePath
};
if (brackets.platform === "mac") {
var additionalParams = getAdditi... | [
"function",
"(",
")",
"{",
"var",
"infoObj",
"=",
"{",
"installerPath",
":",
"formattedInstallerPath",
",",
"logFilePath",
":",
"formattedLogFilePath",
",",
"installStatusFilePath",
":",
"installStatusFilePath",
"}",
";",
"if",
"(",
"brackets",
".",
"platform",
"=... | Update function, to carry out app update | [
"Update",
"function",
"to",
"carry",
"out",
"app",
"update"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L851-L882 | |
1,912 | adobe/brackets | src/extensions/default/AutoUpdate/main.js | handleValidationStatus | function handleValidationStatus(statusObj) {
enableCheckForUpdateEntry(true);
UpdateStatus.cleanUpdateStatus();
if (statusObj.valid) {
// Installer is validated successfully
var statusValidFn = function () {
// Restart button click handler
... | javascript | function handleValidationStatus(statusObj) {
enableCheckForUpdateEntry(true);
UpdateStatus.cleanUpdateStatus();
if (statusObj.valid) {
// Installer is validated successfully
var statusValidFn = function () {
// Restart button click handler
... | [
"function",
"handleValidationStatus",
"(",
"statusObj",
")",
"{",
"enableCheckForUpdateEntry",
"(",
"true",
")",
";",
"UpdateStatus",
".",
"cleanUpdateStatus",
"(",
")",
";",
"if",
"(",
"statusObj",
".",
"valid",
")",
"{",
"// Installer is validated successfully",
"... | Handles the installer validation callback from Node
@param {object} statusObj - json containing - {
valid - (boolean)true for a valid installer, false otherwise,
installerPath, logFilePath,
installStatusFilePath - for a valid installer,
err - for an invalid installer } | [
"Handles",
"the",
"installer",
"validation",
"callback",
"from",
"Node"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L904-L1018 |
1,913 | adobe/brackets | src/extensions/default/AutoUpdate/main.js | function () {
// Restart button click handler
var restartBtnClicked = function () {
HealthLogger.sendAnalyticsData(
autoUpdateEventNames.AUTOUPDATE_DOWNLOAD_COMPLETE_USER_CLICK_RESTART,
"autoUpdate",
... | javascript | function () {
// Restart button click handler
var restartBtnClicked = function () {
HealthLogger.sendAnalyticsData(
autoUpdateEventNames.AUTOUPDATE_DOWNLOAD_COMPLETE_USER_CLICK_RESTART,
"autoUpdate",
... | [
"function",
"(",
")",
"{",
"// Restart button click handler",
"var",
"restartBtnClicked",
"=",
"function",
"(",
")",
"{",
"HealthLogger",
".",
"sendAnalyticsData",
"(",
"autoUpdateEventNames",
".",
"AUTOUPDATE_DOWNLOAD_COMPLETE_USER_CLICK_RESTART",
",",
"\"autoUpdate\"",
",... | Installer is validated successfully | [
"Installer",
"is",
"validated",
"successfully"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L911-L957 | |
1,914 | adobe/brackets | src/extensions/default/AutoUpdate/main.js | function () {
HealthLogger.sendAnalyticsData(
autoUpdateEventNames.AUTOUPDATE_DOWNLOAD_COMPLETE_USER_CLICK_RESTART,
"autoUpdate",
"installNotification",
"installNow ",
"click"
... | javascript | function () {
HealthLogger.sendAnalyticsData(
autoUpdateEventNames.AUTOUPDATE_DOWNLOAD_COMPLETE_USER_CLICK_RESTART,
"autoUpdate",
"installNotification",
"installNow ",
"click"
... | [
"function",
"(",
")",
"{",
"HealthLogger",
".",
"sendAnalyticsData",
"(",
"autoUpdateEventNames",
".",
"AUTOUPDATE_DOWNLOAD_COMPLETE_USER_CLICK_RESTART",
",",
"\"autoUpdate\"",
",",
"\"installNotification\"",
",",
"\"installNow \"",
",",
"\"click\"",
")",
";",
"detachUpdate... | Restart button click handler | [
"Restart",
"button",
"click",
"handler"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L914-L924 | |
1,915 | adobe/brackets | src/extensions/default/AutoUpdate/main.js | handleDownloadFailure | function handleDownloadFailure(message) {
console.log("AutoUpdate : Download of latest installer failed in Attempt " +
(MAX_DOWNLOAD_ATTEMPTS - downloadAttemptsRemaining) + ".\n Reason : " + message);
if (downloadAttemptsRemaining) {
// Retry the downloading
attempt... | javascript | function handleDownloadFailure(message) {
console.log("AutoUpdate : Download of latest installer failed in Attempt " +
(MAX_DOWNLOAD_ATTEMPTS - downloadAttemptsRemaining) + ".\n Reason : " + message);
if (downloadAttemptsRemaining) {
// Retry the downloading
attempt... | [
"function",
"handleDownloadFailure",
"(",
"message",
")",
"{",
"console",
".",
"log",
"(",
"\"AutoUpdate : Download of latest installer failed in Attempt \"",
"+",
"(",
"MAX_DOWNLOAD_ATTEMPTS",
"-",
"downloadAttemptsRemaining",
")",
"+",
"\".\\n Reason : \"",
"+",
"message",
... | Handles the download failure callback from Node
@param {string} message - reason of download failure | [
"Handles",
"the",
"download",
"failure",
"callback",
"from",
"Node"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L1024-L1063 |
1,916 | adobe/brackets | src/extensions/default/AutoUpdate/main.js | registerBracketsFunctions | function registerBracketsFunctions() {
functionMap["brackets.notifyinitializationComplete"] = handleInitializationComplete;
functionMap["brackets.showStatusInfo"] = showStatusInfo;
functionMap["brackets.notifyDownloadSuccess"] = handleDownloadSuccess;
functionMap["br... | javascript | function registerBracketsFunctions() {
functionMap["brackets.notifyinitializationComplete"] = handleInitializationComplete;
functionMap["brackets.showStatusInfo"] = showStatusInfo;
functionMap["brackets.notifyDownloadSuccess"] = handleDownloadSuccess;
functionMap["br... | [
"function",
"registerBracketsFunctions",
"(",
")",
"{",
"functionMap",
"[",
"\"brackets.notifyinitializationComplete\"",
"]",
"=",
"handleInitializationComplete",
";",
"functionMap",
"[",
"\"brackets.showStatusInfo\"",
"]",
"=",
"showStatusInfo",
";",
"functionMap",
"[",
"\... | Generates a map for brackets side functions | [
"Generates",
"a",
"map",
"for",
"brackets",
"side",
"functions"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/AutoUpdate/main.js#L1098-L1109 |
1,917 | adobe/brackets | src/extensions/default/MDNDocs/main.js | inlineProvider | function inlineProvider(hostEditor, pos) {
var jsonFile, propInfo,
propQueue = [], // priority queue of propNames to try
langId = hostEditor.getLanguageForSelection().getId(),
supportedLangs = {
"css": true,
"scss": true,
"less"... | javascript | function inlineProvider(hostEditor, pos) {
var jsonFile, propInfo,
propQueue = [], // priority queue of propNames to try
langId = hostEditor.getLanguageForSelection().getId(),
supportedLangs = {
"css": true,
"scss": true,
"less"... | [
"function",
"inlineProvider",
"(",
"hostEditor",
",",
"pos",
")",
"{",
"var",
"jsonFile",
",",
"propInfo",
",",
"propQueue",
"=",
"[",
"]",
",",
"// priority queue of propNames to try",
"langId",
"=",
"hostEditor",
".",
"getLanguageForSelection",
"(",
")",
".",
... | Inline docs provider.
@param {!Editor} editor
@param {!{line:Number, ch:Number}} pos
@return {?$.Promise} resolved with an InlineWidget; null if we're not going to provide anything | [
"Inline",
"docs",
"provider",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/MDNDocs/main.js#L89-L176 |
1,918 | adobe/brackets | src/extensions/default/HealthData/HealthDataManager.js | getHealthData | function getHealthData() {
var result = new $.Deferred(),
oneTimeHealthData = {};
oneTimeHealthData.snapshotTime = Date.now();
oneTimeHealthData.os = brackets.platform;
oneTimeHealthData.userAgent = window.navigator.userAgent;
oneTimeHealthData.osLanguage = brackets.... | javascript | function getHealthData() {
var result = new $.Deferred(),
oneTimeHealthData = {};
oneTimeHealthData.snapshotTime = Date.now();
oneTimeHealthData.os = brackets.platform;
oneTimeHealthData.userAgent = window.navigator.userAgent;
oneTimeHealthData.osLanguage = brackets.... | [
"function",
"getHealthData",
"(",
")",
"{",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
",",
"oneTimeHealthData",
"=",
"{",
"}",
";",
"oneTimeHealthData",
".",
"snapshotTime",
"=",
"Date",
".",
"now",
"(",
")",
";",
"oneTimeHealthData",
... | Get the Health Data which will be sent to the server. Initially it is only one time data. | [
"Get",
"the",
"Health",
"Data",
"which",
"will",
"be",
"sent",
"to",
"the",
"server",
".",
"Initially",
"it",
"is",
"only",
"one",
"time",
"data",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/HealthData/HealthDataManager.js#L51-L130 |
1,919 | adobe/brackets | src/extensions/default/HealthData/HealthDataManager.js | sendHealthDataToServer | function sendHealthDataToServer() {
var result = new $.Deferred();
getHealthData().done(function (healthData) {
var url = brackets.config.healthDataServerURL,
data = JSON.stringify(healthData);
$.ajax({
url: url,
type: "POST",
... | javascript | function sendHealthDataToServer() {
var result = new $.Deferred();
getHealthData().done(function (healthData) {
var url = brackets.config.healthDataServerURL,
data = JSON.stringify(healthData);
$.ajax({
url: url,
type: "POST",
... | [
"function",
"sendHealthDataToServer",
"(",
")",
"{",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
";",
"getHealthData",
"(",
")",
".",
"done",
"(",
"function",
"(",
"healthData",
")",
"{",
"var",
"url",
"=",
"brackets",
".",
"config",
"... | Send data to the server | [
"Send",
"data",
"to",
"the",
"server"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/HealthData/HealthDataManager.js#L184-L212 |
1,920 | adobe/brackets | src/extensions/default/HealthData/HealthDataManager.js | sendAnalyticsDataToServer | function sendAnalyticsDataToServer(eventParams) {
var result = new $.Deferred();
var analyticsData = getAnalyticsData(eventParams);
$.ajax({
url: brackets.config.analyticsDataServerURL,
type: "POST",
data: JSON.stringify({events: [analyticsData]}),
... | javascript | function sendAnalyticsDataToServer(eventParams) {
var result = new $.Deferred();
var analyticsData = getAnalyticsData(eventParams);
$.ajax({
url: brackets.config.analyticsDataServerURL,
type: "POST",
data: JSON.stringify({events: [analyticsData]}),
... | [
"function",
"sendAnalyticsDataToServer",
"(",
"eventParams",
")",
"{",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
";",
"var",
"analyticsData",
"=",
"getAnalyticsData",
"(",
"eventParams",
")",
";",
"$",
".",
"ajax",
"(",
"{",
"url",
":",
... | Send Analytics data to Server | [
"Send",
"Analytics",
"data",
"to",
"Server"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/HealthData/HealthDataManager.js#L215-L237 |
1,921 | adobe/brackets | src/LiveDevelopment/LiveDevMultiBrowser.js | _setStatus | function _setStatus(status, closeReason) {
// Don't send a notification when the status didn't actually change
if (status === exports.status) {
return;
}
exports.status = status;
var reason = status === STATUS_INACTIVE ? closeReason : null;
exports.trigger("... | javascript | function _setStatus(status, closeReason) {
// Don't send a notification when the status didn't actually change
if (status === exports.status) {
return;
}
exports.status = status;
var reason = status === STATUS_INACTIVE ? closeReason : null;
exports.trigger("... | [
"function",
"_setStatus",
"(",
"status",
",",
"closeReason",
")",
"{",
"// Don't send a notification when the status didn't actually change",
"if",
"(",
"status",
"===",
"exports",
".",
"status",
")",
"{",
"return",
";",
"}",
"exports",
".",
"status",
"=",
"status",... | Update the status. Triggers a statusChange event.
@param {number} status new status
@param {?string} closeReason Optional string key suffix to display to
user when closing the live development connection (see LIVE_DEV_* keys) | [
"Update",
"the",
"status",
".",
"Triggers",
"a",
"statusChange",
"event",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/LiveDevMultiBrowser.js#L201-L211 |
1,922 | adobe/brackets | src/LiveDevelopment/LiveDevMultiBrowser.js | _docIsOutOfSync | function _docIsOutOfSync(doc) {
var liveDoc = _server && _server.get(doc.file.fullPath),
isLiveEditingEnabled = liveDoc && liveDoc.isLiveEditingEnabled();
return doc.isDirty && !isLiveEditingEnabled;
} | javascript | function _docIsOutOfSync(doc) {
var liveDoc = _server && _server.get(doc.file.fullPath),
isLiveEditingEnabled = liveDoc && liveDoc.isLiveEditingEnabled();
return doc.isDirty && !isLiveEditingEnabled;
} | [
"function",
"_docIsOutOfSync",
"(",
"doc",
")",
"{",
"var",
"liveDoc",
"=",
"_server",
"&&",
"_server",
".",
"get",
"(",
"doc",
".",
"file",
".",
"fullPath",
")",
",",
"isLiveEditingEnabled",
"=",
"liveDoc",
"&&",
"liveDoc",
".",
"isLiveEditingEnabled",
"(",... | Documents are considered to be out-of-sync if they are dirty and
do not have "update while editing" support
@param {Document} doc
@return {boolean} | [
"Documents",
"are",
"considered",
"to",
"be",
"out",
"-",
"of",
"-",
"sync",
"if",
"they",
"are",
"dirty",
"and",
"do",
"not",
"have",
"update",
"while",
"editing",
"support"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/LiveDevMultiBrowser.js#L278-L283 |
1,923 | adobe/brackets | src/LiveDevelopment/LiveDevMultiBrowser.js | _styleSheetAdded | function _styleSheetAdded(event, url, roots) {
var path = _server && _server.urlToPath(url),
alreadyAdded = !!_relatedDocuments[url];
// path may be null if loading an external stylesheet.
// Also, the stylesheet may already exist and be reported as added twice
// due to Chr... | javascript | function _styleSheetAdded(event, url, roots) {
var path = _server && _server.urlToPath(url),
alreadyAdded = !!_relatedDocuments[url];
// path may be null if loading an external stylesheet.
// Also, the stylesheet may already exist and be reported as added twice
// due to Chr... | [
"function",
"_styleSheetAdded",
"(",
"event",
",",
"url",
",",
"roots",
")",
"{",
"var",
"path",
"=",
"_server",
"&&",
"_server",
".",
"urlToPath",
"(",
"url",
")",
",",
"alreadyAdded",
"=",
"!",
"!",
"_relatedDocuments",
"[",
"url",
"]",
";",
"// path m... | Handles a notification from the browser that a stylesheet was loaded into
the live HTML document. If the stylesheet maps to a file in the project, then
creates a live document for the stylesheet and adds it to _relatedDocuments.
@param {$.Event} event
@param {string} url The URL of the stylesheet that was added.
@param... | [
"Handles",
"a",
"notification",
"from",
"the",
"browser",
"that",
"a",
"stylesheet",
"was",
"loaded",
"into",
"the",
"live",
"HTML",
"document",
".",
"If",
"the",
"stylesheet",
"maps",
"to",
"a",
"file",
"in",
"the",
"project",
"then",
"creates",
"a",
"liv... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/LiveDevMultiBrowser.js#L293-L322 |
1,924 | adobe/brackets | src/LiveDevelopment/LiveDevMultiBrowser.js | open | function open() {
// TODO: need to run _onDocumentChange() after load if doc != currentDocument here? Maybe not, since activeEditorChange
// doesn't trigger it, while inline editors can still cause edits in doc other than currentDoc...
_getInitialDocFromCurrent().done(function (doc) {
... | javascript | function open() {
// TODO: need to run _onDocumentChange() after load if doc != currentDocument here? Maybe not, since activeEditorChange
// doesn't trigger it, while inline editors can still cause edits in doc other than currentDoc...
_getInitialDocFromCurrent().done(function (doc) {
... | [
"function",
"open",
"(",
")",
"{",
"// TODO: need to run _onDocumentChange() after load if doc != currentDocument here? Maybe not, since activeEditorChange",
"// doesn't trigger it, while inline editors can still cause edits in doc other than currentDoc...",
"_getInitialDocFromCurrent",
"(",
")",
... | Open a live preview on the current docuemnt. | [
"Open",
"a",
"live",
"preview",
"on",
"the",
"current",
"docuemnt",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/LiveDevMultiBrowser.js#L691-L717 |
1,925 | adobe/brackets | src/LiveDevelopment/LiveDevMultiBrowser.js | init | function init(config) {
exports.config = config;
MainViewManager
.on("currentFileChange", _onFileChange);
DocumentManager
.on("documentSaved", _onDocumentSaved)
.on("dirtyFlagChange", _onDirtyFlagChange);
ProjectManager
.on("beforeProjectCl... | javascript | function init(config) {
exports.config = config;
MainViewManager
.on("currentFileChange", _onFileChange);
DocumentManager
.on("documentSaved", _onDocumentSaved)
.on("dirtyFlagChange", _onDirtyFlagChange);
ProjectManager
.on("beforeProjectCl... | [
"function",
"init",
"(",
"config",
")",
"{",
"exports",
".",
"config",
"=",
"config",
";",
"MainViewManager",
".",
"on",
"(",
"\"currentFileChange\"",
",",
"_onFileChange",
")",
";",
"DocumentManager",
".",
"on",
"(",
"\"documentSaved\"",
",",
"_onDocumentSaved"... | Initialize the LiveDevelopment module. | [
"Initialize",
"the",
"LiveDevelopment",
"module",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/LiveDevMultiBrowser.js#L818-L836 |
1,926 | adobe/brackets | src/LiveDevelopment/LiveDevMultiBrowser.js | getCurrentProjectServerConfig | function getCurrentProjectServerConfig() {
return {
baseUrl: ProjectManager.getBaseUrl(),
pathResolver: ProjectManager.makeProjectRelativeIfPossible,
root: ProjectManager.getProjectRoot().fullPath
};
} | javascript | function getCurrentProjectServerConfig() {
return {
baseUrl: ProjectManager.getBaseUrl(),
pathResolver: ProjectManager.makeProjectRelativeIfPossible,
root: ProjectManager.getProjectRoot().fullPath
};
} | [
"function",
"getCurrentProjectServerConfig",
"(",
")",
"{",
"return",
"{",
"baseUrl",
":",
"ProjectManager",
".",
"getBaseUrl",
"(",
")",
",",
"pathResolver",
":",
"ProjectManager",
".",
"makeProjectRelativeIfPossible",
",",
"root",
":",
"ProjectManager",
".",
"getP... | Returns current project server config. Copied from original LiveDevelopment. | [
"Returns",
"current",
"project",
"server",
"config",
".",
"Copied",
"from",
"original",
"LiveDevelopment",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/LiveDevMultiBrowser.js#L894-L900 |
1,927 | adobe/brackets | src/extensions/default/DebugCommands/NodeDebugUtils.js | logNodeState | function logNodeState() {
if (brackets.app && brackets.app.getNodeState) {
brackets.app.getNodeState(function (err, port) {
if (err) {
console.log("[NodeDebugUtils] Node is in error state " + err);
} else {
console.log("[NodeDeb... | javascript | function logNodeState() {
if (brackets.app && brackets.app.getNodeState) {
brackets.app.getNodeState(function (err, port) {
if (err) {
console.log("[NodeDebugUtils] Node is in error state " + err);
} else {
console.log("[NodeDeb... | [
"function",
"logNodeState",
"(",
")",
"{",
"if",
"(",
"brackets",
".",
"app",
"&&",
"brackets",
".",
"app",
".",
"getNodeState",
")",
"{",
"brackets",
".",
"app",
".",
"getNodeState",
"(",
"function",
"(",
"err",
",",
"port",
")",
"{",
"if",
"(",
"er... | Logs the state of the current node server to the console. | [
"Logs",
"the",
"state",
"of",
"the",
"current",
"node",
"server",
"to",
"the",
"console",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/DebugCommands/NodeDebugUtils.js#L47-L59 |
1,928 | adobe/brackets | src/extensions/default/DebugCommands/NodeDebugUtils.js | restartNode | function restartNode() {
try {
_nodeConnection.domains.base.restartNode();
} catch (e) {
window.alert("Failed trying to restart Node: " + e.message);
}
} | javascript | function restartNode() {
try {
_nodeConnection.domains.base.restartNode();
} catch (e) {
window.alert("Failed trying to restart Node: " + e.message);
}
} | [
"function",
"restartNode",
"(",
")",
"{",
"try",
"{",
"_nodeConnection",
".",
"domains",
".",
"base",
".",
"restartNode",
"(",
")",
";",
"}",
"catch",
"(",
"e",
")",
"{",
"window",
".",
"alert",
"(",
"\"Failed trying to restart Node: \"",
"+",
"e",
".",
... | Sends a command to node to cause a restart. | [
"Sends",
"a",
"command",
"to",
"node",
"to",
"cause",
"a",
"restart",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/DebugCommands/NodeDebugUtils.js#L64-L70 |
1,929 | adobe/brackets | src/extensions/default/DebugCommands/NodeDebugUtils.js | enableDebugger | function enableDebugger() {
try {
_nodeConnection.domains.base.enableDebugger();
} catch (e) {
window.alert("Failed trying to enable Node debugger: " + e.message);
}
} | javascript | function enableDebugger() {
try {
_nodeConnection.domains.base.enableDebugger();
} catch (e) {
window.alert("Failed trying to enable Node debugger: " + e.message);
}
} | [
"function",
"enableDebugger",
"(",
")",
"{",
"try",
"{",
"_nodeConnection",
".",
"domains",
".",
"base",
".",
"enableDebugger",
"(",
")",
";",
"}",
"catch",
"(",
"e",
")",
"{",
"window",
".",
"alert",
"(",
"\"Failed trying to enable Node debugger: \"",
"+",
... | Sends a command to node to enable the debugger. | [
"Sends",
"a",
"command",
"to",
"node",
"to",
"enable",
"the",
"debugger",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/DebugCommands/NodeDebugUtils.js#L75-L81 |
1,930 | adobe/brackets | src/extensions/default/CSSCodeHints/main.js | formatHints | function formatHints(hints, query) {
var hasColorSwatch = hints.some(function (token) {
return token.color;
});
StringMatch.basicMatchSort(hints);
return hints.map(function (token) {
var $hintObj = $("<span>").addClass("brackets-css-hints");
// highl... | javascript | function formatHints(hints, query) {
var hasColorSwatch = hints.some(function (token) {
return token.color;
});
StringMatch.basicMatchSort(hints);
return hints.map(function (token) {
var $hintObj = $("<span>").addClass("brackets-css-hints");
// highl... | [
"function",
"formatHints",
"(",
"hints",
",",
"query",
")",
"{",
"var",
"hasColorSwatch",
"=",
"hints",
".",
"some",
"(",
"function",
"(",
"token",
")",
"{",
"return",
"token",
".",
"color",
";",
"}",
")",
";",
"StringMatch",
".",
"basicMatchSort",
"(",
... | Returns a sorted and formatted list of hints with the query substring
highlighted.
@param {Array.<Object>} hints - the list of hints to format
@param {string} query - querystring used for highlighting matched
portions of each hint
@return {Array.jQuery} sorted Array of jQuery DOM elements to insert | [
"Returns",
"a",
"sorted",
"and",
"formatted",
"list",
"of",
"hints",
"with",
"the",
"query",
"substring",
"highlighted",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CSSCodeHints/main.js#L193-L223 |
1,931 | adobe/brackets | src/filesystem/FileSystemEntry.js | compareFilesWithIndices | function compareFilesWithIndices(index1, index2) {
return entries[index1]._name.toLocaleLowerCase().localeCompare(entries[index2]._name.toLocaleLowerCase());
} | javascript | function compareFilesWithIndices(index1, index2) {
return entries[index1]._name.toLocaleLowerCase().localeCompare(entries[index2]._name.toLocaleLowerCase());
} | [
"function",
"compareFilesWithIndices",
"(",
"index1",
",",
"index2",
")",
"{",
"return",
"entries",
"[",
"index1",
"]",
".",
"_name",
".",
"toLocaleLowerCase",
"(",
")",
".",
"localeCompare",
"(",
"entries",
"[",
"index2",
"]",
".",
"_name",
".",
"toLocaleLo... | sort entries if required | [
"sort",
"entries",
"if",
"required"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/filesystem/FileSystemEntry.js#L510-L512 |
1,932 | adobe/brackets | src/search/node/FindInFilesDomain.js | offsetToLineNum | function offsetToLineNum(textOrLines, offset) {
if (Array.isArray(textOrLines)) {
var lines = textOrLines,
total = 0,
line;
for (line = 0; line < lines.length; line++) {
if (total < offset) {
// add 1 per line since /n were removed by splitting, bu... | javascript | function offsetToLineNum(textOrLines, offset) {
if (Array.isArray(textOrLines)) {
var lines = textOrLines,
total = 0,
line;
for (line = 0; line < lines.length; line++) {
if (total < offset) {
// add 1 per line since /n were removed by splitting, bu... | [
"function",
"offsetToLineNum",
"(",
"textOrLines",
",",
"offset",
")",
"{",
"if",
"(",
"Array",
".",
"isArray",
"(",
"textOrLines",
")",
")",
"{",
"var",
"lines",
"=",
"textOrLines",
",",
"total",
"=",
"0",
",",
"line",
";",
"for",
"(",
"line",
"=",
... | Copied from StringUtils.js
Returns a line number corresponding to an offset in some text. The text can
be specified as a single string or as an array of strings that correspond to
the lines of the string.
Specify the text in lines when repeatedly calling the function on the same
text in a loop. Use getLines() to divid... | [
"Copied",
"from",
"StringUtils",
".",
"js",
"Returns",
"a",
"line",
"number",
"corresponding",
"to",
"an",
"offset",
"in",
"some",
"text",
".",
"The",
"text",
"can",
"be",
"specified",
"as",
"a",
"single",
"string",
"or",
"as",
"an",
"array",
"of",
"stri... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/node/FindInFilesDomain.js#L68-L94 |
1,933 | adobe/brackets | src/search/node/FindInFilesDomain.js | getSearchMatches | function getSearchMatches(contents, queryExpr) {
if (!contents) {
return;
}
// Quick exit if not found or if we hit the limit
if (foundMaximum || contents.search(queryExpr) === -1) {
return [];
}
var match, lineNum, line, ch, totalMatchLength, matchedLines, numMatchedLines, last... | javascript | function getSearchMatches(contents, queryExpr) {
if (!contents) {
return;
}
// Quick exit if not found or if we hit the limit
if (foundMaximum || contents.search(queryExpr) === -1) {
return [];
}
var match, lineNum, line, ch, totalMatchLength, matchedLines, numMatchedLines, last... | [
"function",
"getSearchMatches",
"(",
"contents",
",",
"queryExpr",
")",
"{",
"if",
"(",
"!",
"contents",
")",
"{",
"return",
";",
"}",
"// Quick exit if not found or if we hit the limit",
"if",
"(",
"foundMaximum",
"||",
"contents",
".",
"search",
"(",
"queryExpr"... | Searches through the contents and returns an array of matches
@param {string} contents
@param {RegExp} queryExpr
@return {!Array.<{start: {line:number,ch:number}, end: {line:number,ch:number}, line: string}>} | [
"Searches",
"through",
"the",
"contents",
"and",
"returns",
"an",
"array",
"of",
"matches"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/node/FindInFilesDomain.js#L102-L180 |
1,934 | adobe/brackets | src/search/node/FindInFilesDomain.js | getFilesizeInBytes | function getFilesizeInBytes(fileName) {
try {
var stats = fs.statSync(fileName);
return stats.size || 0;
} catch (ex) {
console.log(ex);
return 0;
}
} | javascript | function getFilesizeInBytes(fileName) {
try {
var stats = fs.statSync(fileName);
return stats.size || 0;
} catch (ex) {
console.log(ex);
return 0;
}
} | [
"function",
"getFilesizeInBytes",
"(",
"fileName",
")",
"{",
"try",
"{",
"var",
"stats",
"=",
"fs",
".",
"statSync",
"(",
"fileName",
")",
";",
"return",
"stats",
".",
"size",
"||",
"0",
";",
"}",
"catch",
"(",
"ex",
")",
"{",
"console",
".",
"log",
... | Gets the file size in bytes.
@param {string} fileName The name of the file to get the size
@returns {Number} the file size in bytes | [
"Gets",
"the",
"file",
"size",
"in",
"bytes",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/node/FindInFilesDomain.js#L195-L203 |
1,935 | adobe/brackets | src/search/node/FindInFilesDomain.js | setResults | function setResults(fullpath, resultInfo, maxResultsToReturn) {
if (results[fullpath]) {
numMatches -= results[fullpath].matches.length;
delete results[fullpath];
}
if (foundMaximum || !resultInfo || !resultInfo.matches || !resultInfo.matches.length) {
return;
}
// Make sur... | javascript | function setResults(fullpath, resultInfo, maxResultsToReturn) {
if (results[fullpath]) {
numMatches -= results[fullpath].matches.length;
delete results[fullpath];
}
if (foundMaximum || !resultInfo || !resultInfo.matches || !resultInfo.matches.length) {
return;
}
// Make sur... | [
"function",
"setResults",
"(",
"fullpath",
",",
"resultInfo",
",",
"maxResultsToReturn",
")",
"{",
"if",
"(",
"results",
"[",
"fullpath",
"]",
")",
"{",
"numMatches",
"-=",
"results",
"[",
"fullpath",
"]",
".",
"matches",
".",
"length",
";",
"delete",
"res... | Sets the list of matches for the given path, removing the previous match info, if any, and updating
the total match count. Note that for the count to remain accurate, the previous match info must not have
been mutated since it was set.
@param {string} fullpath Full path to the file containing the matches.
@param {!{mat... | [
"Sets",
"the",
"list",
"of",
"matches",
"for",
"the",
"given",
"path",
"removing",
"the",
"previous",
"match",
"info",
"if",
"any",
"and",
"updating",
"the",
"total",
"match",
"count",
".",
"Note",
"that",
"for",
"the",
"count",
"to",
"remain",
"accurate",... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/node/FindInFilesDomain.js#L237-L258 |
1,936 | adobe/brackets | src/search/node/FindInFilesDomain.js | doSearchInOneFile | function doSearchInOneFile(filepath, text, queryExpr, maxResultsToReturn) {
var matches = getSearchMatches(text, queryExpr);
setResults(filepath, {matches: matches}, maxResultsToReturn);
} | javascript | function doSearchInOneFile(filepath, text, queryExpr, maxResultsToReturn) {
var matches = getSearchMatches(text, queryExpr);
setResults(filepath, {matches: matches}, maxResultsToReturn);
} | [
"function",
"doSearchInOneFile",
"(",
"filepath",
",",
"text",
",",
"queryExpr",
",",
"maxResultsToReturn",
")",
"{",
"var",
"matches",
"=",
"getSearchMatches",
"(",
"text",
",",
"queryExpr",
")",
";",
"setResults",
"(",
"filepath",
",",
"{",
"matches",
":",
... | Finds search results in the given file and adds them to 'results'
@param {string} filepath
@param {string} text contents of the file
@param {Object} queryExpr
@param {number} maxResultsToReturn the maximum of results that should be returned in the current search. | [
"Finds",
"search",
"results",
"in",
"the",
"given",
"file",
"and",
"adds",
"them",
"to",
"results"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/node/FindInFilesDomain.js#L267-L270 |
1,937 | adobe/brackets | src/search/node/FindInFilesDomain.js | doSearchInFiles | function doSearchInFiles(fileList, queryExpr, startFileIndex, maxResultsToReturn) {
var i;
if (fileList.length === 0) {
console.log('no files found');
return;
} else {
startFileIndex = startFileIndex || 0;
for (i = startFileIndex; i < fileList.length && !foundMaximum; i++) {... | javascript | function doSearchInFiles(fileList, queryExpr, startFileIndex, maxResultsToReturn) {
var i;
if (fileList.length === 0) {
console.log('no files found');
return;
} else {
startFileIndex = startFileIndex || 0;
for (i = startFileIndex; i < fileList.length && !foundMaximum; i++) {... | [
"function",
"doSearchInFiles",
"(",
"fileList",
",",
"queryExpr",
",",
"startFileIndex",
",",
"maxResultsToReturn",
")",
"{",
"var",
"i",
";",
"if",
"(",
"fileList",
".",
"length",
"===",
"0",
")",
"{",
"console",
".",
"log",
"(",
"'no files found'",
")",
... | Search in the list of files given and populate the results
@param {array} fileList array of file paths
@param {Object} queryExpr
@param {number} startFileIndex the start index of the array from which the search has to be done
@param {number} maxResultsToReturn the maximum number of results to return in th... | [
"Search",
"in",
"the",
"list",
"of",
"files",
"given",
"and",
"populate",
"the",
"results"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/node/FindInFilesDomain.js#L279-L292 |
1,938 | adobe/brackets | src/search/node/FindInFilesDomain.js | fileCrawler | function fileCrawler() {
if (!files || (files && files.length === 0)) {
setTimeout(fileCrawler, 1000);
return;
}
var contents = "";
if (currentCrawlIndex < files.length) {
contents = getFileContentsForFile(files[currentCrawlIndex]);
if (contents) {
cacheSize +... | javascript | function fileCrawler() {
if (!files || (files && files.length === 0)) {
setTimeout(fileCrawler, 1000);
return;
}
var contents = "";
if (currentCrawlIndex < files.length) {
contents = getFileContentsForFile(files[currentCrawlIndex]);
if (contents) {
cacheSize +... | [
"function",
"fileCrawler",
"(",
")",
"{",
"if",
"(",
"!",
"files",
"||",
"(",
"files",
"&&",
"files",
".",
"length",
"===",
"0",
")",
")",
"{",
"setTimeout",
"(",
"fileCrawler",
",",
"1000",
")",
";",
"return",
";",
"}",
"var",
"contents",
"=",
"\"... | Crawls through the files in the project ans stores them in cache. Since that could take a while
we do it in batches so that node wont be blocked. | [
"Crawls",
"through",
"the",
"files",
"in",
"the",
"project",
"ans",
"stores",
"them",
"in",
"cache",
".",
"Since",
"that",
"could",
"take",
"a",
"while",
"we",
"do",
"it",
"in",
"batches",
"so",
"that",
"node",
"wont",
"be",
"blocked",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/node/FindInFilesDomain.js#L343-L367 |
1,939 | adobe/brackets | src/search/node/FindInFilesDomain.js | countNumMatches | function countNumMatches(contents, queryExpr) {
if (!contents) {
return 0;
}
var matches = contents.match(queryExpr);
return matches ? matches.length : 0;
} | javascript | function countNumMatches(contents, queryExpr) {
if (!contents) {
return 0;
}
var matches = contents.match(queryExpr);
return matches ? matches.length : 0;
} | [
"function",
"countNumMatches",
"(",
"contents",
",",
"queryExpr",
")",
"{",
"if",
"(",
"!",
"contents",
")",
"{",
"return",
"0",
";",
"}",
"var",
"matches",
"=",
"contents",
".",
"match",
"(",
"queryExpr",
")",
";",
"return",
"matches",
"?",
"matches",
... | Counts the number of matches matching the queryExpr in the given contents
@param {String} contents The contents to search on
@param {Object} queryExpr
@return {number} number of matches | [
"Counts",
"the",
"number",
"of",
"matches",
"matching",
"the",
"queryExpr",
"in",
"the",
"given",
"contents"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/node/FindInFilesDomain.js#L388-L394 |
1,940 | adobe/brackets | src/search/node/FindInFilesDomain.js | getNumMatches | function getNumMatches(fileList, queryExpr) {
var i,
matches = 0;
for (i = 0; i < fileList.length; i++) {
var temp = countNumMatches(getFileContentsForFile(fileList[i]), queryExpr);
if (temp) {
numFiles++;
matches += temp;
}
if (matches > MAX_TOTAL... | javascript | function getNumMatches(fileList, queryExpr) {
var i,
matches = 0;
for (i = 0; i < fileList.length; i++) {
var temp = countNumMatches(getFileContentsForFile(fileList[i]), queryExpr);
if (temp) {
numFiles++;
matches += temp;
}
if (matches > MAX_TOTAL... | [
"function",
"getNumMatches",
"(",
"fileList",
",",
"queryExpr",
")",
"{",
"var",
"i",
",",
"matches",
"=",
"0",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"fileList",
".",
"length",
";",
"i",
"++",
")",
"{",
"var",
"temp",
"=",
"countNumMatches... | Get the total number of matches from all the files in fileList
@param {array} fileList file path array
@param {Object} queryExpr
@return {Number} total number of matches | [
"Get",
"the",
"total",
"number",
"of",
"matches",
"from",
"all",
"the",
"files",
"in",
"fileList"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/node/FindInFilesDomain.js#L402-L417 |
1,941 | adobe/brackets | src/search/node/FindInFilesDomain.js | doSearch | function doSearch(searchObject, nextPages) {
savedSearchObject = searchObject;
if (!files) {
console.log("no file object found");
return {};
}
results = {};
numMatches = 0;
numFiles = 0;
foundMaximum = false;
if (!nextPages) {
exceedsMaximum = false;
eval... | javascript | function doSearch(searchObject, nextPages) {
savedSearchObject = searchObject;
if (!files) {
console.log("no file object found");
return {};
}
results = {};
numMatches = 0;
numFiles = 0;
foundMaximum = false;
if (!nextPages) {
exceedsMaximum = false;
eval... | [
"function",
"doSearch",
"(",
"searchObject",
",",
"nextPages",
")",
"{",
"savedSearchObject",
"=",
"searchObject",
";",
"if",
"(",
"!",
"files",
")",
"{",
"console",
".",
"log",
"(",
"\"no file object found\"",
")",
";",
"return",
"{",
"}",
";",
"}",
"resu... | Do a search with the searchObject context and return the results
@param {Object} searchObject
@param {boolean} nextPages set to true if to indicate that next page of an existing page is being fetched
@return {Object} search results | [
"Do",
"a",
"search",
"with",
"the",
"searchObject",
"context",
"and",
"return",
"the",
"results"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/node/FindInFilesDomain.js#L425-L466 |
1,942 | adobe/brackets | src/search/node/FindInFilesDomain.js | removeFilesFromCache | function removeFilesFromCache(updateObject) {
var fileList = updateObject.fileList || [],
filesInSearchScope = updateObject.filesInSearchScope || [],
i = 0;
for (i = 0; i < fileList.length; i++) {
delete projectCache[fileList[i]];
}
function isNotInRemovedFilesList(path) {
... | javascript | function removeFilesFromCache(updateObject) {
var fileList = updateObject.fileList || [],
filesInSearchScope = updateObject.filesInSearchScope || [],
i = 0;
for (i = 0; i < fileList.length; i++) {
delete projectCache[fileList[i]];
}
function isNotInRemovedFilesList(path) {
... | [
"function",
"removeFilesFromCache",
"(",
"updateObject",
")",
"{",
"var",
"fileList",
"=",
"updateObject",
".",
"fileList",
"||",
"[",
"]",
",",
"filesInSearchScope",
"=",
"updateObject",
".",
"filesInSearchScope",
"||",
"[",
"]",
",",
"i",
"=",
"0",
";",
"f... | Remove the list of given files from the project cache
@param {Object} updateObject | [
"Remove",
"the",
"list",
"of",
"given",
"files",
"from",
"the",
"project",
"cache"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/node/FindInFilesDomain.js#L472-L483 |
1,943 | adobe/brackets | src/search/node/FindInFilesDomain.js | addFilesToCache | function addFilesToCache(updateObject) {
var fileList = updateObject.fileList || [],
filesInSearchScope = updateObject.filesInSearchScope || [],
i = 0,
changedFilesAlreadyInList = [],
newFiles = [];
for (i = 0; i < fileList.length; i++) {
// We just add a null entry indic... | javascript | function addFilesToCache(updateObject) {
var fileList = updateObject.fileList || [],
filesInSearchScope = updateObject.filesInSearchScope || [],
i = 0,
changedFilesAlreadyInList = [],
newFiles = [];
for (i = 0; i < fileList.length; i++) {
// We just add a null entry indic... | [
"function",
"addFilesToCache",
"(",
"updateObject",
")",
"{",
"var",
"fileList",
"=",
"updateObject",
".",
"fileList",
"||",
"[",
"]",
",",
"filesInSearchScope",
"=",
"updateObject",
".",
"filesInSearchScope",
"||",
"[",
"]",
",",
"i",
"=",
"0",
",",
"change... | Adds the list of given files to the project cache. However the files will not be
read at this time. We just delete the project cache entry which will trigger a fetch on search.
@param {Object} updateObject | [
"Adds",
"the",
"list",
"of",
"given",
"files",
"to",
"the",
"project",
"cache",
".",
"However",
"the",
"files",
"will",
"not",
"be",
"read",
"at",
"this",
"time",
".",
"We",
"just",
"delete",
"the",
"project",
"cache",
"entry",
"which",
"will",
"trigger"... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/node/FindInFilesDomain.js#L490-L512 |
1,944 | adobe/brackets | src/search/node/FindInFilesDomain.js | getNextPage | function getNextPage() {
var send_object = {
"results": {},
"numMatches": 0,
"foundMaximum": foundMaximum,
"exceedsMaximum": exceedsMaximum
};
if (!savedSearchObject) {
return send_object;
}
savedSearchObject.startFileIndex = lastSearchedIndex;
return d... | javascript | function getNextPage() {
var send_object = {
"results": {},
"numMatches": 0,
"foundMaximum": foundMaximum,
"exceedsMaximum": exceedsMaximum
};
if (!savedSearchObject) {
return send_object;
}
savedSearchObject.startFileIndex = lastSearchedIndex;
return d... | [
"function",
"getNextPage",
"(",
")",
"{",
"var",
"send_object",
"=",
"{",
"\"results\"",
":",
"{",
"}",
",",
"\"numMatches\"",
":",
"0",
",",
"\"foundMaximum\"",
":",
"foundMaximum",
",",
"\"exceedsMaximum\"",
":",
"exceedsMaximum",
"}",
";",
"if",
"(",
"!",... | Gets the next page of results of the ongoing search
@return {Object} search results | [
"Gets",
"the",
"next",
"page",
"of",
"results",
"of",
"the",
"ongoing",
"search"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/node/FindInFilesDomain.js#L526-L538 |
1,945 | adobe/brackets | src/search/node/FindInFilesDomain.js | getAllResults | function getAllResults() {
var send_object = {
"results": {},
"numMatches": 0,
"foundMaximum": foundMaximum,
"exceedsMaximum": exceedsMaximum
};
if (!savedSearchObject) {
return send_object;
}
savedSearchObject.startFileIndex = 0;
savedSearchObject.getA... | javascript | function getAllResults() {
var send_object = {
"results": {},
"numMatches": 0,
"foundMaximum": foundMaximum,
"exceedsMaximum": exceedsMaximum
};
if (!savedSearchObject) {
return send_object;
}
savedSearchObject.startFileIndex = 0;
savedSearchObject.getA... | [
"function",
"getAllResults",
"(",
")",
"{",
"var",
"send_object",
"=",
"{",
"\"results\"",
":",
"{",
"}",
",",
"\"numMatches\"",
":",
"0",
",",
"\"foundMaximum\"",
":",
"foundMaximum",
",",
"\"exceedsMaximum\"",
":",
"exceedsMaximum",
"}",
";",
"if",
"(",
"!... | Gets all the results for the saved search query if present or empty search results
@return {Object} The results object | [
"Gets",
"all",
"the",
"results",
"for",
"the",
"saved",
"search",
"query",
"if",
"present",
"or",
"empty",
"search",
"results"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/node/FindInFilesDomain.js#L544-L557 |
1,946 | adobe/brackets | src/widgets/Dialogs.js | function (e, autoDismiss) {
var $primaryBtn = this.find(".primary"),
buttonId = null,
which = String.fromCharCode(e.which),
$focusedElement = this.find(".dialog-button:focus, a:focus");
function stopEvent() {
e.preventDefault();
... | javascript | function (e, autoDismiss) {
var $primaryBtn = this.find(".primary"),
buttonId = null,
which = String.fromCharCode(e.which),
$focusedElement = this.find(".dialog-button:focus, a:focus");
function stopEvent() {
e.preventDefault();
... | [
"function",
"(",
"e",
",",
"autoDismiss",
")",
"{",
"var",
"$primaryBtn",
"=",
"this",
".",
"find",
"(",
"\".primary\"",
")",
",",
"buttonId",
"=",
"null",
",",
"which",
"=",
"String",
".",
"fromCharCode",
"(",
"e",
".",
"which",
")",
",",
"$focusedEle... | Handles the keyDown event for the dialogs
@param {$.Event} e
@param {boolean} autoDismiss
@return {boolean} | [
"Handles",
"the",
"keyDown",
"event",
"for",
"the",
"dialogs"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/widgets/Dialogs.js#L142-L207 | |
1,947 | adobe/brackets | src/widgets/Dialogs.js | setDialogMaxSize | function setDialogMaxSize() {
var maxWidth, maxHeight,
$dlgs = $(".modal-inner-wrapper > .instance");
// Verify 1 or more modal dialogs are showing
if ($dlgs.length > 0) {
maxWidth = $("body").width();
maxHeight = $("body").height();
$dlgs.css({... | javascript | function setDialogMaxSize() {
var maxWidth, maxHeight,
$dlgs = $(".modal-inner-wrapper > .instance");
// Verify 1 or more modal dialogs are showing
if ($dlgs.length > 0) {
maxWidth = $("body").width();
maxHeight = $("body").height();
$dlgs.css({... | [
"function",
"setDialogMaxSize",
"(",
")",
"{",
"var",
"maxWidth",
",",
"maxHeight",
",",
"$dlgs",
"=",
"$",
"(",
"\".modal-inner-wrapper > .instance\"",
")",
";",
"// Verify 1 or more modal dialogs are showing",
"if",
"(",
"$dlgs",
".",
"length",
">",
"0",
")",
"{... | Don't allow dialog to exceed viewport size | [
"Don",
"t",
"allow",
"dialog",
"to",
"exceed",
"viewport",
"size"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/widgets/Dialogs.js#L260-L275 |
1,948 | adobe/brackets | src/widgets/Dialogs.js | showModalDialog | function showModalDialog(dlgClass, title, message, buttons, autoDismiss) {
var templateVars = {
dlgClass: dlgClass,
title: title || "",
message: message || "",
buttons: buttons || [{ className: DIALOG_BTN_CLASS_PRIMARY, id: DIALOG_BTN_OK, text: Strings.OK }... | javascript | function showModalDialog(dlgClass, title, message, buttons, autoDismiss) {
var templateVars = {
dlgClass: dlgClass,
title: title || "",
message: message || "",
buttons: buttons || [{ className: DIALOG_BTN_CLASS_PRIMARY, id: DIALOG_BTN_OK, text: Strings.OK }... | [
"function",
"showModalDialog",
"(",
"dlgClass",
",",
"title",
",",
"message",
",",
"buttons",
",",
"autoDismiss",
")",
"{",
"var",
"templateVars",
"=",
"{",
"dlgClass",
":",
"dlgClass",
",",
"title",
":",
"title",
"||",
"\"\"",
",",
"message",
":",
"messag... | Creates a new general purpose modal dialog using the default template and the template variables given
as parameters as described.
@param {string} dlgClass A class name identifier for the dialog. Typically one of DefaultDialogs.*
@param {string=} title The title of the dialog. Can contain HTML markup. Defaults to "".
... | [
"Creates",
"a",
"new",
"general",
"purpose",
"modal",
"dialog",
"using",
"the",
"default",
"template",
"and",
"the",
"template",
"variables",
"given",
"as",
"parameters",
"as",
"described",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/widgets/Dialogs.js#L397-L407 |
1,949 | adobe/brackets | src/utils/BuildInfoUtils.js | _loadSHA | function _loadSHA(path, callback) {
var result = new $.Deferred();
if (brackets.inBrowser) {
result.reject();
} else {
// HEAD contains a SHA in detached-head mode; otherwise it contains a relative path
// to a file in /refs which in turn contains the SHA
... | javascript | function _loadSHA(path, callback) {
var result = new $.Deferred();
if (brackets.inBrowser) {
result.reject();
} else {
// HEAD contains a SHA in detached-head mode; otherwise it contains a relative path
// to a file in /refs which in turn contains the SHA
... | [
"function",
"_loadSHA",
"(",
"path",
",",
"callback",
")",
"{",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
";",
"if",
"(",
"brackets",
".",
"inBrowser",
")",
"{",
"result",
".",
"reject",
"(",
")",
";",
"}",
"else",
"{",
"// HEAD ... | Loads a SHA from Git metadata file. If the file contains a symbolic ref name, follows the ref
and loads the SHA from that file in turn. | [
"Loads",
"a",
"SHA",
"from",
"Git",
"metadata",
"file",
".",
"If",
"the",
"file",
"contains",
"a",
"symbolic",
"ref",
"name",
"follows",
"the",
"ref",
"and",
"loads",
"the",
"SHA",
"from",
"that",
"file",
"in",
"turn",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/BuildInfoUtils.js#L41-L71 |
1,950 | adobe/brackets | src/utils/UpdateNotification.js | _getVersionInfoUrl | function _getVersionInfoUrl(locale, removeCountryPartOfLocale) {
locale = locale || brackets.getLocale();
if (removeCountryPartOfLocale) {
locale = locale.substring(0, 2);
}
//AUTOUPDATE_PRERELEASE_BEGIN
// The following code is needed for supporting Auto Update in... | javascript | function _getVersionInfoUrl(locale, removeCountryPartOfLocale) {
locale = locale || brackets.getLocale();
if (removeCountryPartOfLocale) {
locale = locale.substring(0, 2);
}
//AUTOUPDATE_PRERELEASE_BEGIN
// The following code is needed for supporting Auto Update in... | [
"function",
"_getVersionInfoUrl",
"(",
"locale",
",",
"removeCountryPartOfLocale",
")",
"{",
"locale",
"=",
"locale",
"||",
"brackets",
".",
"getLocale",
"(",
")",
";",
"if",
"(",
"removeCountryPartOfLocale",
")",
"{",
"locale",
"=",
"locale",
".",
"substring",
... | Construct a new version update url with the given locale.
@param {string=} locale - optional locale, defaults to 'brackets.getLocale()' when omitted.
@param {boolean=} removeCountryPartOfLocale - optional, remove existing country information from locale 'en-gb' => 'en'
return {string} the new version update url | [
"Construct",
"a",
"new",
"version",
"update",
"url",
"with",
"the",
"given",
"locale",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/UpdateNotification.js#L110-L145 |
1,951 | adobe/brackets | src/utils/UpdateNotification.js | _getUpdateInformation | function _getUpdateInformation(force, dontCache, _versionInfoUrl) {
// Last time the versionInfoURL was fetched
var lastInfoURLFetchTime = PreferencesManager.getViewState("lastInfoURLFetchTime");
var result = new $.Deferred();
var fetchData = false;
var data;
// If forc... | javascript | function _getUpdateInformation(force, dontCache, _versionInfoUrl) {
// Last time the versionInfoURL was fetched
var lastInfoURLFetchTime = PreferencesManager.getViewState("lastInfoURLFetchTime");
var result = new $.Deferred();
var fetchData = false;
var data;
// If forc... | [
"function",
"_getUpdateInformation",
"(",
"force",
",",
"dontCache",
",",
"_versionInfoUrl",
")",
"{",
"// Last time the versionInfoURL was fetched",
"var",
"lastInfoURLFetchTime",
"=",
"PreferencesManager",
".",
"getViewState",
"(",
"\"lastInfoURLFetchTime\"",
")",
";",
"v... | Get a data structure that has information for all builds of Brackets.
If force is true, the information is always fetched from _versionInfoURL.
If force is false, we try to use cached information. If more than
24 hours have passed since the last fetch, or if cached data can't be found,
the data is fetched again.
If n... | [
"Get",
"a",
"data",
"structure",
"that",
"has",
"information",
"for",
"all",
"builds",
"of",
"Brackets",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/UpdateNotification.js#L159-L262 |
1,952 | adobe/brackets | src/utils/UpdateNotification.js | _stripOldVersionInfo | function _stripOldVersionInfo(versionInfo, buildNumber) {
// Do a simple linear search. Since we are going in reverse-chronological order, we
// should get through the search quickly.
var lastIndex = 0;
var len = versionInfo.length;
var versionEntry;
var validBuildEntries... | javascript | function _stripOldVersionInfo(versionInfo, buildNumber) {
// Do a simple linear search. Since we are going in reverse-chronological order, we
// should get through the search quickly.
var lastIndex = 0;
var len = versionInfo.length;
var versionEntry;
var validBuildEntries... | [
"function",
"_stripOldVersionInfo",
"(",
"versionInfo",
",",
"buildNumber",
")",
"{",
"// Do a simple linear search. Since we are going in reverse-chronological order, we",
"// should get through the search quickly.",
"var",
"lastIndex",
"=",
"0",
";",
"var",
"len",
"=",
"version... | Return a new array of version information that is newer than "buildNumber".
Returns null if there is no new version information. | [
"Return",
"a",
"new",
"array",
"of",
"version",
"information",
"that",
"is",
"newer",
"than",
"buildNumber",
".",
"Returns",
"null",
"if",
"there",
"is",
"no",
"new",
"version",
"information",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/UpdateNotification.js#L275-L297 |
1,953 | adobe/brackets | src/utils/UpdateNotification.js | _showUpdateNotificationDialog | function _showUpdateNotificationDialog(updates, force) {
Dialogs.showModalDialogUsingTemplate(Mustache.render(UpdateDialogTemplate, Strings))
.done(function (id) {
if (id === Dialogs.DIALOG_BTN_DOWNLOAD) {
HealthLogger.sendAnalyticsData(
ev... | javascript | function _showUpdateNotificationDialog(updates, force) {
Dialogs.showModalDialogUsingTemplate(Mustache.render(UpdateDialogTemplate, Strings))
.done(function (id) {
if (id === Dialogs.DIALOG_BTN_DOWNLOAD) {
HealthLogger.sendAnalyticsData(
ev... | [
"function",
"_showUpdateNotificationDialog",
"(",
"updates",
",",
"force",
")",
"{",
"Dialogs",
".",
"showModalDialogUsingTemplate",
"(",
"Mustache",
".",
"render",
"(",
"UpdateDialogTemplate",
",",
"Strings",
")",
")",
".",
"done",
"(",
"function",
"(",
"id",
"... | Show a dialog that shows the update | [
"Show",
"a",
"dialog",
"that",
"shows",
"the",
"update"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/UpdateNotification.js#L302-L342 |
1,954 | adobe/brackets | src/utils/UpdateNotification.js | _onRegistryDownloaded | function _onRegistryDownloaded() {
var availableUpdates = ExtensionManager.getAvailableUpdates();
PreferencesManager.setViewState("extensionUpdateInfo", availableUpdates);
PreferencesManager.setViewState("lastExtensionRegistryCheckTime", (new Date()).getTime());
$("#toolbar-extension-man... | javascript | function _onRegistryDownloaded() {
var availableUpdates = ExtensionManager.getAvailableUpdates();
PreferencesManager.setViewState("extensionUpdateInfo", availableUpdates);
PreferencesManager.setViewState("lastExtensionRegistryCheckTime", (new Date()).getTime());
$("#toolbar-extension-man... | [
"function",
"_onRegistryDownloaded",
"(",
")",
"{",
"var",
"availableUpdates",
"=",
"ExtensionManager",
".",
"getAvailableUpdates",
"(",
")",
";",
"PreferencesManager",
".",
"setViewState",
"(",
"\"extensionUpdateInfo\"",
",",
"availableUpdates",
")",
";",
"PreferencesM... | Calculate state of notification everytime registries are downloaded - no matter who triggered the download | [
"Calculate",
"state",
"of",
"notification",
"everytime",
"registries",
"are",
"downloaded",
"-",
"no",
"matter",
"who",
"triggered",
"the",
"download"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/UpdateNotification.js#L347-L352 |
1,955 | adobe/brackets | src/utils/UpdateNotification.js | handleUpdateProcess | function handleUpdateProcess(updates) {
var handler = _updateProcessHandler || _defaultUpdateProcessHandler;
var initSuccess = handler(updates);
if (_updateProcessHandler && !initSuccess) {
// Give a chance to default handler in case
// the auot update mechanism has faile... | javascript | function handleUpdateProcess(updates) {
var handler = _updateProcessHandler || _defaultUpdateProcessHandler;
var initSuccess = handler(updates);
if (_updateProcessHandler && !initSuccess) {
// Give a chance to default handler in case
// the auot update mechanism has faile... | [
"function",
"handleUpdateProcess",
"(",
"updates",
")",
"{",
"var",
"handler",
"=",
"_updateProcessHandler",
"||",
"_defaultUpdateProcessHandler",
";",
"var",
"initSuccess",
"=",
"handler",
"(",
"updates",
")",
";",
"if",
"(",
"_updateProcessHandler",
"&&",
"!",
"... | Handles the update process
@param {Array} updates - array object containing info of updates | [
"Handles",
"the",
"update",
"process"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/UpdateNotification.js#L523-L531 |
1,956 | adobe/brackets | src/extensions/default/InlineColorEditor/ColorEditor.js | _0xColorToHex | function _0xColorToHex(color, convertToStr) {
var hexColor = tinycolor(color.replace("0x", "#"));
hexColor._format = "0x";
if (convertToStr) {
return hexColor.toString();
}
return hexColor;
} | javascript | function _0xColorToHex(color, convertToStr) {
var hexColor = tinycolor(color.replace("0x", "#"));
hexColor._format = "0x";
if (convertToStr) {
return hexColor.toString();
}
return hexColor;
} | [
"function",
"_0xColorToHex",
"(",
"color",
",",
"convertToStr",
")",
"{",
"var",
"hexColor",
"=",
"tinycolor",
"(",
"color",
".",
"replace",
"(",
"\"0x\"",
",",
"\"#\"",
")",
")",
";",
"hexColor",
".",
"_format",
"=",
"\"0x\"",
";",
"if",
"(",
"convertTo... | Converts 0x-prefixed color to hex
@param {string} color - Color to convert
@param {boolean} convertToString - true if color should
be returned as string
@returns {tinycolor|string} - Hex color as a Tinycolor object
or a hex string | [
"Converts",
"0x",
"-",
"prefixed",
"color",
"to",
"hex"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineColorEditor/ColorEditor.js#L71-L79 |
1,957 | adobe/brackets | src/extensions/default/InlineColorEditor/ColorEditor.js | checkSetFormat | function checkSetFormat(color, convertToStr) {
if ((/^0x/).test(color)) {
return _0xColorToHex(color, convertToStr);
}
if (convertToStr) {
return tinycolor(color).toString();
}
return tinycolor(color);
} | javascript | function checkSetFormat(color, convertToStr) {
if ((/^0x/).test(color)) {
return _0xColorToHex(color, convertToStr);
}
if (convertToStr) {
return tinycolor(color).toString();
}
return tinycolor(color);
} | [
"function",
"checkSetFormat",
"(",
"color",
",",
"convertToStr",
")",
"{",
"if",
"(",
"(",
"/",
"^0x",
"/",
")",
".",
"test",
"(",
"color",
")",
")",
"{",
"return",
"_0xColorToHex",
"(",
"color",
",",
"convertToStr",
")",
";",
"}",
"if",
"(",
"conver... | Ensures that a string is in Tinycolor supported format
@param {string} color - Color to check the format for
@param {boolean} convertToString - true if color should
be returned as string
@returns {tinycolor|string} - Color as a Tinycolor object
or a hex string | [
"Ensures",
"that",
"a",
"string",
"is",
"in",
"Tinycolor",
"supported",
"format"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineColorEditor/ColorEditor.js#L89-L97 |
1,958 | adobe/brackets | src/extensions/default/InlineColorEditor/ColorEditor.js | ColorEditor | function ColorEditor($parent, color, callback, swatches) {
// Create the DOM structure, filling in localized strings via Mustache
this.$element = $(Mustache.render(ColorEditorTemplate, Strings));
$parent.append(this.$element);
this._callback = callback;
this._handleKeydown = th... | javascript | function ColorEditor($parent, color, callback, swatches) {
// Create the DOM structure, filling in localized strings via Mustache
this.$element = $(Mustache.render(ColorEditorTemplate, Strings));
$parent.append(this.$element);
this._callback = callback;
this._handleKeydown = th... | [
"function",
"ColorEditor",
"(",
"$parent",
",",
"color",
",",
"callback",
",",
"swatches",
")",
"{",
"// Create the DOM structure, filling in localized strings via Mustache",
"this",
".",
"$element",
"=",
"$",
"(",
"Mustache",
".",
"render",
"(",
"ColorEditorTemplate",
... | Color picker control; may be used standalone or within an InlineColorEditor inline widget.
@param {!jQuery} $parent DOM node into which to append the root of the color picker UI
@param {!string} color Initially selected color
@param {!function(string)} callback Called whenever selected color changes
@param {!Array.<... | [
"Color",
"picker",
"control",
";",
"may",
"be",
"used",
"standalone",
"or",
"within",
"an",
"InlineColorEditor",
"inline",
"widget",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/InlineColorEditor/ColorEditor.js#L106-L159 |
1,959 | adobe/brackets | src/search/FindBar.js | _handleKeydown | function _handleKeydown(e) {
if (e.keyCode === KeyEvent.DOM_VK_ESCAPE) {
e.stopPropagation();
e.preventDefault();
self.close();
}
} | javascript | function _handleKeydown(e) {
if (e.keyCode === KeyEvent.DOM_VK_ESCAPE) {
e.stopPropagation();
e.preventDefault();
self.close();
}
} | [
"function",
"_handleKeydown",
"(",
"e",
")",
"{",
"if",
"(",
"e",
".",
"keyCode",
"===",
"KeyEvent",
".",
"DOM_VK_ESCAPE",
")",
"{",
"e",
".",
"stopPropagation",
"(",
")",
";",
"e",
".",
"preventDefault",
"(",
")",
";",
"self",
".",
"close",
"(",
")"... | Done this way because ModalBar.js seems to react unreliably when modifying it to handle the escape key - the findbar wasn't getting closed as it should, instead persisting in the background | [
"Done",
"this",
"way",
"because",
"ModalBar",
".",
"js",
"seems",
"to",
"react",
"unreliably",
"when",
"modifying",
"it",
"to",
"handle",
"the",
"escape",
"key",
"-",
"the",
"findbar",
"wasn",
"t",
"getting",
"closed",
"as",
"it",
"should",
"instead",
"per... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/search/FindBar.js#L288-L294 |
1,960 | adobe/brackets | src/extensions/default/RemoteFileAdapter/main.js | _setMenuItemsVisible | function _setMenuItemsVisible() {
var file = MainViewManager.getCurrentlyViewedFile(MainViewManager.ACTIVE_PANE),
cMenuItems = [Commands.FILE_SAVE, Commands.FILE_RENAME, Commands.NAVIGATE_SHOW_IN_FILE_TREE, Commands.NAVIGATE_SHOW_IN_OS],
// Enable menu options when no file is present in ... | javascript | function _setMenuItemsVisible() {
var file = MainViewManager.getCurrentlyViewedFile(MainViewManager.ACTIVE_PANE),
cMenuItems = [Commands.FILE_SAVE, Commands.FILE_RENAME, Commands.NAVIGATE_SHOW_IN_FILE_TREE, Commands.NAVIGATE_SHOW_IN_OS],
// Enable menu options when no file is present in ... | [
"function",
"_setMenuItemsVisible",
"(",
")",
"{",
"var",
"file",
"=",
"MainViewManager",
".",
"getCurrentlyViewedFile",
"(",
"MainViewManager",
".",
"ACTIVE_PANE",
")",
",",
"cMenuItems",
"=",
"[",
"Commands",
".",
"FILE_SAVE",
",",
"Commands",
".",
"FILE_RENAME"... | Disable context menus which are not useful for remote file | [
"Disable",
"context",
"menus",
"which",
"are",
"not",
"useful",
"for",
"remote",
"file"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/RemoteFileAdapter/main.js#L59-L69 |
1,961 | adobe/brackets | src/extensions/default/JavaScriptRefactoring/RefactoringUtils.js | getUniqueIdentifierName | function getUniqueIdentifierName(scopes, prefix, num) {
if (!scopes) {
return prefix;
}
var props = scopes.reduce(function(props, scope) {
return _.union(props, _.keys(scope.props));
}, []);
if (!props) {
return prefix;
}
num... | javascript | function getUniqueIdentifierName(scopes, prefix, num) {
if (!scopes) {
return prefix;
}
var props = scopes.reduce(function(props, scope) {
return _.union(props, _.keys(scope.props));
}, []);
if (!props) {
return prefix;
}
num... | [
"function",
"getUniqueIdentifierName",
"(",
"scopes",
",",
"prefix",
",",
"num",
")",
"{",
"if",
"(",
"!",
"scopes",
")",
"{",
"return",
"prefix",
";",
"}",
"var",
"props",
"=",
"scopes",
".",
"reduce",
"(",
"function",
"(",
"props",
",",
"scope",
")",... | Gets a unique identifier name in the scope that starts with prefix
@param {!Scope} scopes - an array of all scopes returned from tern (each element contains 'props' with identifiers
in that scope)
@param {!string} prefix - prefix of the identifier
@param {number} num - number to start checking for
@return {!string} ide... | [
"Gets",
"a",
"unique",
"identifier",
"name",
"in",
"the",
"scope",
"that",
"starts",
"with",
"prefix"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/JavaScriptRefactoring/RefactoringUtils.js#L148-L171 |
1,962 | adobe/brackets | src/extensions/default/JavaScriptRefactoring/RefactoringUtils.js | isStandAloneExpression | function isStandAloneExpression(text) {
var found = ASTWalker.findNodeAt(getAST(text), 0, text.length, function (nodeType, node) {
if (nodeType === "Expression") {
return true;
}
return false;
});
return found && found.node;
} | javascript | function isStandAloneExpression(text) {
var found = ASTWalker.findNodeAt(getAST(text), 0, text.length, function (nodeType, node) {
if (nodeType === "Expression") {
return true;
}
return false;
});
return found && found.node;
} | [
"function",
"isStandAloneExpression",
"(",
"text",
")",
"{",
"var",
"found",
"=",
"ASTWalker",
".",
"findNodeAt",
"(",
"getAST",
"(",
"text",
")",
",",
"0",
",",
"text",
".",
"length",
",",
"function",
"(",
"nodeType",
",",
"node",
")",
"{",
"if",
"(",... | Checks whether the text forms a stand alone expression without considering the context of text
@param {!string} text
@return {boolean} | [
"Checks",
"whether",
"the",
"text",
"forms",
"a",
"stand",
"alone",
"expression",
"without",
"considering",
"the",
"context",
"of",
"text"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/JavaScriptRefactoring/RefactoringUtils.js#L187-L195 |
1,963 | adobe/brackets | src/extensions/default/JavaScriptRefactoring/RefactoringUtils.js | getScopeData | function getScopeData(session, offset) {
var path = session.path,
fileInfo = {
type: MessageIds.TERN_FILE_INFO_TYPE_FULL,
name: path,
offsetLines: 0,
text: ScopeManager.filterText(session.getJavascriptText())
};
Sco... | javascript | function getScopeData(session, offset) {
var path = session.path,
fileInfo = {
type: MessageIds.TERN_FILE_INFO_TYPE_FULL,
name: path,
offsetLines: 0,
text: ScopeManager.filterText(session.getJavascriptText())
};
Sco... | [
"function",
"getScopeData",
"(",
"session",
",",
"offset",
")",
"{",
"var",
"path",
"=",
"session",
".",
"path",
",",
"fileInfo",
"=",
"{",
"type",
":",
"MessageIds",
".",
"TERN_FILE_INFO_TYPE_FULL",
",",
"name",
":",
"path",
",",
"offsetLines",
":",
"0",
... | Requests scope data from tern
@param {!Session} session
@param {!{line: number, ch: number}} offset
@return {!$.Promise} a jQuery promise that will be resolved with the scope data | [
"Requests",
"scope",
"data",
"from",
"tern"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/JavaScriptRefactoring/RefactoringUtils.js#L203-L229 |
1,964 | adobe/brackets | src/extensions/default/JavaScriptRefactoring/RefactoringUtils.js | normalizeText | function normalizeText(text, start, end, removeTrailingSemiColons) {
var trimmedText;
// Remove leading spaces
trimmedText = _.trimLeft(text);
if (trimmedText.length < text.length) {
start += (text.length - trimmedText.length);
}
text = trimmedText;
... | javascript | function normalizeText(text, start, end, removeTrailingSemiColons) {
var trimmedText;
// Remove leading spaces
trimmedText = _.trimLeft(text);
if (trimmedText.length < text.length) {
start += (text.length - trimmedText.length);
}
text = trimmedText;
... | [
"function",
"normalizeText",
"(",
"text",
",",
"start",
",",
"end",
",",
"removeTrailingSemiColons",
")",
"{",
"var",
"trimmedText",
";",
"// Remove leading spaces",
"trimmedText",
"=",
"_",
".",
"trimLeft",
"(",
"text",
")",
";",
"if",
"(",
"trimmedText",
"."... | Normalize text by removing leading and trailing whitespace characters
and moves the start and end offset to reflect the new offset
@param {!string} text - selected text
@param {!number} start - the start offset of the text
@param {!number} end - the end offset of the text
@param {!boolean} removeTrailingSemiColons - re... | [
"Normalize",
"text",
"by",
"removing",
"leading",
"and",
"trailing",
"whitespace",
"characters",
"and",
"moves",
"the",
"start",
"and",
"end",
"offset",
"to",
"reflect",
"the",
"new",
"offset"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/JavaScriptRefactoring/RefactoringUtils.js#L240-L275 |
1,965 | adobe/brackets | src/extensions/default/JavaScriptRefactoring/RefactoringUtils.js | findSurroundASTNode | function findSurroundASTNode(ast, expn, types) {
var foundNode = ASTWalker.findNodeAround(ast, expn.start, function (nodeType, node) {
if (expn.end) {
return types.includes(nodeType) && node.end >= expn.end;
} else {
return types.includes(nodeType);
... | javascript | function findSurroundASTNode(ast, expn, types) {
var foundNode = ASTWalker.findNodeAround(ast, expn.start, function (nodeType, node) {
if (expn.end) {
return types.includes(nodeType) && node.end >= expn.end;
} else {
return types.includes(nodeType);
... | [
"function",
"findSurroundASTNode",
"(",
"ast",
",",
"expn",
",",
"types",
")",
"{",
"var",
"foundNode",
"=",
"ASTWalker",
".",
"findNodeAround",
"(",
"ast",
",",
"expn",
".",
"start",
",",
"function",
"(",
"nodeType",
",",
"node",
")",
"{",
"if",
"(",
... | Finds the surrounding ast node of the given expression of any of the given types
@param {!ASTNode} ast
@param {!{start: number, end: number}} expn - contains start and end offsets of expn
@param {!Array.<string>} types
@return {?ASTNode} | [
"Finds",
"the",
"surrounding",
"ast",
"node",
"of",
"the",
"given",
"expression",
"of",
"any",
"of",
"the",
"given",
"types"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/JavaScriptRefactoring/RefactoringUtils.js#L322-L331 |
1,966 | adobe/brackets | src/LiveDevelopment/MultiBrowserImpl/transports/remote/NodeSocketTransportRemote.js | function (url) {
var self = this;
this._ws = new WebSocket(url);
// One potential source of confusion: the transport sends two "types" of messages -
// these are distinct from the protocol's own messages. This is because this transport
// needs to send an ini... | javascript | function (url) {
var self = this;
this._ws = new WebSocket(url);
// One potential source of confusion: the transport sends two "types" of messages -
// these are distinct from the protocol's own messages. This is because this transport
// needs to send an ini... | [
"function",
"(",
"url",
")",
"{",
"var",
"self",
"=",
"this",
";",
"this",
".",
"_ws",
"=",
"new",
"WebSocket",
"(",
"url",
")",
";",
"// One potential source of confusion: the transport sends two \"types\" of messages -",
"// these are distinct from the protocol's own mess... | Connects to the NodeSocketTransport in Brackets at the given WebSocket URL.
@param {string} url | [
"Connects",
"to",
"the",
"NodeSocketTransport",
"in",
"Brackets",
"at",
"the",
"given",
"WebSocket",
"URL",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/MultiBrowserImpl/transports/remote/NodeSocketTransportRemote.js#L68-L108 | |
1,967 | adobe/brackets | src/LiveDevelopment/MultiBrowserImpl/transports/remote/NodeSocketTransportRemote.js | function (msgStr) {
if (this._ws) {
// See comment in `connect()` above about why we wrap the message in a transport message
// object.
this._ws.send(JSON.stringify({
type: "message",
message: msgStr
}));... | javascript | function (msgStr) {
if (this._ws) {
// See comment in `connect()` above about why we wrap the message in a transport message
// object.
this._ws.send(JSON.stringify({
type: "message",
message: msgStr
}));... | [
"function",
"(",
"msgStr",
")",
"{",
"if",
"(",
"this",
".",
"_ws",
")",
"{",
"// See comment in `connect()` above about why we wrap the message in a transport message",
"// object.",
"this",
".",
"_ws",
".",
"send",
"(",
"JSON",
".",
"stringify",
"(",
"{",
"type",
... | Sends a message over the transport.
@param {string} msgStr The message to send. | [
"Sends",
"a",
"message",
"over",
"the",
"transport",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/MultiBrowserImpl/transports/remote/NodeSocketTransportRemote.js#L114-L125 | |
1,968 | adobe/brackets | src/extensions/default/CloseOthers/main.js | handleClose | function handleClose(mode) {
var targetIndex = MainViewManager.findInWorkingSet(MainViewManager.ACTIVE_PANE, MainViewManager.getCurrentlyViewedPath(MainViewManager.ACTIVE_PANE)),
workingSetList = MainViewManager.getWorkingSet(MainViewManager.ACTIVE_PANE),
start = (mode === closeB... | javascript | function handleClose(mode) {
var targetIndex = MainViewManager.findInWorkingSet(MainViewManager.ACTIVE_PANE, MainViewManager.getCurrentlyViewedPath(MainViewManager.ACTIVE_PANE)),
workingSetList = MainViewManager.getWorkingSet(MainViewManager.ACTIVE_PANE),
start = (mode === closeB... | [
"function",
"handleClose",
"(",
"mode",
")",
"{",
"var",
"targetIndex",
"=",
"MainViewManager",
".",
"findInWorkingSet",
"(",
"MainViewManager",
".",
"ACTIVE_PANE",
",",
"MainViewManager",
".",
"getCurrentlyViewedPath",
"(",
"MainViewManager",
".",
"ACTIVE_PANE",
")",... | Handle the different Close Other commands
@param {string} mode | [
"Handle",
"the",
"different",
"Close",
"Other",
"commands"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CloseOthers/main.js#L59-L74 |
1,969 | adobe/brackets | src/extensions/default/CloseOthers/main.js | initializeCommands | function initializeCommands() {
var prefs = getPreferences();
CommandManager.register(Strings.CMD_FILE_CLOSE_BELOW, closeBelow, function () {
handleClose(closeBelow);
});
CommandManager.register(Strings.CMD_FILE_CLOSE_OTHERS, closeOthers, function () {
handleClos... | javascript | function initializeCommands() {
var prefs = getPreferences();
CommandManager.register(Strings.CMD_FILE_CLOSE_BELOW, closeBelow, function () {
handleClose(closeBelow);
});
CommandManager.register(Strings.CMD_FILE_CLOSE_OTHERS, closeOthers, function () {
handleClos... | [
"function",
"initializeCommands",
"(",
")",
"{",
"var",
"prefs",
"=",
"getPreferences",
"(",
")",
";",
"CommandManager",
".",
"register",
"(",
"Strings",
".",
"CMD_FILE_CLOSE_BELOW",
",",
"closeBelow",
",",
"function",
"(",
")",
"{",
"handleClose",
"(",
"close... | Register the Commands and add the Menu Items, if required | [
"Register",
"the",
"Commands",
"and",
"add",
"the",
"Menu",
"Items",
"if",
"required"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CloseOthers/main.js#L157-L180 |
1,970 | adobe/brackets | src/view/Pane.js | _ensurePaneIsFocused | function _ensurePaneIsFocused(paneId) {
var pane = MainViewManager._getPane(paneId);
// Defer the focusing until other focus events have occurred.
setTimeout(function () {
// Focus has most likely changed: give it back to the given pane.
pane.focus();
this._l... | javascript | function _ensurePaneIsFocused(paneId) {
var pane = MainViewManager._getPane(paneId);
// Defer the focusing until other focus events have occurred.
setTimeout(function () {
// Focus has most likely changed: give it back to the given pane.
pane.focus();
this._l... | [
"function",
"_ensurePaneIsFocused",
"(",
"paneId",
")",
"{",
"var",
"pane",
"=",
"MainViewManager",
".",
"_getPane",
"(",
"paneId",
")",
";",
"// Defer the focusing until other focus events have occurred.",
"setTimeout",
"(",
"function",
"(",
")",
"{",
"// Focus has mos... | Ensures that the given pane is focused after other focus related events occur
@params {string} paneId - paneId of the pane to focus
@private | [
"Ensures",
"that",
"the",
"given",
"pane",
"is",
"focused",
"after",
"other",
"focus",
"related",
"events",
"occur"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/Pane.js#L216-L226 |
1,971 | adobe/brackets | src/view/Pane.js | tryFocusingCurrentView | function tryFocusingCurrentView() {
if (self._currentView) {
if (self._currentView.focus) {
// Views can implement a focus
// method for focusing a complex
// DOM like codemirror
self._currentView.focus();
... | javascript | function tryFocusingCurrentView() {
if (self._currentView) {
if (self._currentView.focus) {
// Views can implement a focus
// method for focusing a complex
// DOM like codemirror
self._currentView.focus();
... | [
"function",
"tryFocusingCurrentView",
"(",
")",
"{",
"if",
"(",
"self",
".",
"_currentView",
")",
"{",
"if",
"(",
"self",
".",
"_currentView",
".",
"focus",
")",
"{",
"// Views can implement a focus",
"// method for focusing a complex",
"// DOM like codemirror",
"s... | Helper to focus the current view if it can | [
"Helper",
"to",
"focus",
"the",
"current",
"view",
"if",
"it",
"can"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/Pane.js#L1428-L1445 |
1,972 | adobe/brackets | src/editor/CodeHintManager.js | registerHintProvider | function registerHintProvider(providerInfo, languageIds, priority) {
var providerObj = { provider: providerInfo,
priority: priority || 0 };
if (languageIds.indexOf("all") !== -1) {
// Ignore anything else in languageIds and just register for every language. This ... | javascript | function registerHintProvider(providerInfo, languageIds, priority) {
var providerObj = { provider: providerInfo,
priority: priority || 0 };
if (languageIds.indexOf("all") !== -1) {
// Ignore anything else in languageIds and just register for every language. This ... | [
"function",
"registerHintProvider",
"(",
"providerInfo",
",",
"languageIds",
",",
"priority",
")",
"{",
"var",
"providerObj",
"=",
"{",
"provider",
":",
"providerInfo",
",",
"priority",
":",
"priority",
"||",
"0",
"}",
";",
"if",
"(",
"languageIds",
".",
"in... | The method by which a CodeHintProvider registers its willingness to
providing hints for editors in a given language.
@param {!CodeHintProvider} provider
The hint provider to be registered, described below.
@param {!Array.<string>} languageIds
The set of language ids for which the provider is capable of
providing hint... | [
"The",
"method",
"by",
"which",
"a",
"CodeHintProvider",
"registers",
"its",
"willingness",
"to",
"providing",
"hints",
"for",
"editors",
"in",
"a",
"given",
"language",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/CodeHintManager.js#L290-L314 |
1,973 | adobe/brackets | src/editor/CodeHintManager.js | _endSession | function _endSession() {
if (!hintList) {
return;
}
hintList.close();
hintList = null;
codeHintOpened = false;
keyDownEditor = null;
sessionProvider = null;
sessionEditor = null;
if (deferredHints) {
deferredHints.reject();
... | javascript | function _endSession() {
if (!hintList) {
return;
}
hintList.close();
hintList = null;
codeHintOpened = false;
keyDownEditor = null;
sessionProvider = null;
sessionEditor = null;
if (deferredHints) {
deferredHints.reject();
... | [
"function",
"_endSession",
"(",
")",
"{",
"if",
"(",
"!",
"hintList",
")",
"{",
"return",
";",
"}",
"hintList",
".",
"close",
"(",
")",
";",
"hintList",
"=",
"null",
";",
"codeHintOpened",
"=",
"false",
";",
"keyDownEditor",
"=",
"null",
";",
"sessionP... | End the current hinting session | [
"End",
"the",
"current",
"hinting",
"session"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/CodeHintManager.js#L373-L387 |
1,974 | adobe/brackets | src/editor/CodeHintManager.js | _inSession | function _inSession(editor) {
if (sessionEditor) {
if (sessionEditor === editor &&
(hintList.isOpen() ||
(deferredHints && deferredHints.state() === "pending"))) {
return true;
} else {
// the editor has changed
... | javascript | function _inSession(editor) {
if (sessionEditor) {
if (sessionEditor === editor &&
(hintList.isOpen() ||
(deferredHints && deferredHints.state() === "pending"))) {
return true;
} else {
// the editor has changed
... | [
"function",
"_inSession",
"(",
"editor",
")",
"{",
"if",
"(",
"sessionEditor",
")",
"{",
"if",
"(",
"sessionEditor",
"===",
"editor",
"&&",
"(",
"hintList",
".",
"isOpen",
"(",
")",
"||",
"(",
"deferredHints",
"&&",
"deferredHints",
".",
"state",
"(",
")... | Is there a hinting session active for a given editor?
NOTE: the sessionEditor, sessionProvider and hintList objects are
only guaranteed to be initialized during an active session.
@param {Editor} editor
@return boolean | [
"Is",
"there",
"a",
"hinting",
"session",
"active",
"for",
"a",
"given",
"editor?"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/CodeHintManager.js#L398-L410 |
1,975 | adobe/brackets | src/editor/CodeHintManager.js | _updateHintList | function _updateHintList(callMoveUpEvent) {
callMoveUpEvent = typeof callMoveUpEvent === "undefined" ? false : callMoveUpEvent;
if (deferredHints) {
deferredHints.reject();
deferredHints = null;
}
if (callMoveUpEvent) {
return hintList.callMoveUp(ca... | javascript | function _updateHintList(callMoveUpEvent) {
callMoveUpEvent = typeof callMoveUpEvent === "undefined" ? false : callMoveUpEvent;
if (deferredHints) {
deferredHints.reject();
deferredHints = null;
}
if (callMoveUpEvent) {
return hintList.callMoveUp(ca... | [
"function",
"_updateHintList",
"(",
"callMoveUpEvent",
")",
"{",
"callMoveUpEvent",
"=",
"typeof",
"callMoveUpEvent",
"===",
"\"undefined\"",
"?",
"false",
":",
"callMoveUpEvent",
";",
"if",
"(",
"deferredHints",
")",
"{",
"deferredHints",
".",
"reject",
"(",
")",... | From an active hinting session, get hints from the current provider and
render the hint list window.
Assumes that it is called when a session is active (i.e. sessionProvider is not null). | [
"From",
"an",
"active",
"hinting",
"session",
"get",
"hints",
"from",
"the",
"current",
"provider",
"and",
"render",
"the",
"hint",
"list",
"window",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/CodeHintManager.js#L417-L470 |
1,976 | adobe/brackets | src/editor/CodeHintManager.js | _handleKeydownEvent | function _handleKeydownEvent(jqEvent, editor, event) {
keyDownEditor = editor;
if (!(event.ctrlKey || event.altKey || event.metaKey) &&
(event.keyCode === KeyEvent.DOM_VK_ENTER ||
event.keyCode === KeyEvent.DOM_VK_RETURN ||
event.keyCode === KeyEvent.DOM... | javascript | function _handleKeydownEvent(jqEvent, editor, event) {
keyDownEditor = editor;
if (!(event.ctrlKey || event.altKey || event.metaKey) &&
(event.keyCode === KeyEvent.DOM_VK_ENTER ||
event.keyCode === KeyEvent.DOM_VK_RETURN ||
event.keyCode === KeyEvent.DOM... | [
"function",
"_handleKeydownEvent",
"(",
"jqEvent",
",",
"editor",
",",
"event",
")",
"{",
"keyDownEditor",
"=",
"editor",
";",
"if",
"(",
"!",
"(",
"event",
".",
"ctrlKey",
"||",
"event",
".",
"altKey",
"||",
"event",
".",
"metaKey",
")",
"&&",
"(",
"e... | Handles keys related to displaying, searching, and navigating the hint list.
This gets called before handleChange.
TODO: Ideally, we'd get a more semantic event from the editor that told us
what changed so that we could do all of this logic without looking at
key events. Then, the purposes of handleKeyEvent and handle... | [
"Handles",
"keys",
"related",
"to",
"displaying",
"searching",
"and",
"navigating",
"the",
"hint",
"list",
".",
"This",
"gets",
"called",
"before",
"handleChange",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/CodeHintManager.js#L556-L564 |
1,977 | adobe/brackets | src/editor/CodeHintManager.js | _startNewSession | function _startNewSession(editor) {
if (isOpen()) {
return;
}
if (!editor) {
editor = EditorManager.getFocusedEditor();
}
if (editor) {
lastChar = null;
if (_inSession(editor)) {
_endSession();
}
... | javascript | function _startNewSession(editor) {
if (isOpen()) {
return;
}
if (!editor) {
editor = EditorManager.getFocusedEditor();
}
if (editor) {
lastChar = null;
if (_inSession(editor)) {
_endSession();
}
... | [
"function",
"_startNewSession",
"(",
"editor",
")",
"{",
"if",
"(",
"isOpen",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"editor",
")",
"{",
"editor",
"=",
"EditorManager",
".",
"getFocusedEditor",
"(",
")",
";",
"}",
"if",
"(",
"editor"... | Explicitly start a new session. If we have an existing session,
then close the current one and restart a new one.
@param {Editor} editor | [
"Explicitly",
"start",
"a",
"new",
"session",
".",
"If",
"we",
"have",
"an",
"existing",
"session",
"then",
"close",
"the",
"current",
"one",
"and",
"restart",
"a",
"new",
"one",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/editor/CodeHintManager.js#L680-L697 |
1,978 | adobe/brackets | src/features/JumpToDefManager.js | _doJumpToDef | function _doJumpToDef() {
var request = null,
result = new $.Deferred(),
jumpToDefProvider = null,
editor = EditorManager.getActiveEditor();
if (editor) {
// Find a suitable provider, if any
var language = editor.getLanguageForSelection(),
... | javascript | function _doJumpToDef() {
var request = null,
result = new $.Deferred(),
jumpToDefProvider = null,
editor = EditorManager.getActiveEditor();
if (editor) {
// Find a suitable provider, if any
var language = editor.getLanguageForSelection(),
... | [
"function",
"_doJumpToDef",
"(",
")",
"{",
"var",
"request",
"=",
"null",
",",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
",",
"jumpToDefProvider",
"=",
"null",
",",
"editor",
"=",
"EditorManager",
".",
"getActiveEditor",
"(",
")",
";",
"if",
... | Asynchronously asks providers to handle jump-to-definition.
@return {!Promise} Resolved when the provider signals that it's done; rejected if no
provider responded or the provider that responded failed. | [
"Asynchronously",
"asks",
"providers",
"to",
"handle",
"jump",
"-",
"to",
"-",
"definition",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/features/JumpToDefManager.js#L44-L83 |
1,979 | adobe/brackets | src/features/ParameterHintsManager.js | positionHint | function positionHint(xpos, ypos, ybot) {
var hintWidth = $hintContainer.width(),
hintHeight = $hintContainer.height(),
top = ypos - hintHeight - POINTER_TOP_OFFSET,
left = xpos,
$editorHolder = $("#editor-holder"),
editorLeft;
if ($editorHold... | javascript | function positionHint(xpos, ypos, ybot) {
var hintWidth = $hintContainer.width(),
hintHeight = $hintContainer.height(),
top = ypos - hintHeight - POINTER_TOP_OFFSET,
left = xpos,
$editorHolder = $("#editor-holder"),
editorLeft;
if ($editorHold... | [
"function",
"positionHint",
"(",
"xpos",
",",
"ypos",
",",
"ybot",
")",
"{",
"var",
"hintWidth",
"=",
"$hintContainer",
".",
"width",
"(",
")",
",",
"hintHeight",
"=",
"$hintContainer",
".",
"height",
"(",
")",
",",
"top",
"=",
"ypos",
"-",
"hintHeight",... | Position a function hint.
@param {number} xpos
@param {number} ypos
@param {number} ybot | [
"Position",
"a",
"function",
"hint",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/features/ParameterHintsManager.js#L81-L115 |
1,980 | adobe/brackets | src/features/ParameterHintsManager.js | formatHint | function formatHint(hints) {
$hintContent.empty();
$hintContent.addClass("brackets-hints");
function appendSeparators(separators) {
$hintContent.append(separators);
}
function appendParameter(param, documentation, index) {
if (hints.currentIndex === inde... | javascript | function formatHint(hints) {
$hintContent.empty();
$hintContent.addClass("brackets-hints");
function appendSeparators(separators) {
$hintContent.append(separators);
}
function appendParameter(param, documentation, index) {
if (hints.currentIndex === inde... | [
"function",
"formatHint",
"(",
"hints",
")",
"{",
"$hintContent",
".",
"empty",
"(",
")",
";",
"$hintContent",
".",
"addClass",
"(",
"\"brackets-hints\"",
")",
";",
"function",
"appendSeparators",
"(",
"separators",
")",
"{",
"$hintContent",
".",
"append",
"("... | Bold the parameter at the caret.
@param {{inFunctionCall: boolean, functionCallPos: {line: number, ch: number}}} functionInfo -
tells if the caret is in a function call and the position
of the function call. | [
"Bold",
"the",
"parameter",
"at",
"the",
"caret",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/features/ParameterHintsManager.js#L199-L224 |
1,981 | adobe/brackets | src/features/ParameterHintsManager.js | dismissHint | function dismissHint(editor) {
if (hintState.visible) {
$hintContainer.hide();
$hintContent.empty();
hintState = {};
if (editor) {
editor.off("cursorActivity.ParameterHinting", handleCursorActivity);
sessionEditor = null;
... | javascript | function dismissHint(editor) {
if (hintState.visible) {
$hintContainer.hide();
$hintContent.empty();
hintState = {};
if (editor) {
editor.off("cursorActivity.ParameterHinting", handleCursorActivity);
sessionEditor = null;
... | [
"function",
"dismissHint",
"(",
"editor",
")",
"{",
"if",
"(",
"hintState",
".",
"visible",
")",
"{",
"$hintContainer",
".",
"hide",
"(",
")",
";",
"$hintContent",
".",
"empty",
"(",
")",
";",
"hintState",
"=",
"{",
"}",
";",
"if",
"(",
"editor",
")"... | Dismiss the function hint. | [
"Dismiss",
"the",
"function",
"hint",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/features/ParameterHintsManager.js#L230-L244 |
1,982 | adobe/brackets | src/features/ParameterHintsManager.js | popUpHint | function popUpHint(editor, explicit, onCursorActivity) {
var request = null;
var $deferredPopUp = $.Deferred();
var sessionProvider = null;
dismissHint(editor);
// Find a suitable provider, if any
var language = editor.getLanguageForSelection(),
enabledProvid... | javascript | function popUpHint(editor, explicit, onCursorActivity) {
var request = null;
var $deferredPopUp = $.Deferred();
var sessionProvider = null;
dismissHint(editor);
// Find a suitable provider, if any
var language = editor.getLanguageForSelection(),
enabledProvid... | [
"function",
"popUpHint",
"(",
"editor",
",",
"explicit",
",",
"onCursorActivity",
")",
"{",
"var",
"request",
"=",
"null",
";",
"var",
"$deferredPopUp",
"=",
"$",
".",
"Deferred",
"(",
")",
";",
"var",
"sessionProvider",
"=",
"null",
";",
"dismissHint",
"(... | Pop up a function hint on the line above the caret position.
@param {object=} editor - current Active Editor
@param {boolean} True if hints are invoked through cursor activity.
@return {jQuery.Promise} - The promise will not complete until the
hint has completed. Returns null, if the function hint is already
displayed... | [
"Pop",
"up",
"a",
"function",
"hint",
"on",
"the",
"line",
"above",
"the",
"caret",
"position",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/features/ParameterHintsManager.js#L256-L298 |
1,983 | adobe/brackets | src/features/ParameterHintsManager.js | installListeners | function installListeners(editor) {
editor.on("keydown.ParameterHinting", function (event, editor, domEvent) {
if (domEvent.keyCode === KeyEvent.DOM_VK_ESCAPE) {
dismissHint(editor);
}
}).on("scroll.ParameterHinting", function () {
... | javascript | function installListeners(editor) {
editor.on("keydown.ParameterHinting", function (event, editor, domEvent) {
if (domEvent.keyCode === KeyEvent.DOM_VK_ESCAPE) {
dismissHint(editor);
}
}).on("scroll.ParameterHinting", function () {
... | [
"function",
"installListeners",
"(",
"editor",
")",
"{",
"editor",
".",
"on",
"(",
"\"keydown.ParameterHinting\"",
",",
"function",
"(",
"event",
",",
"editor",
",",
"domEvent",
")",
"{",
"if",
"(",
"domEvent",
".",
"keyCode",
"===",
"KeyEvent",
".",
"DOM_VK... | Install function hint listeners.
@param {Editor} editor - editor context on which to listen for
changes | [
"Install",
"function",
"hint",
"listeners",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/features/ParameterHintsManager.js#L318-L328 |
1,984 | adobe/brackets | src/file/FileUtils.js | readAsText | function readAsText(file) {
var result = new $.Deferred();
// Measure performance
var perfTimerName = PerfUtils.markStart("readAsText:\t" + file.fullPath);
result.always(function () {
PerfUtils.addMeasurement(perfTimerName);
});
// Read file
file.rea... | javascript | function readAsText(file) {
var result = new $.Deferred();
// Measure performance
var perfTimerName = PerfUtils.markStart("readAsText:\t" + file.fullPath);
result.always(function () {
PerfUtils.addMeasurement(perfTimerName);
});
// Read file
file.rea... | [
"function",
"readAsText",
"(",
"file",
")",
"{",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
";",
"// Measure performance",
"var",
"perfTimerName",
"=",
"PerfUtils",
".",
"markStart",
"(",
"\"readAsText:\\t\"",
"+",
"file",
".",
"fullPath",
... | Asynchronously reads a file as UTF-8 encoded text.
@param {!File} file File to read
@return {$.Promise} a jQuery promise that will be resolved with the
file's text content plus its timestamp, or rejected with a FileSystemError string
constant if the file can not be read. | [
"Asynchronously",
"reads",
"a",
"file",
"as",
"UTF",
"-",
"8",
"encoded",
"text",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/file/FileUtils.js#L70-L89 |
1,985 | adobe/brackets | src/file/FileUtils.js | writeText | function writeText(file, text, allowBlindWrite) {
var result = new $.Deferred(),
options = {};
if (allowBlindWrite) {
options.blind = true;
}
file.write(text, options, function (err) {
if (!err) {
result.resolve();
} else ... | javascript | function writeText(file, text, allowBlindWrite) {
var result = new $.Deferred(),
options = {};
if (allowBlindWrite) {
options.blind = true;
}
file.write(text, options, function (err) {
if (!err) {
result.resolve();
} else ... | [
"function",
"writeText",
"(",
"file",
",",
"text",
",",
"allowBlindWrite",
")",
"{",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
",",
"options",
"=",
"{",
"}",
";",
"if",
"(",
"allowBlindWrite",
")",
"{",
"options",
".",
"blind",
"="... | Asynchronously writes a file as UTF-8 encoded text.
@param {!File} file File to write
@param {!string} text
@param {boolean=} allowBlindWrite Indicates whether or not CONTENTS_MODIFIED
errors---which can be triggered if the actual file contents differ from
the FileSystem's last-known contents---should be ignored.
@retu... | [
"Asynchronously",
"writes",
"a",
"file",
"as",
"UTF",
"-",
"8",
"encoded",
"text",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/file/FileUtils.js#L101-L118 |
1,986 | adobe/brackets | src/file/FileUtils.js | sniffLineEndings | function sniffLineEndings(text) {
var subset = text.substr(0, 1000); // (length is clipped to text.length)
var hasCRLF = /\r\n/.test(subset);
var hasLF = /[^\r]\n/.test(subset);
if ((hasCRLF && hasLF) || (!hasCRLF && !hasLF)) {
return null;
} else {
retu... | javascript | function sniffLineEndings(text) {
var subset = text.substr(0, 1000); // (length is clipped to text.length)
var hasCRLF = /\r\n/.test(subset);
var hasLF = /[^\r]\n/.test(subset);
if ((hasCRLF && hasLF) || (!hasCRLF && !hasLF)) {
return null;
} else {
retu... | [
"function",
"sniffLineEndings",
"(",
"text",
")",
"{",
"var",
"subset",
"=",
"text",
".",
"substr",
"(",
"0",
",",
"1000",
")",
";",
"// (length is clipped to text.length)",
"var",
"hasCRLF",
"=",
"/",
"\\r\\n",
"/",
".",
"test",
"(",
"subset",
")",
";",
... | Scans the first 1000 chars of the text to determine how it encodes line endings. Returns
null if usage is mixed or if no line endings found.
@param {!string} text
@return {null|LINE_ENDINGS_CRLF|LINE_ENDINGS_LF} | [
"Scans",
"the",
"first",
"1000",
"chars",
"of",
"the",
"text",
"to",
"determine",
"how",
"it",
"encodes",
"line",
"endings",
".",
"Returns",
"null",
"if",
"usage",
"is",
"mixed",
"or",
"if",
"no",
"line",
"endings",
"found",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/file/FileUtils.js#L141-L151 |
1,987 | adobe/brackets | src/file/FileUtils.js | translateLineEndings | function translateLineEndings(text, lineEndings) {
if (lineEndings !== LINE_ENDINGS_CRLF && lineEndings !== LINE_ENDINGS_LF) {
lineEndings = getPlatformLineEndings();
}
var eolStr = (lineEndings === LINE_ENDINGS_CRLF ? "\r\n" : "\n");
var findAnyEol = /\r\n|\r|\n/g;
... | javascript | function translateLineEndings(text, lineEndings) {
if (lineEndings !== LINE_ENDINGS_CRLF && lineEndings !== LINE_ENDINGS_LF) {
lineEndings = getPlatformLineEndings();
}
var eolStr = (lineEndings === LINE_ENDINGS_CRLF ? "\r\n" : "\n");
var findAnyEol = /\r\n|\r|\n/g;
... | [
"function",
"translateLineEndings",
"(",
"text",
",",
"lineEndings",
")",
"{",
"if",
"(",
"lineEndings",
"!==",
"LINE_ENDINGS_CRLF",
"&&",
"lineEndings",
"!==",
"LINE_ENDINGS_LF",
")",
"{",
"lineEndings",
"=",
"getPlatformLineEndings",
"(",
")",
";",
"}",
"var",
... | Translates any line ending types in the given text to the be the single form specified
@param {!string} text
@param {null|LINE_ENDINGS_CRLF|LINE_ENDINGS_LF} lineEndings
@return {string} | [
"Translates",
"any",
"line",
"ending",
"types",
"in",
"the",
"given",
"text",
"to",
"the",
"be",
"the",
"single",
"form",
"specified"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/file/FileUtils.js#L159-L168 |
1,988 | adobe/brackets | src/file/FileUtils.js | makeDialogFileList | function makeDialogFileList(paths) {
var result = "<ul class='dialog-list'>";
paths.forEach(function (path) {
result += "<li><span class='dialog-filename'>";
result += StringUtils.breakableUrl(path);
result += "</span></li>";
});
result += "</ul>";
... | javascript | function makeDialogFileList(paths) {
var result = "<ul class='dialog-list'>";
paths.forEach(function (path) {
result += "<li><span class='dialog-filename'>";
result += StringUtils.breakableUrl(path);
result += "</span></li>";
});
result += "</ul>";
... | [
"function",
"makeDialogFileList",
"(",
"paths",
")",
"{",
"var",
"result",
"=",
"\"<ul class='dialog-list'>\"",
";",
"paths",
".",
"forEach",
"(",
"function",
"(",
"path",
")",
"{",
"result",
"+=",
"\"<li><span class='dialog-filename'>\"",
";",
"result",
"+=",
"St... | Creates an HTML string for a list of files to be reported on, suitable for use in a dialog.
@param {Array.<string>} Array of filenames or paths to display. | [
"Creates",
"an",
"HTML",
"string",
"for",
"a",
"list",
"of",
"files",
"to",
"be",
"reported",
"on",
"suitable",
"for",
"use",
"in",
"a",
"dialog",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/file/FileUtils.js#L221-L230 |
1,989 | adobe/brackets | src/file/FileUtils.js | getBaseName | function getBaseName(fullPath) {
var lastSlash = fullPath.lastIndexOf("/");
if (lastSlash === fullPath.length - 1) { // directory: exclude trailing "/" too
return fullPath.slice(fullPath.lastIndexOf("/", fullPath.length - 2) + 1, -1);
} else {
return fullPath.slice(lastS... | javascript | function getBaseName(fullPath) {
var lastSlash = fullPath.lastIndexOf("/");
if (lastSlash === fullPath.length - 1) { // directory: exclude trailing "/" too
return fullPath.slice(fullPath.lastIndexOf("/", fullPath.length - 2) + 1, -1);
} else {
return fullPath.slice(lastS... | [
"function",
"getBaseName",
"(",
"fullPath",
")",
"{",
"var",
"lastSlash",
"=",
"fullPath",
".",
"lastIndexOf",
"(",
"\"/\"",
")",
";",
"if",
"(",
"lastSlash",
"===",
"fullPath",
".",
"length",
"-",
"1",
")",
"{",
"// directory: exclude trailing \"/\" too",
"re... | Get the name of a file or a directory, removing any preceding path.
@param {string} fullPath full path to a file or directory
@return {string} Returns the base name of a file or the name of a
directory | [
"Get",
"the",
"name",
"of",
"a",
"file",
"or",
"a",
"directory",
"removing",
"any",
"preceding",
"path",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/file/FileUtils.js#L287-L294 |
1,990 | adobe/brackets | src/file/FileUtils.js | getNativeModuleDirectoryPath | function getNativeModuleDirectoryPath(module) {
var path;
if (module && module.uri) {
path = decodeURI(module.uri);
// Remove module name and trailing slash from path.
path = path.substr(0, path.lastIndexOf("/"));
}
return path;
} | javascript | function getNativeModuleDirectoryPath(module) {
var path;
if (module && module.uri) {
path = decodeURI(module.uri);
// Remove module name and trailing slash from path.
path = path.substr(0, path.lastIndexOf("/"));
}
return path;
} | [
"function",
"getNativeModuleDirectoryPath",
"(",
"module",
")",
"{",
"var",
"path",
";",
"if",
"(",
"module",
"&&",
"module",
".",
"uri",
")",
"{",
"path",
"=",
"decodeURI",
"(",
"module",
".",
"uri",
")",
";",
"// Remove module name and trailing slash from path... | Given the module object passed to JS module define function,
convert the path to a native absolute path.
Returns a native absolute path to the module folder.
WARNING: unlike most paths in Brackets, this path EXCLUDES the trailing "/".
@return {string} | [
"Given",
"the",
"module",
"object",
"passed",
"to",
"JS",
"module",
"define",
"function",
"convert",
"the",
"path",
"to",
"a",
"native",
"absolute",
"path",
".",
"Returns",
"a",
"native",
"absolute",
"path",
"to",
"the",
"module",
"folder",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/file/FileUtils.js#L318-L328 |
1,991 | adobe/brackets | src/file/FileUtils.js | getFilenameWithoutExtension | function getFilenameWithoutExtension(filename) {
var index = filename.lastIndexOf(".");
return index === -1 ? filename : filename.slice(0, index);
} | javascript | function getFilenameWithoutExtension(filename) {
var index = filename.lastIndexOf(".");
return index === -1 ? filename : filename.slice(0, index);
} | [
"function",
"getFilenameWithoutExtension",
"(",
"filename",
")",
"{",
"var",
"index",
"=",
"filename",
".",
"lastIndexOf",
"(",
"\".\"",
")",
";",
"return",
"index",
"===",
"-",
"1",
"?",
"filename",
":",
"filename",
".",
"slice",
"(",
"0",
",",
"index",
... | Get the file name without the extension. Returns "" if name starts with "."
@param {string} filename File name of a file or directory, without preceding path
@return {string} Returns the file name without the extension | [
"Get",
"the",
"file",
"name",
"without",
"the",
"extension",
".",
"Returns",
"if",
"name",
"starts",
"with",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/file/FileUtils.js#L428-L431 |
1,992 | adobe/brackets | src/utils/DropdownEventHandler.js | DropdownEventHandler | function DropdownEventHandler($list, selectionCallback, closeCallback) {
this.$list = $list;
this.$items = $list.find("li");
this.selectionCallback = selectionCallback;
this.closeCallback = closeCallback;
this.scrolling = false;
/**
* @private
* The se... | javascript | function DropdownEventHandler($list, selectionCallback, closeCallback) {
this.$list = $list;
this.$items = $list.find("li");
this.selectionCallback = selectionCallback;
this.closeCallback = closeCallback;
this.scrolling = false;
/**
* @private
* The se... | [
"function",
"DropdownEventHandler",
"(",
"$list",
",",
"selectionCallback",
",",
"closeCallback",
")",
"{",
"this",
".",
"$list",
"=",
"$list",
";",
"this",
".",
"$items",
"=",
"$list",
".",
"find",
"(",
"\"li\"",
")",
";",
"this",
".",
"selectionCallback",
... | Object to handle events for a dropdown list.
DropdownEventHandler handles these events:
Mouse:
- click - execute selection callback and dismiss list
- mouseover - highlight item
- mouseleave - remove mouse highlighting
Keyboard:
- Enter - execute selection callback and dismiss list
- Esc - dis... | [
"Object",
"to",
"handle",
"events",
"for",
"a",
"dropdown",
"list",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/DropdownEventHandler.js#L54-L68 |
1,993 | adobe/brackets | src/utils/DropdownEventHandler.js | _keydownHook | function _keydownHook(event) {
var keyCode;
// (page) up, (page) down, enter and tab key are handled by the list
if (event.type === "keydown") {
keyCode = event.keyCode;
if (keyCode === KeyEvent.DOM_VK_TAB) {
self.close();
... | javascript | function _keydownHook(event) {
var keyCode;
// (page) up, (page) down, enter and tab key are handled by the list
if (event.type === "keydown") {
keyCode = event.keyCode;
if (keyCode === KeyEvent.DOM_VK_TAB) {
self.close();
... | [
"function",
"_keydownHook",
"(",
"event",
")",
"{",
"var",
"keyCode",
";",
"// (page) up, (page) down, enter and tab key are handled by the list",
"if",
"(",
"event",
".",
"type",
"===",
"\"keydown\"",
")",
"{",
"keyCode",
"=",
"event",
".",
"keyCode",
";",
"if",
... | Convert keydown events into hint list navigation actions.
@param {KeyboardEvent} event
@return {boolean} true if key was handled, otherwise false. | [
"Convert",
"keydown",
"events",
"into",
"hint",
"list",
"navigation",
"actions",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/DropdownEventHandler.js#L82-L126 |
1,994 | adobe/brackets | src/language/XMLUtils.js | _createTagInfo | function _createTagInfo(token, tokenType, offset, exclusionList, tagName, attrName, shouldReplace) {
return {
token: token || null,
tokenType: tokenType || null,
offset: offset || 0,
exclusionList: exclusionList || [],
tagName: tagName || "",
... | javascript | function _createTagInfo(token, tokenType, offset, exclusionList, tagName, attrName, shouldReplace) {
return {
token: token || null,
tokenType: tokenType || null,
offset: offset || 0,
exclusionList: exclusionList || [],
tagName: tagName || "",
... | [
"function",
"_createTagInfo",
"(",
"token",
",",
"tokenType",
",",
"offset",
",",
"exclusionList",
",",
"tagName",
",",
"attrName",
",",
"shouldReplace",
")",
"{",
"return",
"{",
"token",
":",
"token",
"||",
"null",
",",
"tokenType",
":",
"tokenType",
"||",
... | Returns an object that represents all its params.
@param {!Token} token CodeMirror token at the current pos
@param {number} tokenType Type of current token
@param {number} offset Offset in current token
@param {Array.<string>} exclusionList List of attributes of a tag or attribute options used by an attribute
@param {... | [
"Returns",
"an",
"object",
"that",
"represents",
"all",
"its",
"params",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/XMLUtils.js#L50-L60 |
1,995 | adobe/brackets | src/language/XMLUtils.js | _getTagAttributes | function _getTagAttributes(editor, constPos) {
var pos, ctx, ctxPrev, ctxNext, ctxTemp, tagName, exclusionList = [], shouldReplace;
pos = $.extend({}, constPos);
ctx = TokenUtils.getInitialContext(editor._codeMirror, pos);
// Stop if the cursor is before = or an attribute value.
... | javascript | function _getTagAttributes(editor, constPos) {
var pos, ctx, ctxPrev, ctxNext, ctxTemp, tagName, exclusionList = [], shouldReplace;
pos = $.extend({}, constPos);
ctx = TokenUtils.getInitialContext(editor._codeMirror, pos);
// Stop if the cursor is before = or an attribute value.
... | [
"function",
"_getTagAttributes",
"(",
"editor",
",",
"constPos",
")",
"{",
"var",
"pos",
",",
"ctx",
",",
"ctxPrev",
",",
"ctxNext",
",",
"ctxTemp",
",",
"tagName",
",",
"exclusionList",
"=",
"[",
"]",
",",
"shouldReplace",
";",
"pos",
"=",
"$",
".",
"... | Return the tagName and a list of attributes used by the tag.
@param {!Editor} editor An instance of active editor
@param {!{line: number, ch: number}} constPos The position of cursor in the active editor
@return {!{tagName: string, exclusionList: Array.<string>, shouldReplace: boolean}} | [
"Return",
"the",
"tagName",
"and",
"a",
"list",
"of",
"attributes",
"used",
"by",
"the",
"tag",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/XMLUtils.js#L69-L147 |
1,996 | adobe/brackets | src/language/XMLUtils.js | _getTagAttributeValue | function _getTagAttributeValue(editor, pos) {
var ctx, tagName, attrName, exclusionList = [], offset, textBefore, textAfter;
ctx = TokenUtils.getInitialContext(editor._codeMirror, pos);
offset = TokenUtils.offsetInToken(ctx);
// To support multiple options on the same attribute, we hav... | javascript | function _getTagAttributeValue(editor, pos) {
var ctx, tagName, attrName, exclusionList = [], offset, textBefore, textAfter;
ctx = TokenUtils.getInitialContext(editor._codeMirror, pos);
offset = TokenUtils.offsetInToken(ctx);
// To support multiple options on the same attribute, we hav... | [
"function",
"_getTagAttributeValue",
"(",
"editor",
",",
"pos",
")",
"{",
"var",
"ctx",
",",
"tagName",
",",
"attrName",
",",
"exclusionList",
"=",
"[",
"]",
",",
"offset",
",",
"textBefore",
",",
"textAfter",
";",
"ctx",
"=",
"TokenUtils",
".",
"getInitia... | Return the tag name, attribute name and a list of options used by the attribute
@param {!Editor} editor An instance of active editor
@param {!{line: number, ch: number}} pos Position of cursor in the editor
@return {!{tagName: string, attrName: string, exclusionList: Array.<string>}} | [
"Return",
"the",
"tag",
"name",
"attribute",
"name",
"and",
"a",
"list",
"of",
"options",
"used",
"by",
"the",
"attribute"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/XMLUtils.js#L156-L220 |
1,997 | adobe/brackets | src/language/XMLUtils.js | getTagInfo | function getTagInfo(editor, pos) {
var ctx, offset, tagAttrs, tagAttrValue;
ctx = TokenUtils.getInitialContext(editor._codeMirror, pos);
offset = TokenUtils.offsetInToken(ctx);
if (ctx.token && ctx.token.type === "tag bracket" && ctx.token.string === "<") {
// Returns tagIn... | javascript | function getTagInfo(editor, pos) {
var ctx, offset, tagAttrs, tagAttrValue;
ctx = TokenUtils.getInitialContext(editor._codeMirror, pos);
offset = TokenUtils.offsetInToken(ctx);
if (ctx.token && ctx.token.type === "tag bracket" && ctx.token.string === "<") {
// Returns tagIn... | [
"function",
"getTagInfo",
"(",
"editor",
",",
"pos",
")",
"{",
"var",
"ctx",
",",
"offset",
",",
"tagAttrs",
",",
"tagAttrValue",
";",
"ctx",
"=",
"TokenUtils",
".",
"getInitialContext",
"(",
"editor",
".",
"_codeMirror",
",",
"pos",
")",
";",
"offset",
... | Return the tag info at a given position in the active editor
@param {!Editor} editor Instance of active editor
@param {!{line: number, ch: number}} pos Position of cursor in the editor
@return {!{token: Object, tokenType: number, offset: number, exclusionList: Array.<string>, tagName: string, attrName: string, shouldR... | [
"Return",
"the",
"tag",
"info",
"at",
"a",
"given",
"position",
"in",
"the",
"active",
"editor"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/XMLUtils.js#L229-L270 |
1,998 | adobe/brackets | src/language/XMLUtils.js | getValueQuery | function getValueQuery(tagInfo) {
var query;
if (tagInfo.token.string === "=") {
return "";
}
// Remove quotation marks in query.
query = tagInfo.token.string.substr(1, tagInfo.offset - 1);
// Get the last option to use as a query to support multiple options.... | javascript | function getValueQuery(tagInfo) {
var query;
if (tagInfo.token.string === "=") {
return "";
}
// Remove quotation marks in query.
query = tagInfo.token.string.substr(1, tagInfo.offset - 1);
// Get the last option to use as a query to support multiple options.... | [
"function",
"getValueQuery",
"(",
"tagInfo",
")",
"{",
"var",
"query",
";",
"if",
"(",
"tagInfo",
".",
"token",
".",
"string",
"===",
"\"=\"",
")",
"{",
"return",
"\"\"",
";",
"}",
"// Remove quotation marks in query.",
"query",
"=",
"tagInfo",
".",
"token",... | Return the query text of a value.
@param {!{token: Object, tokenType: number, offset: number, exclusionList: Array.<string>, tagName: string, attrName: string, shouldReplace: boolean}}
@return {string} The query to use to matching hints. | [
"Return",
"the",
"query",
"text",
"of",
"a",
"value",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/XMLUtils.js#L278-L288 |
1,999 | adobe/brackets | src/utils/ExtensionUtils.js | isAbsolutePathOrUrl | function isAbsolutePathOrUrl(pathOrUrl) {
return brackets.platform === "win" ? PathUtils.isAbsoluteUrl(pathOrUrl) : FileSystem.isAbsolutePath(pathOrUrl);
} | javascript | function isAbsolutePathOrUrl(pathOrUrl) {
return brackets.platform === "win" ? PathUtils.isAbsoluteUrl(pathOrUrl) : FileSystem.isAbsolutePath(pathOrUrl);
} | [
"function",
"isAbsolutePathOrUrl",
"(",
"pathOrUrl",
")",
"{",
"return",
"brackets",
".",
"platform",
"===",
"\"win\"",
"?",
"PathUtils",
".",
"isAbsoluteUrl",
"(",
"pathOrUrl",
")",
":",
"FileSystem",
".",
"isAbsolutePath",
"(",
"pathOrUrl",
")",
";",
"}"
] | getModuleUrl returns different urls for win platform
so that's why we need a different check here
@see #getModuleUrl
@param {!string} pathOrUrl that should be checked if it's absolute
@return {!boolean} returns true if pathOrUrl is absolute url on win platform
or when it's absolute path on other platforms | [
"getModuleUrl",
"returns",
"different",
"urls",
"for",
"win",
"platform",
"so",
"that",
"s",
"why",
"we",
"need",
"a",
"different",
"check",
"here"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/ExtensionUtils.js#L81-L83 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.