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,700 | Shopify/draggable | src/Draggable/Plugins/Focusable/Focusable.js | decorateElement | function decorateElement(element) {
const hasMissingTabIndex = Boolean(!element.getAttribute('tabindex') && element.tabIndex === -1);
if (hasMissingTabIndex) {
elementsWithMissingTabIndex.push(element);
element.tabIndex = 0;
}
} | javascript | function decorateElement(element) {
const hasMissingTabIndex = Boolean(!element.getAttribute('tabindex') && element.tabIndex === -1);
if (hasMissingTabIndex) {
elementsWithMissingTabIndex.push(element);
element.tabIndex = 0;
}
} | [
"function",
"decorateElement",
"(",
"element",
")",
"{",
"const",
"hasMissingTabIndex",
"=",
"Boolean",
"(",
"!",
"element",
".",
"getAttribute",
"(",
"'tabindex'",
")",
"&&",
"element",
".",
"tabIndex",
"===",
"-",
"1",
")",
";",
"if",
"(",
"hasMissingTabIn... | Decorates element with tabindex attributes
@param {HTMLElement} element
@return {Object}
@private | [
"Decorates",
"element",
"with",
"tabindex",
"attributes"
] | ecc04b2cdb8b5009664862472ff8cb237c38cfeb | https://github.com/Shopify/draggable/blob/ecc04b2cdb8b5009664862472ff8cb237c38cfeb/src/Draggable/Plugins/Focusable/Focusable.js#L108-L115 |
1,701 | Shopify/draggable | src/Draggable/Plugins/Focusable/Focusable.js | stripElement | function stripElement(element) {
const tabIndexElementPosition = elementsWithMissingTabIndex.indexOf(element);
if (tabIndexElementPosition !== -1) {
element.tabIndex = -1;
elementsWithMissingTabIndex.splice(tabIndexElementPosition, 1);
}
} | javascript | function stripElement(element) {
const tabIndexElementPosition = elementsWithMissingTabIndex.indexOf(element);
if (tabIndexElementPosition !== -1) {
element.tabIndex = -1;
elementsWithMissingTabIndex.splice(tabIndexElementPosition, 1);
}
} | [
"function",
"stripElement",
"(",
"element",
")",
"{",
"const",
"tabIndexElementPosition",
"=",
"elementsWithMissingTabIndex",
".",
"indexOf",
"(",
"element",
")",
";",
"if",
"(",
"tabIndexElementPosition",
"!==",
"-",
"1",
")",
"{",
"element",
".",
"tabIndex",
"... | Removes elements tabindex attributes
@param {HTMLElement} element
@private | [
"Removes",
"elements",
"tabindex",
"attributes"
] | ecc04b2cdb8b5009664862472ff8cb237c38cfeb | https://github.com/Shopify/draggable/blob/ecc04b2cdb8b5009664862472ff8cb237c38cfeb/src/Draggable/Plugins/Focusable/Focusable.js#L122-L129 |
1,702 | Shopify/draggable | src/Swappable/Swappable.js | onSwappableSwappedDefaultAnnouncement | function onSwappableSwappedDefaultAnnouncement({dragEvent, swappedElement}) {
const sourceText = dragEvent.source.textContent.trim() || dragEvent.source.id || 'swappable element';
const overText = swappedElement.textContent.trim() || swappedElement.id || 'swappable element';
return `Swapped ${sourceText} with ${... | javascript | function onSwappableSwappedDefaultAnnouncement({dragEvent, swappedElement}) {
const sourceText = dragEvent.source.textContent.trim() || dragEvent.source.id || 'swappable element';
const overText = swappedElement.textContent.trim() || swappedElement.id || 'swappable element';
return `Swapped ${sourceText} with ${... | [
"function",
"onSwappableSwappedDefaultAnnouncement",
"(",
"{",
"dragEvent",
",",
"swappedElement",
"}",
")",
"{",
"const",
"sourceText",
"=",
"dragEvent",
".",
"source",
".",
"textContent",
".",
"trim",
"(",
")",
"||",
"dragEvent",
".",
"source",
".",
"id",
"|... | Returns an announcement message when the Draggable element is swapped with another draggable element
@param {SwappableSwappedEvent} swappableEvent
@return {String} | [
"Returns",
"an",
"announcement",
"message",
"when",
"the",
"Draggable",
"element",
"is",
"swapped",
"with",
"another",
"draggable",
"element"
] | ecc04b2cdb8b5009664862472ff8cb237c38cfeb | https://github.com/Shopify/draggable/blob/ecc04b2cdb8b5009664862472ff8cb237c38cfeb/src/Swappable/Swappable.js#L13-L18 |
1,703 | Shopify/draggable | src/Draggable/Plugins/Mirror/Mirror.js | computeMirrorDimensions | function computeMirrorDimensions({source, ...args}) {
return withPromise((resolve) => {
const sourceRect = source.getBoundingClientRect();
resolve({source, sourceRect, ...args});
});
} | javascript | function computeMirrorDimensions({source, ...args}) {
return withPromise((resolve) => {
const sourceRect = source.getBoundingClientRect();
resolve({source, sourceRect, ...args});
});
} | [
"function",
"computeMirrorDimensions",
"(",
"{",
"source",
",",
"...",
"args",
"}",
")",
"{",
"return",
"withPromise",
"(",
"(",
"resolve",
")",
"=>",
"{",
"const",
"sourceRect",
"=",
"source",
".",
"getBoundingClientRect",
"(",
")",
";",
"resolve",
"(",
"... | Computes mirror dimensions based on the source element
Adds sourceRect to state
@param {Object} state
@param {HTMLElement} state.source
@return {Promise}
@private | [
"Computes",
"mirror",
"dimensions",
"based",
"on",
"the",
"source",
"element",
"Adds",
"sourceRect",
"to",
"state"
] | ecc04b2cdb8b5009664862472ff8cb237c38cfeb | https://github.com/Shopify/draggable/blob/ecc04b2cdb8b5009664862472ff8cb237c38cfeb/src/Draggable/Plugins/Mirror/Mirror.js#L330-L335 |
1,704 | Shopify/draggable | src/Draggable/Plugins/Mirror/Mirror.js | calculateMirrorOffset | function calculateMirrorOffset({sensorEvent, sourceRect, options, ...args}) {
return withPromise((resolve) => {
const top = options.cursorOffsetY === null ? sensorEvent.clientY - sourceRect.top : options.cursorOffsetY;
const left = options.cursorOffsetX === null ? sensorEvent.clientX - sourceRect.left : optio... | javascript | function calculateMirrorOffset({sensorEvent, sourceRect, options, ...args}) {
return withPromise((resolve) => {
const top = options.cursorOffsetY === null ? sensorEvent.clientY - sourceRect.top : options.cursorOffsetY;
const left = options.cursorOffsetX === null ? sensorEvent.clientX - sourceRect.left : optio... | [
"function",
"calculateMirrorOffset",
"(",
"{",
"sensorEvent",
",",
"sourceRect",
",",
"options",
",",
"...",
"args",
"}",
")",
"{",
"return",
"withPromise",
"(",
"(",
"resolve",
")",
"=>",
"{",
"const",
"top",
"=",
"options",
".",
"cursorOffsetY",
"===",
"... | Calculates mirror offset
Adds mirrorOffset to state
@param {Object} state
@param {SensorEvent} state.sensorEvent
@param {DOMRect} state.sourceRect
@return {Promise}
@private | [
"Calculates",
"mirror",
"offset",
"Adds",
"mirrorOffset",
"to",
"state"
] | ecc04b2cdb8b5009664862472ff8cb237c38cfeb | https://github.com/Shopify/draggable/blob/ecc04b2cdb8b5009664862472ff8cb237c38cfeb/src/Draggable/Plugins/Mirror/Mirror.js#L346-L355 |
1,705 | Shopify/draggable | src/Draggable/Plugins/Mirror/Mirror.js | resetMirror | function resetMirror({mirror, source, options, ...args}) {
return withPromise((resolve) => {
let offsetHeight;
let offsetWidth;
if (options.constrainDimensions) {
const computedSourceStyles = getComputedStyle(source);
offsetHeight = computedSourceStyles.getPropertyValue('height');
offse... | javascript | function resetMirror({mirror, source, options, ...args}) {
return withPromise((resolve) => {
let offsetHeight;
let offsetWidth;
if (options.constrainDimensions) {
const computedSourceStyles = getComputedStyle(source);
offsetHeight = computedSourceStyles.getPropertyValue('height');
offse... | [
"function",
"resetMirror",
"(",
"{",
"mirror",
",",
"source",
",",
"options",
",",
"...",
"args",
"}",
")",
"{",
"return",
"withPromise",
"(",
"(",
"resolve",
")",
"=>",
"{",
"let",
"offsetHeight",
";",
"let",
"offsetWidth",
";",
"if",
"(",
"options",
... | Applys mirror styles
@param {Object} state
@param {HTMLElement} state.mirror
@param {HTMLElement} state.source
@param {Object} state.options
@return {Promise}
@private | [
"Applys",
"mirror",
"styles"
] | ecc04b2cdb8b5009664862472ff8cb237c38cfeb | https://github.com/Shopify/draggable/blob/ecc04b2cdb8b5009664862472ff8cb237c38cfeb/src/Draggable/Plugins/Mirror/Mirror.js#L366-L390 |
1,706 | Shopify/draggable | src/Draggable/Plugins/Mirror/Mirror.js | addMirrorClasses | function addMirrorClasses({mirror, mirrorClass, ...args}) {
return withPromise((resolve) => {
mirror.classList.add(mirrorClass);
resolve({mirror, mirrorClass, ...args});
});
} | javascript | function addMirrorClasses({mirror, mirrorClass, ...args}) {
return withPromise((resolve) => {
mirror.classList.add(mirrorClass);
resolve({mirror, mirrorClass, ...args});
});
} | [
"function",
"addMirrorClasses",
"(",
"{",
"mirror",
",",
"mirrorClass",
",",
"...",
"args",
"}",
")",
"{",
"return",
"withPromise",
"(",
"(",
"resolve",
")",
"=>",
"{",
"mirror",
".",
"classList",
".",
"add",
"(",
"mirrorClass",
")",
";",
"resolve",
"(",... | Applys mirror class on mirror element
@param {Object} state
@param {HTMLElement} state.mirror
@param {String} state.mirrorClass
@return {Promise}
@private | [
"Applys",
"mirror",
"class",
"on",
"mirror",
"element"
] | ecc04b2cdb8b5009664862472ff8cb237c38cfeb | https://github.com/Shopify/draggable/blob/ecc04b2cdb8b5009664862472ff8cb237c38cfeb/src/Draggable/Plugins/Mirror/Mirror.js#L400-L405 |
1,707 | Shopify/draggable | src/Draggable/Plugins/Mirror/Mirror.js | removeMirrorID | function removeMirrorID({mirror, ...args}) {
return withPromise((resolve) => {
mirror.removeAttribute('id');
delete mirror.id;
resolve({mirror, ...args});
});
} | javascript | function removeMirrorID({mirror, ...args}) {
return withPromise((resolve) => {
mirror.removeAttribute('id');
delete mirror.id;
resolve({mirror, ...args});
});
} | [
"function",
"removeMirrorID",
"(",
"{",
"mirror",
",",
"...",
"args",
"}",
")",
"{",
"return",
"withPromise",
"(",
"(",
"resolve",
")",
"=>",
"{",
"mirror",
".",
"removeAttribute",
"(",
"'id'",
")",
";",
"delete",
"mirror",
".",
"id",
";",
"resolve",
"... | Removes source ID from cloned mirror element
@param {Object} state
@param {HTMLElement} state.mirror
@return {Promise}
@private | [
"Removes",
"source",
"ID",
"from",
"cloned",
"mirror",
"element"
] | ecc04b2cdb8b5009664862472ff8cb237c38cfeb | https://github.com/Shopify/draggable/blob/ecc04b2cdb8b5009664862472ff8cb237c38cfeb/src/Draggable/Plugins/Mirror/Mirror.js#L414-L420 |
1,708 | Shopify/draggable | src/Draggable/Plugins/Mirror/Mirror.js | positionMirror | function positionMirror({withFrame = false, initial = false} = {}) {
return ({mirror, sensorEvent, mirrorOffset, initialY, initialX, scrollOffset, options, ...args}) => {
return withPromise(
(resolve) => {
const result = {
mirror,
sensorEvent,
mirrorOffset,
op... | javascript | function positionMirror({withFrame = false, initial = false} = {}) {
return ({mirror, sensorEvent, mirrorOffset, initialY, initialX, scrollOffset, options, ...args}) => {
return withPromise(
(resolve) => {
const result = {
mirror,
sensorEvent,
mirrorOffset,
op... | [
"function",
"positionMirror",
"(",
"{",
"withFrame",
"=",
"false",
",",
"initial",
"=",
"false",
"}",
"=",
"{",
"}",
")",
"{",
"return",
"(",
"{",
"mirror",
",",
"sensorEvent",
",",
"mirrorOffset",
",",
"initialY",
",",
"initialX",
",",
"scrollOffset",
"... | Positions mirror with translate3d
@param {Object} state
@param {HTMLElement} state.mirror
@param {SensorEvent} state.sensorEvent
@param {Object} state.mirrorOffset
@param {Number} state.initialY
@param {Number} state.initialX
@param {Object} state.options
@return {Promise}
@private | [
"Positions",
"mirror",
"with",
"translate3d"
] | ecc04b2cdb8b5009664862472ff8cb237c38cfeb | https://github.com/Shopify/draggable/blob/ecc04b2cdb8b5009664862472ff8cb237c38cfeb/src/Draggable/Plugins/Mirror/Mirror.js#L434-L469 |
1,709 | Shopify/draggable | src/Draggable/Plugins/Mirror/Mirror.js | withPromise | function withPromise(callback, {raf = false} = {}) {
return new Promise((resolve, reject) => {
if (raf) {
requestAnimationFrame(() => {
callback(resolve, reject);
});
} else {
callback(resolve, reject);
}
});
} | javascript | function withPromise(callback, {raf = false} = {}) {
return new Promise((resolve, reject) => {
if (raf) {
requestAnimationFrame(() => {
callback(resolve, reject);
});
} else {
callback(resolve, reject);
}
});
} | [
"function",
"withPromise",
"(",
"callback",
",",
"{",
"raf",
"=",
"false",
"}",
"=",
"{",
"}",
")",
"{",
"return",
"new",
"Promise",
"(",
"(",
"resolve",
",",
"reject",
")",
"=>",
"{",
"if",
"(",
"raf",
")",
"{",
"requestAnimationFrame",
"(",
"(",
... | Wraps functions in promise with potential animation frame option
@param {Function} callback
@param {Object} options
@param {Boolean} options.raf
@return {Promise}
@private | [
"Wraps",
"functions",
"in",
"promise",
"with",
"potential",
"animation",
"frame",
"option"
] | ecc04b2cdb8b5009664862472ff8cb237c38cfeb | https://github.com/Shopify/draggable/blob/ecc04b2cdb8b5009664862472ff8cb237c38cfeb/src/Draggable/Plugins/Mirror/Mirror.js#L479-L489 |
1,710 | Shopify/draggable | src/Draggable/Plugins/Announcement/Announcement.js | announce | function announce(message, {expire}) {
const element = document.createElement('div');
element.textContent = message;
liveRegion.appendChild(element);
return setTimeout(() => {
liveRegion.removeChild(element);
}, expire);
} | javascript | function announce(message, {expire}) {
const element = document.createElement('div');
element.textContent = message;
liveRegion.appendChild(element);
return setTimeout(() => {
liveRegion.removeChild(element);
}, expire);
} | [
"function",
"announce",
"(",
"message",
",",
"{",
"expire",
"}",
")",
"{",
"const",
"element",
"=",
"document",
".",
"createElement",
"(",
"'div'",
")",
";",
"element",
".",
"textContent",
"=",
"message",
";",
"liveRegion",
".",
"appendChild",
"(",
"elemen... | Announces message via live region
@param {String} message
@param {Object} options
@param {Number} options.expire | [
"Announces",
"message",
"via",
"live",
"region"
] | ecc04b2cdb8b5009664862472ff8cb237c38cfeb | https://github.com/Shopify/draggable/blob/ecc04b2cdb8b5009664862472ff8cb237c38cfeb/src/Draggable/Plugins/Announcement/Announcement.js#L142-L151 |
1,711 | Shopify/draggable | src/Draggable/Plugins/Announcement/Announcement.js | createRegion | function createRegion() {
const element = document.createElement('div');
element.setAttribute('id', 'draggable-live-region');
element.setAttribute(ARIA_RELEVANT, 'additions');
element.setAttribute(ARIA_ATOMIC, 'true');
element.setAttribute(ARIA_LIVE, 'assertive');
element.setAttribute(ROLE, 'log');
elem... | javascript | function createRegion() {
const element = document.createElement('div');
element.setAttribute('id', 'draggable-live-region');
element.setAttribute(ARIA_RELEVANT, 'additions');
element.setAttribute(ARIA_ATOMIC, 'true');
element.setAttribute(ARIA_LIVE, 'assertive');
element.setAttribute(ROLE, 'log');
elem... | [
"function",
"createRegion",
"(",
")",
"{",
"const",
"element",
"=",
"document",
".",
"createElement",
"(",
"'div'",
")",
";",
"element",
".",
"setAttribute",
"(",
"'id'",
",",
"'draggable-live-region'",
")",
";",
"element",
".",
"setAttribute",
"(",
"ARIA_RELE... | Creates region element
@return {HTMLElement} | [
"Creates",
"region",
"element"
] | ecc04b2cdb8b5009664862472ff8cb237c38cfeb | https://github.com/Shopify/draggable/blob/ecc04b2cdb8b5009664862472ff8cb237c38cfeb/src/Draggable/Plugins/Announcement/Announcement.js#L157-L173 |
1,712 | adobe/brackets | src/preferences/PreferencesBase.js | function () {
var result = new $.Deferred();
var path = this.path;
var createIfMissing = this.createIfMissing;
var recreateIfInvalid = this.recreateIfInvalid;
var self = this;
if (path) {
var prefFile = FileSystem.getFileForPath(pa... | javascript | function () {
var result = new $.Deferred();
var path = this.path;
var createIfMissing = this.createIfMissing;
var recreateIfInvalid = this.recreateIfInvalid;
var self = this;
if (path) {
var prefFile = FileSystem.getFileForPath(pa... | [
"function",
"(",
")",
"{",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
";",
"var",
"path",
"=",
"this",
".",
"path",
";",
"var",
"createIfMissing",
"=",
"this",
".",
"createIfMissing",
";",
"var",
"recreateIfInvalid",
"=",
"this",
".",... | Loads the preferences from disk. Can throw an exception if the file is not
readable or parseable.
@return {Promise} Resolved with the data once it has been parsed. | [
"Loads",
"the",
"preferences",
"from",
"disk",
".",
"Can",
"throw",
"an",
"exception",
"if",
"the",
"file",
"is",
"not",
"readable",
"or",
"parseable",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L170-L229 | |
1,713 | adobe/brackets | src/preferences/PreferencesBase.js | function (newData) {
var result = new $.Deferred();
var path = this.path;
var prefFile = FileSystem.getFileForPath(path);
if (path) {
try {
var text = JSON.stringify(newData, null, 4);
// maintain the original line... | javascript | function (newData) {
var result = new $.Deferred();
var path = this.path;
var prefFile = FileSystem.getFileForPath(path);
if (path) {
try {
var text = JSON.stringify(newData, null, 4);
// maintain the original line... | [
"function",
"(",
"newData",
")",
"{",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
";",
"var",
"path",
"=",
"this",
".",
"path",
";",
"var",
"prefFile",
"=",
"FileSystem",
".",
"getFileForPath",
"(",
"path",
")",
";",
"if",
"(",
"pa... | Saves the new data to disk.
@param {Object} newData data to save
@return {Promise} Promise resolved (with no arguments) once the data has been saved | [
"Saves",
"the",
"new",
"data",
"to",
"disk",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L237-L262 | |
1,714 | adobe/brackets | src/preferences/PreferencesBase.js | Scope | function Scope(storage) {
this.storage = storage;
storage.on("changed", this.load.bind(this));
this.data = {};
this._dirty = false;
this._layers = [];
this._layerMap = {};
this._exclusions = [];
} | javascript | function Scope(storage) {
this.storage = storage;
storage.on("changed", this.load.bind(this));
this.data = {};
this._dirty = false;
this._layers = [];
this._layerMap = {};
this._exclusions = [];
} | [
"function",
"Scope",
"(",
"storage",
")",
"{",
"this",
".",
"storage",
"=",
"storage",
";",
"storage",
".",
"on",
"(",
"\"changed\"",
",",
"this",
".",
"load",
".",
"bind",
"(",
"this",
")",
")",
";",
"this",
".",
"data",
"=",
"{",
"}",
";",
"thi... | A `Scope` is a data container that is tied to a `Storage`.
Additionally, `Scope`s support "layers" which are additional levels of preferences
that are stored within a single preferences file.
@constructor
@param {Storage} storage Storage object from which prefs are loaded/saved | [
"A",
"Scope",
"is",
"a",
"data",
"container",
"that",
"is",
"tied",
"to",
"a",
"Storage",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L300-L308 |
1,715 | adobe/brackets | src/preferences/PreferencesBase.js | function () {
var result = new $.Deferred();
this.storage.load()
.then(function (data) {
var oldKeys = this.getKeys();
this.data = data;
result.resolve();
this.trigger(PREFERENCE_CHANGE, {
... | javascript | function () {
var result = new $.Deferred();
this.storage.load()
.then(function (data) {
var oldKeys = this.getKeys();
this.data = data;
result.resolve();
this.trigger(PREFERENCE_CHANGE, {
... | [
"function",
"(",
")",
"{",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
";",
"this",
".",
"storage",
".",
"load",
"(",
")",
".",
"then",
"(",
"function",
"(",
"data",
")",
"{",
"var",
"oldKeys",
"=",
"this",
".",
"getKeys",
"(",
... | Loads the prefs for this `Scope` from the `Storage`.
@return {Promise} Promise that is resolved once loading is complete | [
"Loads",
"the",
"prefs",
"for",
"this",
"Scope",
"from",
"the",
"Storage",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L316-L331 | |
1,716 | adobe/brackets | src/preferences/PreferencesBase.js | function () {
var self = this;
if (this._dirty) {
self._dirty = false;
return this.storage.save(this.data);
} else {
return (new $.Deferred()).resolve().promise();
}
} | javascript | function () {
var self = this;
if (this._dirty) {
self._dirty = false;
return this.storage.save(this.data);
} else {
return (new $.Deferred()).resolve().promise();
}
} | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"this",
".",
"_dirty",
")",
"{",
"self",
".",
"_dirty",
"=",
"false",
";",
"return",
"this",
".",
"storage",
".",
"save",
"(",
"this",
".",
"data",
")",
";",
"}",
"else",
"{... | Saves the prefs for this `Scope`.
@return {Promise} promise resolved once the data is saved. | [
"Saves",
"the",
"prefs",
"for",
"this",
"Scope",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L338-L346 | |
1,717 | adobe/brackets | src/preferences/PreferencesBase.js | function (id, value, context, location) {
if (!location) {
location = this.getPreferenceLocation(id, context);
}
if (location && location.layer) {
var layer = this._layerMap[location.layer];
if (layer) {
if (this.dat... | javascript | function (id, value, context, location) {
if (!location) {
location = this.getPreferenceLocation(id, context);
}
if (location && location.layer) {
var layer = this._layerMap[location.layer];
if (layer) {
if (this.dat... | [
"function",
"(",
"id",
",",
"value",
",",
"context",
",",
"location",
")",
"{",
"if",
"(",
"!",
"location",
")",
"{",
"location",
"=",
"this",
".",
"getPreferenceLocation",
"(",
"id",
",",
"context",
")",
";",
"}",
"if",
"(",
"location",
"&&",
"locat... | Sets the value for `id`. The value is set at the location given, or at the current
location for the preference if no location is specified. If an invalid location is
given, nothing will be set and no exception is thrown.
@param {string} id Key to set
@param {*} value Value for this key
@param {Object=} context Optiona... | [
"Sets",
"the",
"value",
"for",
"id",
".",
"The",
"value",
"is",
"set",
"at",
"the",
"location",
"given",
"or",
"at",
"the",
"current",
"location",
"for",
"the",
"preference",
"if",
"no",
"location",
"is",
"specified",
".",
"If",
"an",
"invalid",
"locatio... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L361-L381 | |
1,718 | adobe/brackets | src/preferences/PreferencesBase.js | function (id, context) {
var layerCounter,
layers = this._layers,
layer,
data = this.data,
result;
context = context || {};
for (layerCounter = 0; layerCounter < layers.length; layerCounter++) {
layer =... | javascript | function (id, context) {
var layerCounter,
layers = this._layers,
layer,
data = this.data,
result;
context = context || {};
for (layerCounter = 0; layerCounter < layers.length; layerCounter++) {
layer =... | [
"function",
"(",
"id",
",",
"context",
")",
"{",
"var",
"layerCounter",
",",
"layers",
"=",
"this",
".",
"_layers",
",",
"layer",
",",
"data",
"=",
"this",
".",
"data",
",",
"result",
";",
"context",
"=",
"context",
"||",
"{",
"}",
";",
"for",
"(",... | Get the value for id, given the context. The context is provided to layers
which may override the value from the main data of the Scope. Note that
layers will often exclude values from consideration.
@param {string} id Preference to retrieve
@param {?Object} context Optional additional information about the request
@r... | [
"Get",
"the",
"value",
"for",
"id",
"given",
"the",
"context",
".",
"The",
"context",
"is",
"provided",
"to",
"layers",
"which",
"may",
"override",
"the",
"value",
"from",
"the",
"main",
"data",
"of",
"the",
"Scope",
".",
"Note",
"that",
"layers",
"will"... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L415-L435 | |
1,719 | adobe/brackets | src/preferences/PreferencesBase.js | function (context) {
context = context || {};
var layerCounter,
layers = this._layers,
layer,
data = this.data;
var keySets = [_.difference(_.keys(data), this._exclusions)];
for (layerCounter = 0; layerCounter < layers.len... | javascript | function (context) {
context = context || {};
var layerCounter,
layers = this._layers,
layer,
data = this.data;
var keySets = [_.difference(_.keys(data), this._exclusions)];
for (layerCounter = 0; layerCounter < layers.len... | [
"function",
"(",
"context",
")",
"{",
"context",
"=",
"context",
"||",
"{",
"}",
";",
"var",
"layerCounter",
",",
"layers",
"=",
"this",
".",
"_layers",
",",
"layer",
",",
"data",
"=",
"this",
".",
"data",
";",
"var",
"keySets",
"=",
"[",
"_",
".",... | Get the preference IDs that are set in this Scope. All layers are added
in. If context is not provided, the set of all keys in the Scope including
all keys in each layer will be returned.
@param {?Object} context Optional additional information for looking up the keys
@return {Array.<string>} Set of preferences set by... | [
"Get",
"the",
"preference",
"IDs",
"that",
"are",
"set",
"in",
"this",
"Scope",
".",
"All",
"layers",
"are",
"added",
"in",
".",
"If",
"context",
"is",
"not",
"provided",
"the",
"set",
"of",
"all",
"keys",
"in",
"the",
"Scope",
"including",
"all",
"key... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L486-L501 | |
1,720 | adobe/brackets | src/preferences/PreferencesBase.js | function (layer) {
this._layers.push(layer);
this._layerMap[layer.key] = layer;
this._exclusions.push(layer.key);
this.trigger(PREFERENCE_CHANGE, {
ids: layer.getKeys(this.data[layer.key], {})
});
} | javascript | function (layer) {
this._layers.push(layer);
this._layerMap[layer.key] = layer;
this._exclusions.push(layer.key);
this.trigger(PREFERENCE_CHANGE, {
ids: layer.getKeys(this.data[layer.key], {})
});
} | [
"function",
"(",
"layer",
")",
"{",
"this",
".",
"_layers",
".",
"push",
"(",
"layer",
")",
";",
"this",
".",
"_layerMap",
"[",
"layer",
".",
"key",
"]",
"=",
"layer",
";",
"this",
".",
"_exclusions",
".",
"push",
"(",
"layer",
".",
"key",
")",
"... | Adds a Layer to this Scope. The Layer object should define a `key`, which
represents the subset of the preference data that the Layer works with.
Layers should also define `get` and `getKeys` operations that are like their
counterparts in Scope but take "data" as the first argument.
Listeners are notified of potential... | [
"Adds",
"a",
"Layer",
"to",
"this",
"Scope",
".",
"The",
"Layer",
"object",
"should",
"define",
"a",
"key",
"which",
"represents",
"the",
"subset",
"of",
"the",
"preference",
"data",
"that",
"the",
"Layer",
"works",
"with",
".",
"Layers",
"should",
"also",... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L514-L521 | |
1,721 | adobe/brackets | src/preferences/PreferencesBase.js | function (oldContext, newContext) {
var changes = [],
data = this.data;
_.each(this._layers, function (layer) {
if (data[layer.key] && oldContext[layer.key] !== newContext[layer.key]) {
var changesInLayer = layer.contextChanged(data[layer.k... | javascript | function (oldContext, newContext) {
var changes = [],
data = this.data;
_.each(this._layers, function (layer) {
if (data[layer.key] && oldContext[layer.key] !== newContext[layer.key]) {
var changesInLayer = layer.contextChanged(data[layer.k... | [
"function",
"(",
"oldContext",
",",
"newContext",
")",
"{",
"var",
"changes",
"=",
"[",
"]",
",",
"data",
"=",
"this",
".",
"data",
";",
"_",
".",
"each",
"(",
"this",
".",
"_layers",
",",
"function",
"(",
"layer",
")",
"{",
"if",
"(",
"data",
"[... | Determines if there are likely to be any changes based on the change
of context.
@param {{path: string, language: string}} oldContext Old context
@param {{path: string, language: string}} newContext New context
@return {Array.<string>} List of changed IDs | [
"Determines",
"if",
"there",
"are",
"likely",
"to",
"be",
"any",
"changes",
"based",
"on",
"the",
"change",
"of",
"context",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L541-L556 | |
1,722 | adobe/brackets | src/preferences/PreferencesBase.js | function (data, id) {
if (!data || !this.projectPath) {
return;
}
if (data[this.projectPath] && (data[this.projectPath][id] !== undefined)) {
return data[this.projectPath][id];
}
return;
} | javascript | function (data, id) {
if (!data || !this.projectPath) {
return;
}
if (data[this.projectPath] && (data[this.projectPath][id] !== undefined)) {
return data[this.projectPath][id];
}
return;
} | [
"function",
"(",
"data",
",",
"id",
")",
"{",
"if",
"(",
"!",
"data",
"||",
"!",
"this",
".",
"projectPath",
")",
"{",
"return",
";",
"}",
"if",
"(",
"data",
"[",
"this",
".",
"projectPath",
"]",
"&&",
"(",
"data",
"[",
"this",
".",
"projectPath"... | Retrieve the current value based on the current project path
in the layer.
@param {Object} data the preference data from the Scope
@param {string} id preference ID to look up | [
"Retrieve",
"the",
"current",
"value",
"based",
"on",
"the",
"current",
"project",
"path",
"in",
"the",
"layer",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L610-L619 | |
1,723 | adobe/brackets | src/preferences/PreferencesBase.js | function (data) {
if (!data) {
return;
}
return _.union.apply(null, _.map(_.values(data), _.keys));
} | javascript | function (data) {
if (!data) {
return;
}
return _.union.apply(null, _.map(_.values(data), _.keys));
} | [
"function",
"(",
"data",
")",
"{",
"if",
"(",
"!",
"data",
")",
"{",
"return",
";",
"}",
"return",
"_",
".",
"union",
".",
"apply",
"(",
"null",
",",
"_",
".",
"map",
"(",
"_",
".",
"values",
"(",
"data",
")",
",",
"_",
".",
"keys",
")",
")... | Retrieves the keys provided by this layer object.
@param {Object} data the preference data from the Scope | [
"Retrieves",
"the",
"keys",
"provided",
"by",
"this",
"layer",
"object",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L684-L690 | |
1,724 | adobe/brackets | src/preferences/PreferencesBase.js | function (data, id, context) {
if (!data || !context.language) {
return;
}
if (data[context.language] && (data[context.language][id] !== undefined)) {
return data[context.language][id];
}
return;
} | javascript | function (data, id, context) {
if (!data || !context.language) {
return;
}
if (data[context.language] && (data[context.language][id] !== undefined)) {
return data[context.language][id];
}
return;
} | [
"function",
"(",
"data",
",",
"id",
",",
"context",
")",
"{",
"if",
"(",
"!",
"data",
"||",
"!",
"context",
".",
"language",
")",
"{",
"return",
";",
"}",
"if",
"(",
"data",
"[",
"context",
".",
"language",
"]",
"&&",
"(",
"data",
"[",
"context",... | Retrieve the current value based on the specified context. If the context
does contain language field, undefined is returned.
@param {Object} data the preference data from the Scope
@param {string} id preference ID to look up
@param {{language: string}} context Context to operate with
@return {*|undefined} property va... | [
"Retrieve",
"the",
"current",
"value",
"based",
"on",
"the",
"specified",
"context",
".",
"If",
"the",
"context",
"does",
"contain",
"language",
"field",
"undefined",
"is",
"returned",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L725-L734 | |
1,725 | adobe/brackets | src/preferences/PreferencesBase.js | function (data, oldContext, newContext) {
// this function is called only if the language has changed
if (newContext.language === undefined) {
return _.keys(data[oldContext.language]);
}
if (oldContext.language === undefined) {
return _.key... | javascript | function (data, oldContext, newContext) {
// this function is called only if the language has changed
if (newContext.language === undefined) {
return _.keys(data[oldContext.language]);
}
if (oldContext.language === undefined) {
return _.key... | [
"function",
"(",
"data",
",",
"oldContext",
",",
"newContext",
")",
"{",
"// this function is called only if the language has changed",
"if",
"(",
"newContext",
".",
"language",
"===",
"undefined",
")",
"{",
"return",
"_",
".",
"keys",
"(",
"data",
"[",
"oldContex... | Determines if there are preference IDs that could change as a result
of the context change. This implementation considers only changes in
language.
@param {Object} data Data in the Scope
@param {{language: string}} oldContext Old context
@param {{language: string}} newContext New context
@return {Array.<string>|undefi... | [
"Determines",
"if",
"there",
"are",
"preference",
"IDs",
"that",
"could",
"change",
"as",
"a",
"result",
"of",
"the",
"context",
"change",
".",
"This",
"implementation",
"considers",
"only",
"changes",
"in",
"language",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L834-L844 | |
1,726 | adobe/brackets | src/preferences/PreferencesBase.js | function (data, id, context) {
var glob = this.getPreferenceLocation(data, id, context);
if (!glob) {
return;
}
return data[glob][id];
} | javascript | function (data, id, context) {
var glob = this.getPreferenceLocation(data, id, context);
if (!glob) {
return;
}
return data[glob][id];
} | [
"function",
"(",
"data",
",",
"id",
",",
"context",
")",
"{",
"var",
"glob",
"=",
"this",
".",
"getPreferenceLocation",
"(",
"data",
",",
"id",
",",
"context",
")",
";",
"if",
"(",
"!",
"glob",
")",
"{",
"return",
";",
"}",
"return",
"data",
"[",
... | Retrieve the current value based on the filename in the context
object, comparing globs relative to the prefFilePath that this
PathLayer was set up with.
@param {Object} data the preference data from the Scope
@param {string} id preference ID to look up
@param {Object} context Object with filename that will be compare... | [
"Retrieve",
"the",
"current",
"value",
"based",
"on",
"the",
"filename",
"in",
"the",
"context",
"object",
"comparing",
"globs",
"relative",
"to",
"the",
"prefFilePath",
"that",
"this",
"PathLayer",
"was",
"set",
"up",
"with",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L882-L890 | |
1,727 | adobe/brackets | src/preferences/PreferencesBase.js | function (data, id, context) {
if (!data) {
return;
}
var relativeFilename = FileUtils.getRelativeFilename(this.prefFilePath, context[this.key]);
if (!relativeFilename) {
return;
}
return _findMatchingGlob(data, re... | javascript | function (data, id, context) {
if (!data) {
return;
}
var relativeFilename = FileUtils.getRelativeFilename(this.prefFilePath, context[this.key]);
if (!relativeFilename) {
return;
}
return _findMatchingGlob(data, re... | [
"function",
"(",
"data",
",",
"id",
",",
"context",
")",
"{",
"if",
"(",
"!",
"data",
")",
"{",
"return",
";",
"}",
"var",
"relativeFilename",
"=",
"FileUtils",
".",
"getRelativeFilename",
"(",
"this",
".",
"prefFilePath",
",",
"context",
"[",
"this",
... | Gets the location in which the given pref was set, if it was set within
this path layer for the current path.
@param {Object} data the preference data from the Scope
@param {string} id preference ID to look up
@param {Object} context Object with filename that will be compared to the globs
@return {string} the Layer ID... | [
"Gets",
"the",
"location",
"in",
"which",
"the",
"given",
"pref",
"was",
"set",
"if",
"it",
"was",
"set",
"within",
"this",
"path",
"layer",
"for",
"the",
"current",
"path",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L901-L912 | |
1,728 | adobe/brackets | src/preferences/PreferencesBase.js | function (data, id, value, context, layerID) {
if (!layerID) {
layerID = this.getPreferenceLocation(data, id, context);
}
if (!layerID) {
return false;
}
var section = data[layerID];
if (!section) {
... | javascript | function (data, id, value, context, layerID) {
if (!layerID) {
layerID = this.getPreferenceLocation(data, id, context);
}
if (!layerID) {
return false;
}
var section = data[layerID];
if (!section) {
... | [
"function",
"(",
"data",
",",
"id",
",",
"value",
",",
"context",
",",
"layerID",
")",
"{",
"if",
"(",
"!",
"layerID",
")",
"{",
"layerID",
"=",
"this",
".",
"getPreferenceLocation",
"(",
"data",
",",
"id",
",",
"context",
")",
";",
"}",
"if",
"(",... | Sets the preference value in the given data structure for the layerID provided. If no
layerID is provided, then the current layer is used. If a layerID is provided and it
does not exist, it will be created.
This function returns whether or not a value was set.
@param {Object} data the preference data from the Scope
@... | [
"Sets",
"the",
"preference",
"value",
"in",
"the",
"given",
"data",
"structure",
"for",
"the",
"layerID",
"provided",
".",
"If",
"no",
"layerID",
"is",
"provided",
"then",
"the",
"current",
"layer",
"is",
"used",
".",
"If",
"a",
"layerID",
"is",
"provided"... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L928-L950 | |
1,729 | adobe/brackets | src/preferences/PreferencesBase.js | function (data, context) {
if (!data) {
return;
}
var relativeFilename = FileUtils.getRelativeFilename(this.prefFilePath, context[this.key]);
if (relativeFilename) {
var glob = _findMatchingGlob(data, relativeFilename);
if... | javascript | function (data, context) {
if (!data) {
return;
}
var relativeFilename = FileUtils.getRelativeFilename(this.prefFilePath, context[this.key]);
if (relativeFilename) {
var glob = _findMatchingGlob(data, relativeFilename);
if... | [
"function",
"(",
"data",
",",
"context",
")",
"{",
"if",
"(",
"!",
"data",
")",
"{",
"return",
";",
"}",
"var",
"relativeFilename",
"=",
"FileUtils",
".",
"getRelativeFilename",
"(",
"this",
".",
"prefFilePath",
",",
"context",
"[",
"this",
".",
"key",
... | Retrieves the keys provided by this layer object. If context with a filename is provided,
only the keys for the matching file glob are given. Otherwise, all keys for all globs
are provided.
@param {Object} data the preference data from the Scope
@param {?Object} context Additional context data (filename in particular ... | [
"Retrieves",
"the",
"keys",
"provided",
"by",
"this",
"layer",
"object",
".",
"If",
"context",
"with",
"a",
"filename",
"is",
"provided",
"only",
"the",
"keys",
"for",
"the",
"matching",
"file",
"glob",
"are",
"given",
".",
"Otherwise",
"all",
"keys",
"for... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L960-L976 | |
1,730 | adobe/brackets | src/preferences/PreferencesBase.js | function (data, oldContext, newContext) {
var newGlob = _findMatchingGlob(data,
FileUtils.getRelativeFilename(this.prefFilePath, newContext[this.key])),
oldGlob = _findMatchingGlob(data,
FileUtils.getRelativeFilename(this.prefFilePa... | javascript | function (data, oldContext, newContext) {
var newGlob = _findMatchingGlob(data,
FileUtils.getRelativeFilename(this.prefFilePath, newContext[this.key])),
oldGlob = _findMatchingGlob(data,
FileUtils.getRelativeFilename(this.prefFilePa... | [
"function",
"(",
"data",
",",
"oldContext",
",",
"newContext",
")",
"{",
"var",
"newGlob",
"=",
"_findMatchingGlob",
"(",
"data",
",",
"FileUtils",
".",
"getRelativeFilename",
"(",
"this",
".",
"prefFilePath",
",",
"newContext",
"[",
"this",
".",
"key",
"]",... | Determines if there are preference IDs that could change as a result of
a change in the context. This implementation considers only the path portion
of the context and looks up matching globes if any.
@param {Object} data Data in the Scope
@param {{path: string}} oldContext Old context
@param {{path: string}} newConte... | [
"Determines",
"if",
"there",
"are",
"preference",
"IDs",
"that",
"could",
"change",
"as",
"a",
"result",
"of",
"a",
"change",
"in",
"the",
"context",
".",
"This",
"implementation",
"considers",
"only",
"the",
"path",
"portion",
"of",
"the",
"context",
"and",... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L1001-L1018 | |
1,731 | adobe/brackets | src/preferences/PreferencesBase.js | function (id, context) {
context = context || {};
return this.base.get(this.prefix + id, this.base._getContext(context));
} | javascript | function (id, context) {
context = context || {};
return this.base.get(this.prefix + id, this.base._getContext(context));
} | [
"function",
"(",
"id",
",",
"context",
")",
"{",
"context",
"=",
"context",
"||",
"{",
"}",
";",
"return",
"this",
".",
"base",
".",
"get",
"(",
"this",
".",
"prefix",
"+",
"id",
",",
"this",
".",
"base",
".",
"_getContext",
"(",
"context",
")",
... | Gets the prefixed preference
@param {string} id Name of the preference for which the value should be retrieved
@param {Object=} context Optional context object to change the preference lookup | [
"Gets",
"the",
"prefixed",
"preference"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L1099-L1102 | |
1,732 | adobe/brackets | src/preferences/PreferencesBase.js | function (id, value, options, doNotSave) {
return this.base.set(this.prefix + id, value, options, doNotSave);
} | javascript | function (id, value, options, doNotSave) {
return this.base.set(this.prefix + id, value, options, doNotSave);
} | [
"function",
"(",
"id",
",",
"value",
",",
"options",
",",
"doNotSave",
")",
"{",
"return",
"this",
".",
"base",
".",
"set",
"(",
"this",
".",
"prefix",
"+",
"id",
",",
"value",
",",
"options",
",",
"doNotSave",
")",
";",
"}"
] | Sets the prefixed preference
@param {string} id Identifier of the preference to set
@param {Object} value New value for the preference
@param {{location: ?Object, context: ?Object}=} options Specific location in which to set the value or the context to use when setting the value
@param {boolean=} doNotSave True if the... | [
"Sets",
"the",
"prefixed",
"preference"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L1125-L1127 | |
1,733 | adobe/brackets | src/preferences/PreferencesBase.js | function (event, preferenceID, handler) {
if (typeof preferenceID === "function") {
handler = preferenceID;
preferenceID = null;
}
if (preferenceID) {
var pref = this.getPreference(preferenceID);
pref.on(event, handler)... | javascript | function (event, preferenceID, handler) {
if (typeof preferenceID === "function") {
handler = preferenceID;
preferenceID = null;
}
if (preferenceID) {
var pref = this.getPreference(preferenceID);
pref.on(event, handler)... | [
"function",
"(",
"event",
",",
"preferenceID",
",",
"handler",
")",
"{",
"if",
"(",
"typeof",
"preferenceID",
"===",
"\"function\"",
")",
"{",
"handler",
"=",
"preferenceID",
";",
"preferenceID",
"=",
"null",
";",
"}",
"if",
"(",
"preferenceID",
")",
"{",
... | Sets up a listener for events for this PrefixedPreferencesSystem. Only prefixed events
will notify. Optionally, you can set up a listener for a specific preference.
@param {string} event Name of the event to listen for
@param {string|Function} preferenceID Name of a specific preference or the handler function
@param {... | [
"Sets",
"up",
"a",
"listener",
"for",
"events",
"for",
"this",
"PrefixedPreferencesSystem",
".",
"Only",
"prefixed",
"events",
"will",
"notify",
".",
"Optionally",
"you",
"can",
"set",
"up",
"a",
"listener",
"for",
"a",
"specific",
"preference",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L1174-L1187 | |
1,734 | adobe/brackets | src/preferences/PreferencesBase.js | function (event, preferenceID, handler) {
if (typeof preferenceID === "function") {
handler = preferenceID;
preferenceID = null;
}
if (preferenceID) {
var pref = this.getPreference(preferenceID);
pref.off(event, handler... | javascript | function (event, preferenceID, handler) {
if (typeof preferenceID === "function") {
handler = preferenceID;
preferenceID = null;
}
if (preferenceID) {
var pref = this.getPreference(preferenceID);
pref.off(event, handler... | [
"function",
"(",
"event",
",",
"preferenceID",
",",
"handler",
")",
"{",
"if",
"(",
"typeof",
"preferenceID",
"===",
"\"function\"",
")",
"{",
"handler",
"=",
"preferenceID",
";",
"preferenceID",
"=",
"null",
";",
"}",
"if",
"(",
"preferenceID",
")",
"{",
... | Turns off the event handlers for a given event, optionally for a specific preference
or a specific handler function.
@param {string} event Name of the event for which to turn off listening
@param {string|Function} preferenceID Name of a specific preference or the handler function
@param {?Function} handler Specific ha... | [
"Turns",
"off",
"the",
"event",
"handlers",
"for",
"a",
"given",
"event",
"optionally",
"for",
"a",
"specific",
"preference",
"or",
"a",
"specific",
"handler",
"function",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L1197-L1209 | |
1,735 | adobe/brackets | src/preferences/PreferencesBase.js | PreferencesSystem | function PreferencesSystem(contextBuilder) {
this.contextBuilder = contextBuilder;
this._knownPrefs = {};
this._scopes = {
"default": new Scope(new MemoryStorage())
};
this._scopes["default"].load();
this._defaults = {
scopeOrder: ["default"],
... | javascript | function PreferencesSystem(contextBuilder) {
this.contextBuilder = contextBuilder;
this._knownPrefs = {};
this._scopes = {
"default": new Scope(new MemoryStorage())
};
this._scopes["default"].load();
this._defaults = {
scopeOrder: ["default"],
... | [
"function",
"PreferencesSystem",
"(",
"contextBuilder",
")",
"{",
"this",
".",
"contextBuilder",
"=",
"contextBuilder",
";",
"this",
".",
"_knownPrefs",
"=",
"{",
"}",
";",
"this",
".",
"_scopes",
"=",
"{",
"\"default\"",
":",
"new",
"Scope",
"(",
"new",
"... | PreferencesSystem ties everything together to provide a simple interface for
managing the whole prefs system.
It keeps track of multiple Scope levels and also manages path-based Scopes.
It also provides the ability to register preferences, which gives a fine-grained
means for listening for changes and will ultimately... | [
"PreferencesSystem",
"ties",
"everything",
"together",
"to",
"provide",
"a",
"simple",
"interface",
"for",
"managing",
"the",
"whole",
"prefs",
"system",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L1240-L1290 |
1,736 | adobe/brackets | src/preferences/PreferencesBase.js | function (id, type, initial, options) {
options = options || {};
if (this._knownPrefs.hasOwnProperty(id)) {
throw new Error("Preference " + id + " was redefined");
}
var pref = this._knownPrefs[id] = new Preference({
type: type,
... | javascript | function (id, type, initial, options) {
options = options || {};
if (this._knownPrefs.hasOwnProperty(id)) {
throw new Error("Preference " + id + " was redefined");
}
var pref = this._knownPrefs[id] = new Preference({
type: type,
... | [
"function",
"(",
"id",
",",
"type",
",",
"initial",
",",
"options",
")",
"{",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"if",
"(",
"this",
".",
"_knownPrefs",
".",
"hasOwnProperty",
"(",
"id",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"P... | Defines a new preference.
@param {string} id identifier of the preference. Generally a dotted name.
@param {string} type Data type for the preference (generally, string, boolean, number)
@param {Object} initial Default value for the preference
@param {?{name: string=, description: string=, validator: function=, exclud... | [
"Defines",
"a",
"new",
"preference",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L1311-L1333 | |
1,737 | adobe/brackets | src/preferences/PreferencesBase.js | function (id, addBefore) {
var shadowScopeOrder = this._defaults._shadowScopeOrder,
index = _.findIndex(shadowScopeOrder, function (entry) {
return entry.id === id;
}),
entry;
if (index > -1) {
entry = shadowScop... | javascript | function (id, addBefore) {
var shadowScopeOrder = this._defaults._shadowScopeOrder,
index = _.findIndex(shadowScopeOrder, function (entry) {
return entry.id === id;
}),
entry;
if (index > -1) {
entry = shadowScop... | [
"function",
"(",
"id",
",",
"addBefore",
")",
"{",
"var",
"shadowScopeOrder",
"=",
"this",
".",
"_defaults",
".",
"_shadowScopeOrder",
",",
"index",
"=",
"_",
".",
"findIndex",
"(",
"shadowScopeOrder",
",",
"function",
"(",
"entry",
")",
"{",
"return",
"en... | Adds scope to the scope order by its id. The scope should be previously added to the preference system.
@param {string} id the scope id
@param {string} before the id of the scope to add before | [
"Adds",
"scope",
"to",
"the",
"scope",
"order",
"by",
"its",
"id",
".",
"The",
"scope",
"should",
"be",
"previously",
"added",
"to",
"the",
"preference",
"system",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L1516-L1526 | |
1,738 | adobe/brackets | src/preferences/PreferencesBase.js | function (id) {
var scope = this._scopes[id];
if (scope) {
_.pull(this._defaults.scopeOrder, id);
scope.off(".prefsys");
this.trigger(SCOPEORDER_CHANGE, {
id: id,
action: "removed"
});
... | javascript | function (id) {
var scope = this._scopes[id];
if (scope) {
_.pull(this._defaults.scopeOrder, id);
scope.off(".prefsys");
this.trigger(SCOPEORDER_CHANGE, {
id: id,
action: "removed"
});
... | [
"function",
"(",
"id",
")",
"{",
"var",
"scope",
"=",
"this",
".",
"_scopes",
"[",
"id",
"]",
";",
"if",
"(",
"scope",
")",
"{",
"_",
".",
"pull",
"(",
"this",
".",
"_defaults",
".",
"scopeOrder",
",",
"id",
")",
";",
"scope",
".",
"off",
"(",
... | Removes a scope from the default scope order.
@param {string} id Name of the Scope to remove from the default scope order. | [
"Removes",
"a",
"scope",
"from",
"the",
"default",
"scope",
"order",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L1533-L1546 | |
1,739 | adobe/brackets | src/preferences/PreferencesBase.js | function (id, scope, options) {
var promise;
options = options || {};
if (this._scopes[id]) {
throw new Error("Attempt to redefine preferences scope: " + id);
}
// Check to see if scope is a Storage that needs to be wrapped
if (!s... | javascript | function (id, scope, options) {
var promise;
options = options || {};
if (this._scopes[id]) {
throw new Error("Attempt to redefine preferences scope: " + id);
}
// Check to see if scope is a Storage that needs to be wrapped
if (!s... | [
"function",
"(",
"id",
",",
"scope",
",",
"options",
")",
"{",
"var",
"promise",
";",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"if",
"(",
"this",
".",
"_scopes",
"[",
"id",
"]",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Attempt to redefine pr... | Adds a new Scope. New Scopes are added at the highest precedence, unless the "before" option
is given. The new Scope is automatically loaded.
@param {string} id Name of the Scope
@param {Scope|Storage} scope the Scope object itself. Optionally, can be given a Storage directly for convenience.
@param {{before: string}}... | [
"Adds",
"a",
"new",
"Scope",
".",
"New",
"Scopes",
"are",
"added",
"at",
"the",
"highest",
"precedence",
"unless",
"the",
"before",
"option",
"is",
"given",
".",
"The",
"new",
"Scope",
"is",
"automatically",
"loaded",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L1582-L1609 | |
1,740 | adobe/brackets | src/preferences/PreferencesBase.js | function (id) {
var scope = this._scopes[id],
shadowIndex;
if (!scope) {
return;
}
this.removeFromScopeOrder(id);
shadowIndex = _.findIndex(this._defaults._shadowScopeOrder, function (entry) {
return entry.id ==... | javascript | function (id) {
var scope = this._scopes[id],
shadowIndex;
if (!scope) {
return;
}
this.removeFromScopeOrder(id);
shadowIndex = _.findIndex(this._defaults._shadowScopeOrder, function (entry) {
return entry.id ==... | [
"function",
"(",
"id",
")",
"{",
"var",
"scope",
"=",
"this",
".",
"_scopes",
"[",
"id",
"]",
",",
"shadowIndex",
";",
"if",
"(",
"!",
"scope",
")",
"{",
"return",
";",
"}",
"this",
".",
"removeFromScopeOrder",
"(",
"id",
")",
";",
"shadowIndex",
"... | Removes a Scope from this PreferencesSystem. Returns without doing anything
if the Scope does not exist. Notifies listeners of preferences that may have
changed.
@param {string} id Name of the Scope to remove | [
"Removes",
"a",
"Scope",
"from",
"this",
"PreferencesSystem",
".",
"Returns",
"without",
"doing",
"anything",
"if",
"the",
"Scope",
"does",
"not",
"exist",
".",
"Notifies",
"listeners",
"of",
"preferences",
"that",
"may",
"have",
"changed",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L1618-L1631 | |
1,741 | adobe/brackets | src/preferences/PreferencesBase.js | function (id, context) {
var scopeCounter;
context = this._getContext(context);
var scopeOrder = this._getScopeOrder(context);
for (scopeCounter = 0; scopeCounter < scopeOrder.length; scopeCounter++) {
var scope = this._scopes[scopeOrder[scopeCounter]];... | javascript | function (id, context) {
var scopeCounter;
context = this._getContext(context);
var scopeOrder = this._getScopeOrder(context);
for (scopeCounter = 0; scopeCounter < scopeOrder.length; scopeCounter++) {
var scope = this._scopes[scopeOrder[scopeCounter]];... | [
"function",
"(",
"id",
",",
"context",
")",
"{",
"var",
"scopeCounter",
";",
"context",
"=",
"this",
".",
"_getContext",
"(",
"context",
")",
";",
"var",
"scopeOrder",
"=",
"this",
".",
"_getScopeOrder",
"(",
"context",
")",
";",
"for",
"(",
"scopeCounte... | Get the current value of a preference. The optional context provides a way to
change scope ordering or the reference filename for path-based scopes.
@param {string} id Name of the preference for which the value should be retrieved
@param {Object|string=} context Optional context object or name of context to change the... | [
"Get",
"the",
"current",
"value",
"of",
"a",
"preference",
".",
"The",
"optional",
"context",
"provides",
"a",
"way",
"to",
"change",
"scope",
"ordering",
"or",
"the",
"reference",
"filename",
"for",
"path",
"-",
"based",
"scopes",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L1654-L1677 | |
1,742 | adobe/brackets | src/preferences/PreferencesBase.js | function (id, context) {
var scopeCounter,
scopeName;
context = this._getContext(context);
var scopeOrder = this._getScopeOrder(context);
for (scopeCounter = 0; scopeCounter < scopeOrder.length; scopeCounter++) {
scopeName = scopeOrder[s... | javascript | function (id, context) {
var scopeCounter,
scopeName;
context = this._getContext(context);
var scopeOrder = this._getScopeOrder(context);
for (scopeCounter = 0; scopeCounter < scopeOrder.length; scopeCounter++) {
scopeName = scopeOrder[s... | [
"function",
"(",
"id",
",",
"context",
")",
"{",
"var",
"scopeCounter",
",",
"scopeName",
";",
"context",
"=",
"this",
".",
"_getContext",
"(",
"context",
")",
";",
"var",
"scopeOrder",
"=",
"this",
".",
"_getScopeOrder",
"(",
"context",
")",
";",
"for",... | Gets the location in which the value of a preference has been set.
@param {string} id Name of the preference for which the value should be retrieved
@param {Object=} context Optional context object to change the preference lookup
@return {{scope: string, layer: ?string, layerID: ?object}} Object describing where the p... | [
"Gets",
"the",
"location",
"in",
"which",
"the",
"value",
"of",
"a",
"preference",
"has",
"been",
"set",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L1686-L1705 | |
1,743 | adobe/brackets | src/preferences/PreferencesBase.js | function (id, value, options, doNotSave) {
options = options || {};
var context = this._getContext(options.context),
// The case where the "default" scope was chosen specifically is special.
// Usually "default" would come up only when a preference did not have a... | javascript | function (id, value, options, doNotSave) {
options = options || {};
var context = this._getContext(options.context),
// The case where the "default" scope was chosen specifically is special.
// Usually "default" would come up only when a preference did not have a... | [
"function",
"(",
"id",
",",
"value",
",",
"options",
",",
"doNotSave",
")",
"{",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"var",
"context",
"=",
"this",
".",
"_getContext",
"(",
"options",
".",
"context",
")",
",",
"// The case where the \"default\"... | Sets a preference and notifies listeners that there may
have been a change. By default, the preference is set in the same location in which
it was defined except for the "default" scope. If the current value of the preference
comes from the "default" scope, the new value will be set at the level just above
default.
@p... | [
"Sets",
"a",
"preference",
"and",
"notifies",
"listeners",
"that",
"there",
"may",
"have",
"been",
"a",
"change",
".",
"By",
"default",
"the",
"preference",
"is",
"set",
"in",
"the",
"same",
"location",
"in",
"which",
"it",
"was",
"defined",
"except",
"for... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L1721-L1766 | |
1,744 | adobe/brackets | src/preferences/PreferencesBase.js | function () {
if (this._saveInProgress) {
if (!this._nextSaveDeferred) {
this._nextSaveDeferred = new $.Deferred();
}
return this._nextSaveDeferred.promise();
}
var deferred = this._nextSaveDeferred || (new $.Deferr... | javascript | function () {
if (this._saveInProgress) {
if (!this._nextSaveDeferred) {
this._nextSaveDeferred = new $.Deferred();
}
return this._nextSaveDeferred.promise();
}
var deferred = this._nextSaveDeferred || (new $.Deferr... | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"_saveInProgress",
")",
"{",
"if",
"(",
"!",
"this",
".",
"_nextSaveDeferred",
")",
"{",
"this",
".",
"_nextSaveDeferred",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
";",
"}",
"return",
"this",
".",... | Saves the preferences. If a save is already in progress, a Promise is returned for
that save operation.
@return {Promise} Resolved when the preferences are done saving. | [
"Saves",
"the",
"preferences",
".",
"If",
"a",
"save",
"is",
"already",
"in",
"progress",
"a",
"Promise",
"is",
"returned",
"for",
"that",
"save",
"operation",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L1774-L1805 | |
1,745 | adobe/brackets | src/preferences/PreferencesBase.js | function (oldContext, newContext) {
var changes = [];
_.each(this._scopes, function (scope) {
var changedInScope = scope.contextChanged(oldContext, newContext);
if (changedInScope) {
changes.push(changedInScope);
}
... | javascript | function (oldContext, newContext) {
var changes = [];
_.each(this._scopes, function (scope) {
var changedInScope = scope.contextChanged(oldContext, newContext);
if (changedInScope) {
changes.push(changedInScope);
}
... | [
"function",
"(",
"oldContext",
",",
"newContext",
")",
"{",
"var",
"changes",
"=",
"[",
"]",
";",
"_",
".",
"each",
"(",
"this",
".",
"_scopes",
",",
"function",
"(",
"scope",
")",
"{",
"var",
"changedInScope",
"=",
"scope",
".",
"contextChanged",
"(",... | Signals the context change to all the scopes within the preferences
layer. PreferencesManager is in charge of computing the context and
signaling the changes to PreferencesSystem.
@param {{path: string, language: string}} oldContext Old context
@param {{path: string, language: string}} newContext New context | [
"Signals",
"the",
"context",
"change",
"to",
"all",
"the",
"scopes",
"within",
"the",
"preferences",
"layer",
".",
"PreferencesManager",
"is",
"in",
"charge",
"of",
"computing",
"the",
"context",
"and",
"signaling",
"the",
"changes",
"to",
"PreferencesSystem",
"... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/preferences/PreferencesBase.js#L1815-L1831 | |
1,746 | adobe/brackets | src/project/SidebarView.js | _updateWorkingSetState | function _updateWorkingSetState() {
if (MainViewManager.getPaneCount() === 1 &&
MainViewManager.getWorkingSetSize(MainViewManager.ACTIVE_PANE) === 0) {
$workingSetViewsContainer.hide();
$gearMenu.hide();
} else {
$workingSetViewsContainer.show();
... | javascript | function _updateWorkingSetState() {
if (MainViewManager.getPaneCount() === 1 &&
MainViewManager.getWorkingSetSize(MainViewManager.ACTIVE_PANE) === 0) {
$workingSetViewsContainer.hide();
$gearMenu.hide();
} else {
$workingSetViewsContainer.show();
... | [
"function",
"_updateWorkingSetState",
"(",
")",
"{",
"if",
"(",
"MainViewManager",
".",
"getPaneCount",
"(",
")",
"===",
"1",
"&&",
"MainViewManager",
".",
"getWorkingSetSize",
"(",
"MainViewManager",
".",
"ACTIVE_PANE",
")",
"===",
"0",
")",
"{",
"$workingSetVi... | Update state of working set
@private | [
"Update",
"state",
"of",
"working",
"set"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/SidebarView.js#L115-L124 |
1,747 | adobe/brackets | src/project/SidebarView.js | _updateUIStates | function _updateUIStates() {
var spriteIndex,
ICON_CLASSES = ["splitview-icon-none", "splitview-icon-vertical", "splitview-icon-horizontal"],
layoutScheme = MainViewManager.getLayoutScheme();
if (layoutScheme.columns > 1) {
spriteIndex = 1;
} else if (layoutS... | javascript | function _updateUIStates() {
var spriteIndex,
ICON_CLASSES = ["splitview-icon-none", "splitview-icon-vertical", "splitview-icon-horizontal"],
layoutScheme = MainViewManager.getLayoutScheme();
if (layoutScheme.columns > 1) {
spriteIndex = 1;
} else if (layoutS... | [
"function",
"_updateUIStates",
"(",
")",
"{",
"var",
"spriteIndex",
",",
"ICON_CLASSES",
"=",
"[",
"\"splitview-icon-none\"",
",",
"\"splitview-icon-vertical\"",
",",
"\"splitview-icon-horizontal\"",
"]",
",",
"layoutScheme",
"=",
"MainViewManager",
".",
"getLayoutScheme"... | Update state of splitview and option elements
@private | [
"Update",
"state",
"of",
"splitview",
"and",
"option",
"elements"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/SidebarView.js#L130-L154 |
1,748 | adobe/brackets | src/extensions/default/CommandLineTool/main.js | addCommand | function addCommand() {
var menu = Menus.getMenu(Menus.AppMenuBar.FILE_MENU),
INSTALL_COMMAND_SCRIPT = "file.installCommandScript";
CommandManager.register(Strings.CMD_LAUNCH_SCRIPT_MAC, INSTALL_COMMAND_SCRIPT, handleInstallCommand);
menu.addMenuDivider();
... | javascript | function addCommand() {
var menu = Menus.getMenu(Menus.AppMenuBar.FILE_MENU),
INSTALL_COMMAND_SCRIPT = "file.installCommandScript";
CommandManager.register(Strings.CMD_LAUNCH_SCRIPT_MAC, INSTALL_COMMAND_SCRIPT, handleInstallCommand);
menu.addMenuDivider();
... | [
"function",
"addCommand",
"(",
")",
"{",
"var",
"menu",
"=",
"Menus",
".",
"getMenu",
"(",
"Menus",
".",
"AppMenuBar",
".",
"FILE_MENU",
")",
",",
"INSTALL_COMMAND_SCRIPT",
"=",
"\"file.installCommandScript\"",
";",
"CommandManager",
".",
"register",
"(",
"Strin... | Register the command and add the menu to file menu. | [
"Register",
"the",
"command",
"and",
"add",
"the",
"menu",
"to",
"file",
"menu",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/CommandLineTool/main.js#L97-L105 |
1,749 | adobe/brackets | src/JSUtils/Session.js | Session | function Session(editor) {
this.editor = editor;
this.path = editor.document.file.fullPath;
this.ternHints = [];
this.ternGuesses = null;
this.fnType = null;
this.builtins = null;
} | javascript | function Session(editor) {
this.editor = editor;
this.path = editor.document.file.fullPath;
this.ternHints = [];
this.ternGuesses = null;
this.fnType = null;
this.builtins = null;
} | [
"function",
"Session",
"(",
"editor",
")",
"{",
"this",
".",
"editor",
"=",
"editor",
";",
"this",
".",
"path",
"=",
"editor",
".",
"document",
".",
"file",
".",
"fullPath",
";",
"this",
".",
"ternHints",
"=",
"[",
"]",
";",
"this",
".",
"ternGuesses... | Session objects encapsulate state associated with a hinting session
and provide methods for updating and querying the session.
@constructor
@param {Editor} editor - the editor context for the session | [
"Session",
"objects",
"encapsulate",
"state",
"associated",
"with",
"a",
"hinting",
"session",
"and",
"provide",
"methods",
"for",
"updating",
"and",
"querying",
"the",
"session",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/Session.js#L45-L52 |
1,750 | adobe/brackets | src/JSUtils/Session.js | isOnFunctionIdentifier | function isOnFunctionIdentifier() {
// Check if we might be on function identifier of the function call.
var type = token.type,
nextToken,
localLexical,
localCursor = {line: cursor.line, ch: token.end};
if (type === "variable-2" || ty... | javascript | function isOnFunctionIdentifier() {
// Check if we might be on function identifier of the function call.
var type = token.type,
nextToken,
localLexical,
localCursor = {line: cursor.line, ch: token.end};
if (type === "variable-2" || ty... | [
"function",
"isOnFunctionIdentifier",
"(",
")",
"{",
"// Check if we might be on function identifier of the function call.",
"var",
"type",
"=",
"token",
".",
"type",
",",
"nextToken",
",",
"localLexical",
",",
"localCursor",
"=",
"{",
"line",
":",
"cursor",
".",
"lin... | Test if the cursor is on a function identifier
@return {Object} - lexical state if on a function identifier, null otherwise. | [
"Test",
"if",
"the",
"cursor",
"is",
"on",
"a",
"function",
"identifier"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/Session.js#L364-L381 |
1,751 | adobe/brackets | src/JSUtils/Session.js | isInFunctionalCall | function isInFunctionalCall(lex) {
// in a call, or inside array or object brackets that are inside a function.
return (lex && (lex.info === "call" ||
(lex.info === undefined && (lex.type === "]" || lex.type === "}") &&
lex.prev.info === "call")));
} | javascript | function isInFunctionalCall(lex) {
// in a call, or inside array or object brackets that are inside a function.
return (lex && (lex.info === "call" ||
(lex.info === undefined && (lex.type === "]" || lex.type === "}") &&
lex.prev.info === "call")));
} | [
"function",
"isInFunctionalCall",
"(",
"lex",
")",
"{",
"// in a call, or inside array or object brackets that are inside a function.",
"return",
"(",
"lex",
"&&",
"(",
"lex",
".",
"info",
"===",
"\"call\"",
"||",
"(",
"lex",
".",
"info",
"===",
"undefined",
"&&",
"... | Test is a lexical state is in a function call.
@param {Object} lex - lexical state.
@return {Object | boolean} | [
"Test",
"is",
"a",
"lexical",
"state",
"is",
"in",
"a",
"function",
"call",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/Session.js#L390-L395 |
1,752 | adobe/brackets | src/JSUtils/Session.js | penalizeUnderscoreValueCompare | function penalizeUnderscoreValueCompare(a, b) {
var aName = a.value.toLowerCase(), bName = b.value.toLowerCase();
// this sort function will cause _ to sort lower than lower case
// alphabetical letters
if (aName[0] === "_" && bName[0] !== "_") {
return 1;
} else if (... | javascript | function penalizeUnderscoreValueCompare(a, b) {
var aName = a.value.toLowerCase(), bName = b.value.toLowerCase();
// this sort function will cause _ to sort lower than lower case
// alphabetical letters
if (aName[0] === "_" && bName[0] !== "_") {
return 1;
} else if (... | [
"function",
"penalizeUnderscoreValueCompare",
"(",
"a",
",",
"b",
")",
"{",
"var",
"aName",
"=",
"a",
".",
"value",
".",
"toLowerCase",
"(",
")",
",",
"bName",
"=",
"b",
".",
"value",
".",
"toLowerCase",
"(",
")",
";",
"// this sort function will cause _ to ... | Comparison function used for sorting that does a case-insensitive string comparison on the "value" field of both objects. Unlike a normal string comparison, however, this sorts leading "_" to the bottom, given that a leading "_" usually denotes a private value. | [
"Comparison",
"function",
"used",
"for",
"sorting",
"that",
"does",
"a",
"case",
"-",
"insensitive",
"string",
"comparison",
"on",
"the",
"value",
"field",
"of",
"both",
"objects",
".",
"Unlike",
"a",
"normal",
"string",
"comparison",
"however",
"this",
"sorts... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/Session.js#L491-L506 |
1,753 | adobe/brackets | src/JSUtils/Session.js | filterWithQueryAndMatcher | function filterWithQueryAndMatcher(hints, matcher) {
var matchResults = $.map(hints, function (hint) {
var searchResult = matcher.match(hint.value, query);
if (searchResult) {
searchResult.value = hint.value;
searchResult.guess = hint.g... | javascript | function filterWithQueryAndMatcher(hints, matcher) {
var matchResults = $.map(hints, function (hint) {
var searchResult = matcher.match(hint.value, query);
if (searchResult) {
searchResult.value = hint.value;
searchResult.guess = hint.g... | [
"function",
"filterWithQueryAndMatcher",
"(",
"hints",
",",
"matcher",
")",
"{",
"var",
"matchResults",
"=",
"$",
".",
"map",
"(",
"hints",
",",
"function",
"(",
"hint",
")",
"{",
"var",
"searchResult",
"=",
"matcher",
".",
"match",
"(",
"hint",
".",
"va... | Filter an array hints using a given query and matcher.
The hints are returned in the format of the matcher.
The matcher returns the value in the "label" property,
the match score in "matchGoodness" property.
@param {Array} hints - array of hints
@param {StringMatcher} matcher
@return {Array} - array of matching hints. | [
"Filter",
"an",
"array",
"hints",
"using",
"a",
"given",
"query",
"and",
"matcher",
".",
"The",
"hints",
"are",
"returned",
"in",
"the",
"format",
"of",
"the",
"matcher",
".",
"The",
"matcher",
"returns",
"the",
"value",
"in",
"the",
"label",
"property",
... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/JSUtils/Session.js#L549-L589 |
1,754 | adobe/brackets | src/extensibility/Package.js | install | function install(path, nameHint, _doUpdate) {
return _extensionManagerCall(function (extensionManager) {
var d = new $.Deferred(),
destinationDirectory = ExtensionLoader.getUserExtensionPath(),
disabledDirectory = destinationDirectory.re... | javascript | function install(path, nameHint, _doUpdate) {
return _extensionManagerCall(function (extensionManager) {
var d = new $.Deferred(),
destinationDirectory = ExtensionLoader.getUserExtensionPath(),
disabledDirectory = destinationDirectory.re... | [
"function",
"install",
"(",
"path",
",",
"nameHint",
",",
"_doUpdate",
")",
"{",
"return",
"_extensionManagerCall",
"(",
"function",
"(",
"extensionManager",
")",
"{",
"var",
"d",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
",",
"destinationDirectory",
"=",
... | Validates and installs the package at the given path. Validation and
installation is handled by the Node process.
The extension will be installed into the user's extensions directory.
If the user already has the extension installed, it will instead go
into their disabled extensions directory.
The promise is resolved ... | [
"Validates",
"and",
"installs",
"the",
"package",
"at",
"the",
"given",
"path",
".",
"Validation",
"and",
"installation",
"is",
"handled",
"by",
"the",
"Node",
"process",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/Package.js#L158-L198 |
1,755 | adobe/brackets | src/extensibility/Package.js | toggleDefaultExtension | function toggleDefaultExtension(path, enabled) {
var arr = PreferencesManager.get(PREF_EXTENSIONS_DEFAULT_DISABLED);
if (!Array.isArray(arr)) { arr = []; }
var io = arr.indexOf(path);
if (enabled === true && io !== -1) {
arr.splice(io, 1);
} else if (enabled === false... | javascript | function toggleDefaultExtension(path, enabled) {
var arr = PreferencesManager.get(PREF_EXTENSIONS_DEFAULT_DISABLED);
if (!Array.isArray(arr)) { arr = []; }
var io = arr.indexOf(path);
if (enabled === true && io !== -1) {
arr.splice(io, 1);
} else if (enabled === false... | [
"function",
"toggleDefaultExtension",
"(",
"path",
",",
"enabled",
")",
"{",
"var",
"arr",
"=",
"PreferencesManager",
".",
"get",
"(",
"PREF_EXTENSIONS_DEFAULT_DISABLED",
")",
";",
"if",
"(",
"!",
"Array",
".",
"isArray",
"(",
"arr",
")",
")",
"{",
"arr",
... | This function manages the PREF_EXTENSIONS_DEFAULT_DISABLED preference
holding an array of default extension paths that should not be loaded
on Brackets startup | [
"This",
"function",
"manages",
"the",
"PREF_EXTENSIONS_DEFAULT_DISABLED",
"preference",
"holding",
"an",
"array",
"of",
"default",
"extension",
"paths",
"that",
"should",
"not",
"be",
"loaded",
"on",
"Brackets",
"startup"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/Package.js#L449-L459 |
1,756 | adobe/brackets | src/extensibility/Package.js | disable | function disable(path) {
var result = new $.Deferred(),
file = FileSystem.getFileForPath(path + "/.disabled");
var defaultExtensionPath = ExtensionLoader.getDefaultExtensionPath();
if (file.fullPath.indexOf(defaultExtensionPath) === 0) {
toggleDefaultExtension(path, fals... | javascript | function disable(path) {
var result = new $.Deferred(),
file = FileSystem.getFileForPath(path + "/.disabled");
var defaultExtensionPath = ExtensionLoader.getDefaultExtensionPath();
if (file.fullPath.indexOf(defaultExtensionPath) === 0) {
toggleDefaultExtension(path, fals... | [
"function",
"disable",
"(",
"path",
")",
"{",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
",",
"file",
"=",
"FileSystem",
".",
"getFileForPath",
"(",
"path",
"+",
"\"/.disabled\"",
")",
";",
"var",
"defaultExtensionPath",
"=",
"ExtensionLo... | Disables the extension at the given path.
@param {string} path The absolute path to the extension to disable.
@return {$.Promise} A promise that's resolved when the extenion is disabled, or
rejected if there was an error. | [
"Disables",
"the",
"extension",
"at",
"the",
"given",
"path",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/Package.js#L468-L486 |
1,757 | adobe/brackets | src/extensibility/Package.js | enable | function enable(path) {
var result = new $.Deferred(),
file = FileSystem.getFileForPath(path + "/.disabled");
function afterEnable() {
ExtensionLoader.loadExtension(FileUtils.getBaseName(path), { baseUrl: path }, "main")
.done(result.resolve)
.fai... | javascript | function enable(path) {
var result = new $.Deferred(),
file = FileSystem.getFileForPath(path + "/.disabled");
function afterEnable() {
ExtensionLoader.loadExtension(FileUtils.getBaseName(path), { baseUrl: path }, "main")
.done(result.resolve)
.fai... | [
"function",
"enable",
"(",
"path",
")",
"{",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
",",
"file",
"=",
"FileSystem",
".",
"getFileForPath",
"(",
"path",
"+",
"\"/.disabled\"",
")",
";",
"function",
"afterEnable",
"(",
")",
"{",
"Ex... | Enables the extension at the given path.
@param {string} path The absolute path to the extension to enable.
@return {$.Promise} A promise that's resolved when the extenion is enable, or
rejected if there was an error. | [
"Enables",
"the",
"extension",
"at",
"the",
"given",
"path",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/Package.js#L495-L519 |
1,758 | adobe/brackets | src/extensibility/Package.js | installUpdate | function installUpdate(path, nameHint) {
var d = new $.Deferred();
install(path, nameHint, true)
.done(function (result) {
if (result.installationStatus !== InstallationStatuses.INSTALLED) {
d.reject(result.errors);
} else {
... | javascript | function installUpdate(path, nameHint) {
var d = new $.Deferred();
install(path, nameHint, true)
.done(function (result) {
if (result.installationStatus !== InstallationStatuses.INSTALLED) {
d.reject(result.errors);
} else {
... | [
"function",
"installUpdate",
"(",
"path",
",",
"nameHint",
")",
"{",
"var",
"d",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
";",
"install",
"(",
"path",
",",
"nameHint",
",",
"true",
")",
".",
"done",
"(",
"function",
"(",
"result",
")",
"{",
"if"... | Install an extension update located at path.
This assumes that the installation was previously attempted
and an installationStatus of "ALREADY_INSTALLED", "NEEDS_UPDATE", "SAME_VERSION",
or "OLDER_VERSION" was the result.
This workflow ensures that there should not generally be validation errors
because the first pass... | [
"Install",
"an",
"extension",
"update",
"located",
"at",
"path",
".",
"This",
"assumes",
"that",
"the",
"installation",
"was",
"previously",
"attempted",
"and",
"an",
"installationStatus",
"of",
"ALREADY_INSTALLED",
"NEEDS_UPDATE",
"SAME_VERSION",
"or",
"OLDER_VERSION... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensibility/Package.js#L537-L551 |
1,759 | adobe/brackets | src/LiveDevelopment/MultiBrowserImpl/transports/node/NodeSocketTransportDomain.js | _cmdSend | function _cmdSend(idOrArray, msgStr) {
if (!Array.isArray(idOrArray)) {
idOrArray = [idOrArray];
}
idOrArray.forEach(function (id) {
var client = _clients[id];
if (!client) {
console.error("nodeSocketTransport: Couldn't find client ID: " + id);
} else {
... | javascript | function _cmdSend(idOrArray, msgStr) {
if (!Array.isArray(idOrArray)) {
idOrArray = [idOrArray];
}
idOrArray.forEach(function (id) {
var client = _clients[id];
if (!client) {
console.error("nodeSocketTransport: Couldn't find client ID: " + id);
} else {
... | [
"function",
"_cmdSend",
"(",
"idOrArray",
",",
"msgStr",
")",
"{",
"if",
"(",
"!",
"Array",
".",
"isArray",
"(",
"idOrArray",
")",
")",
"{",
"idOrArray",
"=",
"[",
"idOrArray",
"]",
";",
"}",
"idOrArray",
".",
"forEach",
"(",
"function",
"(",
"id",
"... | Sends a transport-layer message over the socket.
@param {number|Array.<number>} idOrArray A client ID or array of client IDs to send the message to.
@param {string} msgStr The message to send as a JSON string. | [
"Sends",
"a",
"transport",
"-",
"layer",
"message",
"over",
"the",
"socket",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/MultiBrowserImpl/transports/node/NodeSocketTransportDomain.js#L153-L165 |
1,760 | adobe/brackets | src/LiveDevelopment/MultiBrowserImpl/transports/node/NodeSocketTransportDomain.js | _cmdClose | function _cmdClose(clientId) {
var client = _clients[clientId];
if (client) {
client.socket.close();
delete _clients[clientId];
}
} | javascript | function _cmdClose(clientId) {
var client = _clients[clientId];
if (client) {
client.socket.close();
delete _clients[clientId];
}
} | [
"function",
"_cmdClose",
"(",
"clientId",
")",
"{",
"var",
"client",
"=",
"_clients",
"[",
"clientId",
"]",
";",
"if",
"(",
"client",
")",
"{",
"client",
".",
"socket",
".",
"close",
"(",
")",
";",
"delete",
"_clients",
"[",
"clientId",
"]",
";",
"}"... | Closes the connection for a given client ID.
@param {number} clientId | [
"Closes",
"the",
"connection",
"for",
"a",
"given",
"client",
"ID",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/LiveDevelopment/MultiBrowserImpl/transports/node/NodeSocketTransportDomain.js#L171-L177 |
1,761 | adobe/brackets | src/language/JSUtils.js | nextLine | function nextLine() {
if (stream) {
curOffset++; // account for \n
if (curOffset >= length) {
return false;
}
}
lineStart = curOffset;
var lineEnd = text.indexOf("\n", lineStart);
if (lineEnd ... | javascript | function nextLine() {
if (stream) {
curOffset++; // account for \n
if (curOffset >= length) {
return false;
}
}
lineStart = curOffset;
var lineEnd = text.indexOf("\n", lineStart);
if (lineEnd ... | [
"function",
"nextLine",
"(",
")",
"{",
"if",
"(",
"stream",
")",
"{",
"curOffset",
"++",
";",
"// account for \\n",
"if",
"(",
"curOffset",
">=",
"length",
")",
"{",
"return",
"false",
";",
"}",
"}",
"lineStart",
"=",
"curOffset",
";",
"var",
"lineEnd",
... | Get a stream for the next line, and update curOffset and lineStart to point to the beginning of that next line. Returns false if we're at the end of the text. | [
"Get",
"a",
"stream",
"for",
"the",
"next",
"line",
"and",
"update",
"curOffset",
"and",
"lineStart",
"to",
"point",
"to",
"the",
"beginning",
"of",
"that",
"next",
"line",
".",
"Returns",
"false",
"if",
"we",
"re",
"at",
"the",
"end",
"of",
"the",
"te... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/JSUtils.js#L182-L196 |
1,762 | adobe/brackets | src/language/JSUtils.js | _shouldGetFromCache | function _shouldGetFromCache(fileInfo) {
var result = new $.Deferred(),
isChanged = _changedDocumentTracker.isPathChanged(fileInfo.fullPath);
if (isChanged && fileInfo.JSUtils) {
// See if it's dirty and in the working set first
var doc = DocumentManager.getOpenDocum... | javascript | function _shouldGetFromCache(fileInfo) {
var result = new $.Deferred(),
isChanged = _changedDocumentTracker.isPathChanged(fileInfo.fullPath);
if (isChanged && fileInfo.JSUtils) {
// See if it's dirty and in the working set first
var doc = DocumentManager.getOpenDocum... | [
"function",
"_shouldGetFromCache",
"(",
"fileInfo",
")",
"{",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
",",
"isChanged",
"=",
"_changedDocumentTracker",
".",
"isPathChanged",
"(",
"fileInfo",
".",
"fullPath",
")",
";",
"if",
"(",
"isChang... | Determines if the document function cache is up to date.
@param {FileInfo} fileInfo
@return {$.Promise} A promise resolved with true with true when a function cache is available for the document. Resolves
with false when there is no cache or the cache is stale. | [
"Determines",
"if",
"the",
"document",
"function",
"cache",
"is",
"up",
"to",
"date",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/JSUtils.js#L302-L330 |
1,763 | adobe/brackets | src/language/JSUtils.js | _getFunctionsForFile | function _getFunctionsForFile(fileInfo) {
var result = new $.Deferred();
_shouldGetFromCache(fileInfo)
.done(function (useCache) {
if (useCache) {
// Return cached data. doc property is undefined since we hit the cache.
// _getOffsets(... | javascript | function _getFunctionsForFile(fileInfo) {
var result = new $.Deferred();
_shouldGetFromCache(fileInfo)
.done(function (useCache) {
if (useCache) {
// Return cached data. doc property is undefined since we hit the cache.
// _getOffsets(... | [
"function",
"_getFunctionsForFile",
"(",
"fileInfo",
")",
"{",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
";",
"_shouldGetFromCache",
"(",
"fileInfo",
")",
".",
"done",
"(",
"function",
"(",
"useCache",
")",
"{",
"if",
"(",
"useCache",
... | Resolves with a record containing the Document or FileInfo and an Array of all
function names with offsets for the specified file. Results may be cached.
@param {FileInfo} fileInfo
@return {$.Promise} A promise resolved with a document info object that
contains a map of all function names from the document and each fun... | [
"Resolves",
"with",
"a",
"record",
"containing",
"the",
"Document",
"or",
"FileInfo",
"and",
"an",
"Array",
"of",
"all",
"function",
"names",
"with",
"offsets",
"for",
"the",
"specified",
"file",
".",
"Results",
"may",
"be",
"cached",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/JSUtils.js#L389-L406 |
1,764 | adobe/brackets | src/language/JSUtils.js | findMatchingFunctions | function findMatchingFunctions(functionName, fileInfos, keepAllFiles) {
var result = new $.Deferred(),
jsFiles = [];
if (!keepAllFiles) {
// Filter fileInfos for .js files
jsFiles = fileInfos.filter(function (fileInfo) {
return FileUtils.getFileExten... | javascript | function findMatchingFunctions(functionName, fileInfos, keepAllFiles) {
var result = new $.Deferred(),
jsFiles = [];
if (!keepAllFiles) {
// Filter fileInfos for .js files
jsFiles = fileInfos.filter(function (fileInfo) {
return FileUtils.getFileExten... | [
"function",
"findMatchingFunctions",
"(",
"functionName",
",",
"fileInfos",
",",
"keepAllFiles",
")",
"{",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
",",
"jsFiles",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"keepAllFiles",
")",
"{",
"// Filt... | Return all functions that have the specified name, searching across all the given files.
@param {!String} functionName The name to match.
@param {!Array.<File>} fileInfos The array of files to search.
@param {boolean=} keepAllFiles If true, don't ignore non-javascript files.
@return {$.Promise} that will be resolved w... | [
"Return",
"all",
"functions",
"that",
"have",
"the",
"specified",
"name",
"searching",
"across",
"all",
"the",
"given",
"files",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/JSUtils.js#L455-L477 |
1,765 | adobe/brackets | src/language/JSUtils.js | findAllMatchingFunctionsInText | function findAllMatchingFunctionsInText(text, searchName) {
var allFunctions = _findAllFunctionsInText(text);
var result = [];
var lines = text.split("\n");
_.forEach(allFunctions, function (functions, functionName) {
if (functionName === searchName || searchName === "*") {
... | javascript | function findAllMatchingFunctionsInText(text, searchName) {
var allFunctions = _findAllFunctionsInText(text);
var result = [];
var lines = text.split("\n");
_.forEach(allFunctions, function (functions, functionName) {
if (functionName === searchName || searchName === "*") {
... | [
"function",
"findAllMatchingFunctionsInText",
"(",
"text",
",",
"searchName",
")",
"{",
"var",
"allFunctions",
"=",
"_findAllFunctionsInText",
"(",
"text",
")",
";",
"var",
"result",
"=",
"[",
"]",
";",
"var",
"lines",
"=",
"text",
".",
"split",
"(",
"\"\\n\... | Finds all instances of the specified searchName in "text".
Returns an Array of Objects with start and end properties.
@param text {!String} JS text to search
@param searchName {!String} function name to search for
@return {Array.<{offset:number, functionName:string}>}
Array of objects containing the start offset for e... | [
"Finds",
"all",
"instances",
"of",
"the",
"specified",
"searchName",
"in",
"text",
".",
"Returns",
"an",
"Array",
"of",
"Objects",
"with",
"start",
"and",
"end",
"properties",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/JSUtils.js#L488-L512 |
1,766 | adobe/brackets | src/view/ThemeManager.js | refresh | function refresh(force) {
if (force) {
currentTheme = null;
}
$.when(force && loadCurrentTheme()).done(function () {
var editor = EditorManager.getActiveEditor();
if (!editor || !editor._codeMirror) {
return;
}
var cm ... | javascript | function refresh(force) {
if (force) {
currentTheme = null;
}
$.when(force && loadCurrentTheme()).done(function () {
var editor = EditorManager.getActiveEditor();
if (!editor || !editor._codeMirror) {
return;
}
var cm ... | [
"function",
"refresh",
"(",
"force",
")",
"{",
"if",
"(",
"force",
")",
"{",
"currentTheme",
"=",
"null",
";",
"}",
"$",
".",
"when",
"(",
"force",
"&&",
"loadCurrentTheme",
"(",
")",
")",
".",
"done",
"(",
"function",
"(",
")",
"{",
"var",
"editor... | Refresh current theme in the editor
@param {boolean} force Forces a reload of the current theme. It reloads the theme file. | [
"Refresh",
"current",
"theme",
"in",
"the",
"editor"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/ThemeManager.js#L254-L271 |
1,767 | adobe/brackets | src/view/ThemeManager.js | loadFile | function loadFile(fileName, options) {
var deferred = new $.Deferred(),
file = FileSystem.getFileForPath(fileName),
currentThemeName = prefs.get("theme");
file.exists(function (err, exists) {
var theme;
if (exists) {
t... | javascript | function loadFile(fileName, options) {
var deferred = new $.Deferred(),
file = FileSystem.getFileForPath(fileName),
currentThemeName = prefs.get("theme");
file.exists(function (err, exists) {
var theme;
if (exists) {
t... | [
"function",
"loadFile",
"(",
"fileName",
",",
"options",
")",
"{",
"var",
"deferred",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
",",
"file",
"=",
"FileSystem",
".",
"getFileForPath",
"(",
"fileName",
")",
",",
"currentThemeName",
"=",
"prefs",
".",
"ge... | Loads a theme from a file.
@param {string} fileName is the full path to the file to be opened
@param {Object} options is an optional parameter to specify metadata
for the theme.
@return {$.Promise} promise object resolved with the theme to be loaded from fileName | [
"Loads",
"a",
"theme",
"from",
"a",
"file",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/ThemeManager.js#L282-L309 |
1,768 | adobe/brackets | src/view/ThemeManager.js | loadPackage | function loadPackage(themePackage) {
var fileName = themePackage.path + "/" + themePackage.metadata.theme.file;
return loadFile(fileName, themePackage.metadata);
} | javascript | function loadPackage(themePackage) {
var fileName = themePackage.path + "/" + themePackage.metadata.theme.file;
return loadFile(fileName, themePackage.metadata);
} | [
"function",
"loadPackage",
"(",
"themePackage",
")",
"{",
"var",
"fileName",
"=",
"themePackage",
".",
"path",
"+",
"\"/\"",
"+",
"themePackage",
".",
"metadata",
".",
"theme",
".",
"file",
";",
"return",
"loadFile",
"(",
"fileName",
",",
"themePackage",
"."... | Loads a theme from an extension package.
@param {Object} themePackage is a package from the extension manager for the theme to be loaded.
@return {$.Promise} promise object resolved with the theme to be loaded from the pacakge | [
"Loads",
"a",
"theme",
"from",
"an",
"extension",
"package",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/view/ThemeManager.js#L318-L321 |
1,769 | adobe/brackets | src/utils/AnimationUtils.js | animateUsingClass | function animateUsingClass(target, animClass, timeoutDuration) {
var result = new $.Deferred(),
$target = $(target);
timeoutDuration = timeoutDuration || 400;
function finish(e) {
if (e.target === target) {
result.resolve();
}
}
... | javascript | function animateUsingClass(target, animClass, timeoutDuration) {
var result = new $.Deferred(),
$target = $(target);
timeoutDuration = timeoutDuration || 400;
function finish(e) {
if (e.target === target) {
result.resolve();
}
}
... | [
"function",
"animateUsingClass",
"(",
"target",
",",
"animClass",
",",
"timeoutDuration",
")",
"{",
"var",
"result",
"=",
"new",
"$",
".",
"Deferred",
"(",
")",
",",
"$target",
"=",
"$",
"(",
"target",
")",
";",
"timeoutDuration",
"=",
"timeoutDuration",
"... | Start an animation by adding the given class to the given target. When the
animation is complete, removes the class, clears the event handler we attach
to watch for the animation to finish, and resolves the returned promise.
@param {Element} target The DOM node to animate.
@param {string} animClass The class that appl... | [
"Start",
"an",
"animation",
"by",
"adding",
"the",
"given",
"class",
"to",
"the",
"given",
"target",
".",
"When",
"the",
"animation",
"is",
"complete",
"removes",
"the",
"class",
"clears",
"the",
"event",
"handler",
"we",
"attach",
"to",
"watch",
"for",
"t... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/AnimationUtils.js#L68-L101 |
1,770 | adobe/brackets | src/project/FileTreeView.js | function () {
var result = this.props.parentPath + this.props.name;
// Add trailing slash for directories
if (!FileTreeViewModel.isFile(this.props.entry) && _.last(result) !== "/") {
result += "/";
}
return result;
} | javascript | function () {
var result = this.props.parentPath + this.props.name;
// Add trailing slash for directories
if (!FileTreeViewModel.isFile(this.props.entry) && _.last(result) !== "/") {
result += "/";
}
return result;
} | [
"function",
"(",
")",
"{",
"var",
"result",
"=",
"this",
".",
"props",
".",
"parentPath",
"+",
"this",
".",
"props",
".",
"name",
";",
"// Add trailing slash for directories",
"if",
"(",
"!",
"FileTreeViewModel",
".",
"isFile",
"(",
"this",
".",
"props",
"... | Computes the full path of the file represented by this input. | [
"Computes",
"the",
"full",
"path",
"of",
"the",
"file",
"represented",
"by",
"this",
"input",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileTreeView.js#L93-L102 | |
1,771 | adobe/brackets | src/project/FileTreeView.js | function (e) {
if (e.keyCode === KeyEvent.DOM_VK_ESCAPE) {
this.props.actions.cancelRename();
} else if (e.keyCode === KeyEvent.DOM_VK_RETURN) {
this.props.actions.performRename();
}
} | javascript | function (e) {
if (e.keyCode === KeyEvent.DOM_VK_ESCAPE) {
this.props.actions.cancelRename();
} else if (e.keyCode === KeyEvent.DOM_VK_RETURN) {
this.props.actions.performRename();
}
} | [
"function",
"(",
"e",
")",
"{",
"if",
"(",
"e",
".",
"keyCode",
"===",
"KeyEvent",
".",
"DOM_VK_ESCAPE",
")",
"{",
"this",
".",
"props",
".",
"actions",
".",
"cancelRename",
"(",
")",
";",
"}",
"else",
"if",
"(",
"e",
".",
"keyCode",
"===",
"KeyEve... | If the user presses enter or escape, we either successfully complete or cancel, respectively,
the rename or create operation that is underway. | [
"If",
"the",
"user",
"presses",
"enter",
"or",
"escape",
"we",
"either",
"successfully",
"complete",
"or",
"cancel",
"respectively",
"the",
"rename",
"or",
"create",
"operation",
"that",
"is",
"underway",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileTreeView.js#L175-L181 | |
1,772 | adobe/brackets | src/project/FileTreeView.js | function (e) {
this.props.actions.setRenameValue(this.props.parentPath + this.refs.name.value.trim());
if (e.keyCode !== KeyEvent.DOM_VK_LEFT &&
e.keyCode !== KeyEvent.DOM_VK_RIGHT) {
// update the width of the input field
var node = this.refs... | javascript | function (e) {
this.props.actions.setRenameValue(this.props.parentPath + this.refs.name.value.trim());
if (e.keyCode !== KeyEvent.DOM_VK_LEFT &&
e.keyCode !== KeyEvent.DOM_VK_RIGHT) {
// update the width of the input field
var node = this.refs... | [
"function",
"(",
"e",
")",
"{",
"this",
".",
"props",
".",
"actions",
".",
"setRenameValue",
"(",
"this",
".",
"props",
".",
"parentPath",
"+",
"this",
".",
"refs",
".",
"name",
".",
"value",
".",
"trim",
"(",
")",
")",
";",
"if",
"(",
"e",
".",
... | The rename or create operation can be completed or canceled by actions outside of
this component, so we keep the model up to date by sending every update via an action. | [
"The",
"rename",
"or",
"create",
"operation",
"can",
"be",
"completed",
"or",
"canceled",
"by",
"actions",
"outside",
"of",
"this",
"component",
"so",
"we",
"keep",
"the",
"model",
"up",
"to",
"date",
"by",
"sending",
"every",
"update",
"via",
"an",
"actio... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileTreeView.js#L187-L197 | |
1,773 | adobe/brackets | src/project/FileTreeView.js | function () {
var fullname = this.props.name,
extension = LanguageManager.getCompoundFileExtension(fullname);
var node = this.refs.name;
node.setSelectionRange(0, _getName(fullname, extension).length);
node.focus(); // set focus on the rename input
... | javascript | function () {
var fullname = this.props.name,
extension = LanguageManager.getCompoundFileExtension(fullname);
var node = this.refs.name;
node.setSelectionRange(0, _getName(fullname, extension).length);
node.focus(); // set focus on the rename input
... | [
"function",
"(",
")",
"{",
"var",
"fullname",
"=",
"this",
".",
"props",
".",
"name",
",",
"extension",
"=",
"LanguageManager",
".",
"getCompoundFileExtension",
"(",
"fullname",
")",
";",
"var",
"node",
"=",
"this",
".",
"refs",
".",
"name",
";",
"node",... | When this component is displayed, we scroll it into view and select the portion
of the filename that excludes the extension. | [
"When",
"this",
"component",
"is",
"displayed",
"we",
"scroll",
"it",
"into",
"view",
"and",
"select",
"the",
"portion",
"of",
"the",
"filename",
"that",
"excludes",
"the",
"extension",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileTreeView.js#L327-L335 | |
1,774 | adobe/brackets | src/project/FileTreeView.js | function (e) {
e.stopPropagation();
if (e.button === RIGHT_MOUSE_BUTTON ||
(this.props.platform === "mac" && e.button === LEFT_MOUSE_BUTTON && e.ctrlKey)) {
this.props.actions.setContext(this.myPath());
e.preventDefault();
retur... | javascript | function (e) {
e.stopPropagation();
if (e.button === RIGHT_MOUSE_BUTTON ||
(this.props.platform === "mac" && e.button === LEFT_MOUSE_BUTTON && e.ctrlKey)) {
this.props.actions.setContext(this.myPath());
e.preventDefault();
retur... | [
"function",
"(",
"e",
")",
"{",
"e",
".",
"stopPropagation",
"(",
")",
";",
"if",
"(",
"e",
".",
"button",
"===",
"RIGHT_MOUSE_BUTTON",
"||",
"(",
"this",
".",
"props",
".",
"platform",
"===",
"\"mac\"",
"&&",
"e",
".",
"button",
"===",
"LEFT_MOUSE_BUT... | Send matching mouseDown events to the action creator as a setContext action. | [
"Send",
"matching",
"mouseDown",
"events",
"to",
"the",
"action",
"creator",
"as",
"a",
"setContext",
"action",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileTreeView.js#L368-L380 | |
1,775 | adobe/brackets | src/project/FileTreeView.js | function (nextProps, nextState) {
return nextProps.forceRender ||
this.props.entry !== nextProps.entry ||
this.props.extensions !== nextProps.extensions;
} | javascript | function (nextProps, nextState) {
return nextProps.forceRender ||
this.props.entry !== nextProps.entry ||
this.props.extensions !== nextProps.extensions;
} | [
"function",
"(",
"nextProps",
",",
"nextState",
")",
"{",
"return",
"nextProps",
".",
"forceRender",
"||",
"this",
".",
"props",
".",
"entry",
"!==",
"nextProps",
".",
"entry",
"||",
"this",
".",
"props",
".",
"extensions",
"!==",
"nextProps",
".",
"extens... | Thanks to immutable objects, we can just do a start object identity check to know
whether or not we need to re-render. | [
"Thanks",
"to",
"immutable",
"objects",
"we",
"can",
"just",
"do",
"a",
"start",
"object",
"identity",
"check",
"to",
"know",
"whether",
"or",
"not",
"we",
"need",
"to",
"re",
"-",
"render",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileTreeView.js#L492-L496 | |
1,776 | adobe/brackets | src/project/FileTreeView.js | function (prevProps, prevState) {
var wasSelected = prevProps.entry.get("selected"),
isSelected = this.props.entry.get("selected");
if (isSelected && !wasSelected) {
// TODO: This shouldn't really know about project-files-container
// directly. I... | javascript | function (prevProps, prevState) {
var wasSelected = prevProps.entry.get("selected"),
isSelected = this.props.entry.get("selected");
if (isSelected && !wasSelected) {
// TODO: This shouldn't really know about project-files-container
// directly. I... | [
"function",
"(",
"prevProps",
",",
"prevState",
")",
"{",
"var",
"wasSelected",
"=",
"prevProps",
".",
"entry",
".",
"get",
"(",
"\"selected\"",
")",
",",
"isSelected",
"=",
"this",
".",
"props",
".",
"entry",
".",
"get",
"(",
"\"selected\"",
")",
";",
... | If this node is newly selected, scroll it into view. Also, move the selection or
context boxes as appropriate. | [
"If",
"this",
"node",
"is",
"newly",
"selected",
"scroll",
"it",
"into",
"view",
".",
"Also",
"move",
"the",
"selection",
"or",
"context",
"boxes",
"as",
"appropriate",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileTreeView.js#L502-L516 | |
1,777 | adobe/brackets | src/project/FileTreeView.js | function (e) {
// If we're renaming, allow the click to go through to the rename input.
if (this.props.entry.get("rename")) {
e.stopPropagation();
return;
}
if (e.button !== LEFT_MOUSE_BUTTON) {
return;
}
... | javascript | function (e) {
// If we're renaming, allow the click to go through to the rename input.
if (this.props.entry.get("rename")) {
e.stopPropagation();
return;
}
if (e.button !== LEFT_MOUSE_BUTTON) {
return;
}
... | [
"function",
"(",
"e",
")",
"{",
"// If we're renaming, allow the click to go through to the rename input.",
"if",
"(",
"this",
".",
"props",
".",
"entry",
".",
"get",
"(",
"\"rename\"",
")",
")",
"{",
"e",
".",
"stopPropagation",
"(",
")",
";",
"return",
";",
... | When the user clicks on the node, we'll either select it or, if they've clicked twice
with a bit of delay in between, we'll invoke the `startRename` action. | [
"When",
"the",
"user",
"clicks",
"on",
"the",
"node",
"we",
"ll",
"either",
"select",
"it",
"or",
"if",
"they",
"ve",
"clicked",
"twice",
"with",
"a",
"bit",
"of",
"delay",
"in",
"between",
"we",
"ll",
"invoke",
"the",
"startRename",
"action",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileTreeView.js#L538-L561 | |
1,778 | adobe/brackets | src/project/FileTreeView.js | function () {
var fullname = this.props.name;
var node = this.refs.name;
node.setSelectionRange(0, fullname.length);
node.focus(); // set focus on the rename input
ViewUtils.scrollElementIntoView($("#project-files-container"), $(node), true);
} | javascript | function () {
var fullname = this.props.name;
var node = this.refs.name;
node.setSelectionRange(0, fullname.length);
node.focus(); // set focus on the rename input
ViewUtils.scrollElementIntoView($("#project-files-container"), $(node), true);
} | [
"function",
"(",
")",
"{",
"var",
"fullname",
"=",
"this",
".",
"props",
".",
"name",
";",
"var",
"node",
"=",
"this",
".",
"refs",
".",
"name",
";",
"node",
".",
"setSelectionRange",
"(",
"0",
",",
"fullname",
".",
"length",
")",
";",
"node",
".",... | When this component is displayed, we scroll it into view and select the folder name. | [
"When",
"this",
"component",
"is",
"displayed",
"we",
"scroll",
"it",
"into",
"view",
"and",
"select",
"the",
"folder",
"name",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileTreeView.js#L717-L724 | |
1,779 | adobe/brackets | src/project/FileTreeView.js | function (nextProps, nextState) {
return nextProps.forceRender ||
this.props.entry !== nextProps.entry ||
this.props.sortDirectoriesFirst !== nextProps.sortDirectoriesFirst ||
this.props.extensions !== nextProps.extensions ||
(nextState !== und... | javascript | function (nextProps, nextState) {
return nextProps.forceRender ||
this.props.entry !== nextProps.entry ||
this.props.sortDirectoriesFirst !== nextProps.sortDirectoriesFirst ||
this.props.extensions !== nextProps.extensions ||
(nextState !== und... | [
"function",
"(",
"nextProps",
",",
"nextState",
")",
"{",
"return",
"nextProps",
".",
"forceRender",
"||",
"this",
".",
"props",
".",
"entry",
"!==",
"nextProps",
".",
"entry",
"||",
"this",
".",
"props",
".",
"sortDirectoriesFirst",
"!==",
"nextProps",
".",... | We need to update this component if the sort order changes or our entry object
changes. Thanks to immutability, if any of the directory contents change, our
entry object will change. | [
"We",
"need",
"to",
"update",
"this",
"component",
"if",
"the",
"sort",
"order",
"changes",
"or",
"our",
"entry",
"object",
"changes",
".",
"Thanks",
"to",
"immutability",
"if",
"any",
"of",
"the",
"directory",
"contents",
"change",
"our",
"entry",
"object",... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileTreeView.js#L774-L780 | |
1,780 | adobe/brackets | src/project/FileTreeView.js | function (event) {
if (this.props.entry.get("rename")) {
event.stopPropagation();
return;
}
if (event.button !== LEFT_MOUSE_BUTTON) {
return;
}
var isOpen = this.props.entry.get("open"),
setOpen... | javascript | function (event) {
if (this.props.entry.get("rename")) {
event.stopPropagation();
return;
}
if (event.button !== LEFT_MOUSE_BUTTON) {
return;
}
var isOpen = this.props.entry.get("open"),
setOpen... | [
"function",
"(",
"event",
")",
"{",
"if",
"(",
"this",
".",
"props",
".",
"entry",
".",
"get",
"(",
"\"rename\"",
")",
")",
"{",
"event",
".",
"stopPropagation",
"(",
")",
";",
"return",
";",
"}",
"if",
"(",
"event",
".",
"button",
"!==",
"LEFT_MOU... | If you click on a directory, it will toggle between open and closed. | [
"If",
"you",
"click",
"on",
"a",
"directory",
"it",
"will",
"toggle",
"between",
"open",
"and",
"closed",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileTreeView.js#L785-L821 | |
1,781 | adobe/brackets | src/project/FileTreeView.js | function (nextProps, nextState) {
return nextProps.forceRender ||
this.props.contents !== nextProps.contents ||
this.props.sortDirectoriesFirst !== nextProps.sortDirectoriesFirst ||
this.props.extensions !== nextProps.extensions;
} | javascript | function (nextProps, nextState) {
return nextProps.forceRender ||
this.props.contents !== nextProps.contents ||
this.props.sortDirectoriesFirst !== nextProps.sortDirectoriesFirst ||
this.props.extensions !== nextProps.extensions;
} | [
"function",
"(",
"nextProps",
",",
"nextState",
")",
"{",
"return",
"nextProps",
".",
"forceRender",
"||",
"this",
".",
"props",
".",
"contents",
"!==",
"nextProps",
".",
"contents",
"||",
"this",
".",
"props",
".",
"sortDirectoriesFirst",
"!==",
"nextProps",
... | Need to re-render if the sort order or the contents change. | [
"Need",
"to",
"re",
"-",
"render",
"if",
"the",
"sort",
"order",
"or",
"the",
"contents",
"change",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileTreeView.js#L937-L942 | |
1,782 | adobe/brackets | src/project/FileTreeView.js | function (nextProps, nextState) {
return nextProps.forceRender ||
this.props.treeData !== nextProps.treeData ||
this.props.sortDirectoriesFirst !== nextProps.sortDirectoriesFirst ||
this.props.extensions !== nextProps.extensions ||
this.props.s... | javascript | function (nextProps, nextState) {
return nextProps.forceRender ||
this.props.treeData !== nextProps.treeData ||
this.props.sortDirectoriesFirst !== nextProps.sortDirectoriesFirst ||
this.props.extensions !== nextProps.extensions ||
this.props.s... | [
"function",
"(",
"nextProps",
",",
"nextState",
")",
"{",
"return",
"nextProps",
".",
"forceRender",
"||",
"this",
".",
"props",
".",
"treeData",
"!==",
"nextProps",
".",
"treeData",
"||",
"this",
".",
"props",
".",
"sortDirectoriesFirst",
"!==",
"nextProps",
... | Update for any change in the tree data or directory sorting preference. | [
"Update",
"for",
"any",
"change",
"in",
"the",
"tree",
"data",
"or",
"directory",
"sorting",
"preference",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileTreeView.js#L1127-L1133 | |
1,783 | adobe/brackets | src/project/FileTreeView.js | render | function render(element, viewModel, projectRoot, actions, forceRender, platform) {
if (!projectRoot) {
return;
}
Preact.render(fileTreeView({
treeData: viewModel.treeData,
selectionViewInfo: viewModel.selectionViewInfo,
sortDirectoriesFirst: viewM... | javascript | function render(element, viewModel, projectRoot, actions, forceRender, platform) {
if (!projectRoot) {
return;
}
Preact.render(fileTreeView({
treeData: viewModel.treeData,
selectionViewInfo: viewModel.selectionViewInfo,
sortDirectoriesFirst: viewM... | [
"function",
"render",
"(",
"element",
",",
"viewModel",
",",
"projectRoot",
",",
"actions",
",",
"forceRender",
",",
"platform",
")",
"{",
"if",
"(",
"!",
"projectRoot",
")",
"{",
"return",
";",
"}",
"Preact",
".",
"render",
"(",
"fileTreeView",
"(",
"{"... | Renders the file tree to the given element.
@param {DOMNode|jQuery} element Element in which to render this file tree
@param {FileTreeViewModel} viewModel the data container
@param {Directory} projectRoot Directory object from which the fullPath of the project root is extracted
@param {ActionCreator} actions object wi... | [
"Renders",
"the",
"file",
"tree",
"to",
"the",
"given",
"element",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/project/FileTreeView.js#L1217-L1233 |
1,784 | adobe/brackets | src/languageTools/ClientLoader.js | sendLanguageClientInfo | function sendLanguageClientInfo() {
//Init node with Information required by Language Client
clientInfoLoadedPromise = clientInfoDomain.exec("initialize", _bracketsPath, ToolingInfo);
function logInitializationError() {
console.error("Failed to Initialize LanguageClient Module Infor... | javascript | function sendLanguageClientInfo() {
//Init node with Information required by Language Client
clientInfoLoadedPromise = clientInfoDomain.exec("initialize", _bracketsPath, ToolingInfo);
function logInitializationError() {
console.error("Failed to Initialize LanguageClient Module Infor... | [
"function",
"sendLanguageClientInfo",
"(",
")",
"{",
"//Init node with Information required by Language Client",
"clientInfoLoadedPromise",
"=",
"clientInfoDomain",
".",
"exec",
"(",
"\"initialize\"",
",",
"_bracketsPath",
",",
"ToolingInfo",
")",
";",
"function",
"logInitial... | This function passes Brackets's native directory path as well as the tooling commands
required by the LanguageClient node module. This information is then maintained in memory
in the node process server for succesfully loading and functioning of all language clients
since it is a direct dependency. | [
"This",
"function",
"passes",
"Brackets",
"s",
"native",
"directory",
"path",
"as",
"well",
"as",
"the",
"tooling",
"commands",
"required",
"by",
"the",
"LanguageClient",
"node",
"module",
".",
"This",
"information",
"is",
"then",
"maintained",
"in",
"memory",
... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/languageTools/ClientLoader.js#L124-L150 |
1,785 | adobe/brackets | src/languageTools/ClientLoader.js | initDomainAndHandleNodeCrash | function initDomainAndHandleNodeCrash() {
clientInfoDomain = new NodeDomain("LanguageClientInfo", _domainPath);
//Initialize LanguageClientInfo once the domain has successfully loaded.
clientInfoDomain.promise().done(function () {
sendLanguageClientInfo();
//This is to ha... | javascript | function initDomainAndHandleNodeCrash() {
clientInfoDomain = new NodeDomain("LanguageClientInfo", _domainPath);
//Initialize LanguageClientInfo once the domain has successfully loaded.
clientInfoDomain.promise().done(function () {
sendLanguageClientInfo();
//This is to ha... | [
"function",
"initDomainAndHandleNodeCrash",
"(",
")",
"{",
"clientInfoDomain",
"=",
"new",
"NodeDomain",
"(",
"\"LanguageClientInfo\"",
",",
"_domainPath",
")",
";",
"//Initialize LanguageClientInfo once the domain has successfully loaded.",
"clientInfoDomain",
".",
"promise",
... | This function starts a domain which initializes the LanguageClient node module
required by the Language Server Protocol framework in Brackets. All the LSP clients
can only be successfully initiated once this domain has been successfully loaded and
the LanguageClient info initialized. Refer to sendLanguageClientInfo for... | [
"This",
"function",
"starts",
"a",
"domain",
"which",
"initializes",
"the",
"LanguageClient",
"node",
"module",
"required",
"by",
"the",
"Language",
"Server",
"Protocol",
"framework",
"in",
"Brackets",
".",
"All",
"the",
"LSP",
"clients",
"can",
"only",
"be",
... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/languageTools/ClientLoader.js#L158-L173 |
1,786 | adobe/brackets | src/extensions/default/RemoteFileAdapter/RemoteFile.js | _getStats | function _getStats(uri) {
return new FileSystemStats({
isFile: true,
mtime: SESSION_START_TIME.toISOString(),
size: 0,
realPath: uri,
hash: uri
});
} | javascript | function _getStats(uri) {
return new FileSystemStats({
isFile: true,
mtime: SESSION_START_TIME.toISOString(),
size: 0,
realPath: uri,
hash: uri
});
} | [
"function",
"_getStats",
"(",
"uri",
")",
"{",
"return",
"new",
"FileSystemStats",
"(",
"{",
"isFile",
":",
"true",
",",
"mtime",
":",
"SESSION_START_TIME",
".",
"toISOString",
"(",
")",
",",
"size",
":",
"0",
",",
"realPath",
":",
"uri",
",",
"hash",
... | Create a new file stat. See the FileSystemStats class for more details.
@param {!string} fullPath The full path for this File.
@return {FileSystemStats} stats. | [
"Create",
"a",
"new",
"file",
"stat",
".",
"See",
"the",
"FileSystemStats",
"class",
"for",
"more",
"details",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/RemoteFileAdapter/RemoteFile.js#L38-L46 |
1,787 | adobe/brackets | src/extensions/default/RemoteFileAdapter/RemoteFile.js | RemoteFile | function RemoteFile(protocol, fullPath, fileSystem) {
this._isFile = true;
this._isDirectory = false;
this.readOnly = true;
this._path = fullPath;
this._stat = _getStats(fullPath);
this._id = fullPath;
this._name = _getFileName(fullPath);
this._fileSystem ... | javascript | function RemoteFile(protocol, fullPath, fileSystem) {
this._isFile = true;
this._isDirectory = false;
this.readOnly = true;
this._path = fullPath;
this._stat = _getStats(fullPath);
this._id = fullPath;
this._name = _getFileName(fullPath);
this._fileSystem ... | [
"function",
"RemoteFile",
"(",
"protocol",
",",
"fullPath",
",",
"fileSystem",
")",
"{",
"this",
".",
"_isFile",
"=",
"true",
";",
"this",
".",
"_isDirectory",
"=",
"false",
";",
"this",
".",
"readOnly",
"=",
"true",
";",
"this",
".",
"_path",
"=",
"fu... | Model for a RemoteFile.
This class should *not* be instantiated directly. Use FileSystem.getFileForPath
See the FileSystem class for more details.
@constructor
@param {!string} fullPath The full path for this File.
@param {!FileSystem} fileSystem The file system associated with this File. | [
"Model",
"for",
"a",
"RemoteFile",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/RemoteFileAdapter/RemoteFile.js#L70-L82 |
1,788 | adobe/brackets | src/extensions/default/JavaScriptCodeHints/HintUtils2.js | formatParameterHint | function formatParameterHint(params, appendSeparators, appendParameter, typesOnly) {
var result = "",
pendingOptional = false;
params.forEach(function (value, i) {
var param = value.type,
separators = "";
if (value.isOptional) {
// if... | javascript | function formatParameterHint(params, appendSeparators, appendParameter, typesOnly) {
var result = "",
pendingOptional = false;
params.forEach(function (value, i) {
var param = value.type,
separators = "";
if (value.isOptional) {
// if... | [
"function",
"formatParameterHint",
"(",
"params",
",",
"appendSeparators",
",",
"appendParameter",
",",
"typesOnly",
")",
"{",
"var",
"result",
"=",
"\"\"",
",",
"pendingOptional",
"=",
"false",
";",
"params",
".",
"forEach",
"(",
"function",
"(",
"value",
","... | Format the given parameter array. Handles separators between
parameters, syntax for optional parameters, and the order of the
parameter type and parameter name.
@param {!Array.<{name: string, type: string, isOptional: boolean}>} params -
array of parameter descriptors
@param {function(string)=} appendSeparators - call... | [
"Format",
"the",
"given",
"parameter",
"array",
".",
"Handles",
"separators",
"between",
"parameters",
"syntax",
"for",
"optional",
"parameters",
"and",
"the",
"order",
"of",
"the",
"parameter",
"type",
"and",
"parameter",
"name",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/JavaScriptCodeHints/HintUtils2.js#L49-L103 |
1,789 | adobe/brackets | src/utils/NodeConnection.js | setDeferredTimeout | function setDeferredTimeout(deferred, delay) {
var timer = setTimeout(function () {
deferred.reject("timeout");
}, delay);
deferred.always(function () { clearTimeout(timer); });
} | javascript | function setDeferredTimeout(deferred, delay) {
var timer = setTimeout(function () {
deferred.reject("timeout");
}, delay);
deferred.always(function () { clearTimeout(timer); });
} | [
"function",
"setDeferredTimeout",
"(",
"deferred",
",",
"delay",
")",
"{",
"var",
"timer",
"=",
"setTimeout",
"(",
"function",
"(",
")",
"{",
"deferred",
".",
"reject",
"(",
"\"timeout\"",
")",
";",
"}",
",",
"delay",
")",
";",
"deferred",
".",
"always",... | 2^32 - 1
@private
Helper function to auto-reject a deferred after a given amount of time.
If the deferred is resolved/rejected manually, then the timeout is
automatically cleared. | [
"2^32",
"-",
"1"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/NodeConnection.js#L64-L69 |
1,790 | adobe/brackets | src/utils/NodeConnection.js | registerHandlersAndDomains | function registerHandlersAndDomains(ws, port) {
// Called if we succeed at the final setup
function success() {
self._ws.onclose = function () {
if (self._autoReconnect) {
var $promise = self.connect(true);
self.... | javascript | function registerHandlersAndDomains(ws, port) {
// Called if we succeed at the final setup
function success() {
self._ws.onclose = function () {
if (self._autoReconnect) {
var $promise = self.connect(true);
self.... | [
"function",
"registerHandlersAndDomains",
"(",
"ws",
",",
"port",
")",
"{",
"// Called if we succeed at the final setup",
"function",
"success",
"(",
")",
"{",
"self",
".",
"_ws",
".",
"onclose",
"=",
"function",
"(",
")",
"{",
"if",
"(",
"self",
".",
"_autoRe... | Called after a successful connection to do final setup steps | [
"Called",
"after",
"a",
"successful",
"connection",
"to",
"do",
"final",
"setup",
"steps"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/NodeConnection.js#L256-L295 |
1,791 | adobe/brackets | src/utils/NodeConnection.js | success | function success() {
self._ws.onclose = function () {
if (self._autoReconnect) {
var $promise = self.connect(true);
self.trigger("close", $promise);
} else {
self._cleanup();
... | javascript | function success() {
self._ws.onclose = function () {
if (self._autoReconnect) {
var $promise = self.connect(true);
self.trigger("close", $promise);
} else {
self._cleanup();
... | [
"function",
"success",
"(",
")",
"{",
"self",
".",
"_ws",
".",
"onclose",
"=",
"function",
"(",
")",
"{",
"if",
"(",
"self",
".",
"_autoReconnect",
")",
"{",
"var",
"$promise",
"=",
"self",
".",
"connect",
"(",
"true",
")",
";",
"self",
".",
"trigg... | Called if we succeed at the final setup | [
"Called",
"if",
"we",
"succeed",
"at",
"the",
"final",
"setup"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/NodeConnection.js#L258-L269 |
1,792 | adobe/brackets | src/utils/NodeConnection.js | doConnect | function doConnect() {
attemptCount++;
attemptTimestamp = new Date();
attemptSingleConnect().then(
registerHandlersAndDomains, // succeded
function () { // failed this attempt, possibly try again
if (attemptCount < CONNECTION_ATTEMP... | javascript | function doConnect() {
attemptCount++;
attemptTimestamp = new Date();
attemptSingleConnect().then(
registerHandlersAndDomains, // succeded
function () { // failed this attempt, possibly try again
if (attemptCount < CONNECTION_ATTEMP... | [
"function",
"doConnect",
"(",
")",
"{",
"attemptCount",
"++",
";",
"attemptTimestamp",
"=",
"new",
"Date",
"(",
")",
";",
"attemptSingleConnect",
"(",
")",
".",
"then",
"(",
"registerHandlersAndDomains",
",",
"// succeded",
"function",
"(",
")",
"{",
"// faile... | Repeatedly tries to connect until we succeed or until we've failed CONNECTION_ATTEMPT times. After each attempt, waits at least RETRY_DELAY before trying again. | [
"Repeatedly",
"tries",
"to",
"connect",
"until",
"we",
"succeed",
"or",
"until",
"we",
"ve",
"failed",
"CONNECTION_ATTEMPT",
"times",
".",
"After",
"each",
"attempt",
"waits",
"at",
"least",
"RETRY_DELAY",
"before",
"trying",
"again",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/NodeConnection.js#L300-L319 |
1,793 | adobe/brackets | src/extensions/default/JavaScriptRefactoring/WrapSelection.js | _wrapSelectedStatements | function _wrapSelectedStatements (wrapperName, err) {
var editor = EditorManager.getActiveEditor();
if (!editor) {
return;
}
initializeRefactoringSession(editor);
var startIndex = current.startIndex,
endIndex = current.endIndex,
selectedText =... | javascript | function _wrapSelectedStatements (wrapperName, err) {
var editor = EditorManager.getActiveEditor();
if (!editor) {
return;
}
initializeRefactoringSession(editor);
var startIndex = current.startIndex,
endIndex = current.endIndex,
selectedText =... | [
"function",
"_wrapSelectedStatements",
"(",
"wrapperName",
",",
"err",
")",
"{",
"var",
"editor",
"=",
"EditorManager",
".",
"getActiveEditor",
"(",
")",
";",
"if",
"(",
"!",
"editor",
")",
"{",
"return",
";",
"}",
"initializeRefactoringSession",
"(",
"editor"... | Wrap selected statements
@param {string} wrapperName - template name where we want wrap selected statements
@param {string} err- error message if we can't wrap selected code | [
"Wrap",
"selected",
"statements"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/JavaScriptRefactoring/WrapSelection.js#L57-L108 |
1,794 | adobe/brackets | src/extensions/default/JavaScriptRefactoring/WrapSelection.js | createGettersAndSetters | function createGettersAndSetters() {
var editor = EditorManager.getActiveEditor();
if (!editor) {
return;
}
initializeRefactoringSession(editor);
var startIndex = current.startIndex,
endIndex = current.endIndex,
selectedText = current.selected... | javascript | function createGettersAndSetters() {
var editor = EditorManager.getActiveEditor();
if (!editor) {
return;
}
initializeRefactoringSession(editor);
var startIndex = current.startIndex,
endIndex = current.endIndex,
selectedText = current.selected... | [
"function",
"createGettersAndSetters",
"(",
")",
"{",
"var",
"editor",
"=",
"EditorManager",
".",
"getActiveEditor",
"(",
")",
";",
"if",
"(",
"!",
"editor",
")",
"{",
"return",
";",
"}",
"initializeRefactoringSession",
"(",
"editor",
")",
";",
"var",
"start... | Create gtteres and setters for a property | [
"Create",
"gtteres",
"and",
"setters",
"for",
"a",
"property"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/extensions/default/JavaScriptRefactoring/WrapSelection.js#L230-L327 |
1,795 | adobe/brackets | src/utils/Async.js | doSequentiallyInBackground | function doSequentiallyInBackground(items, fnProcessItem, maxBlockingTime, idleTime) {
maxBlockingTime = maxBlockingTime || 15;
idleTime = idleTime || 30;
var sliceStartTime = (new Date()).getTime();
return doSequentially(items, function (item, i) {
var result = new $.Defe... | javascript | function doSequentiallyInBackground(items, fnProcessItem, maxBlockingTime, idleTime) {
maxBlockingTime = maxBlockingTime || 15;
idleTime = idleTime || 30;
var sliceStartTime = (new Date()).getTime();
return doSequentially(items, function (item, i) {
var result = new $.Defe... | [
"function",
"doSequentiallyInBackground",
"(",
"items",
",",
"fnProcessItem",
",",
"maxBlockingTime",
",",
"idleTime",
")",
"{",
"maxBlockingTime",
"=",
"maxBlockingTime",
"||",
"15",
";",
"idleTime",
"=",
"idleTime",
"||",
"30",
";",
"var",
"sliceStartTime",
"=",... | Executes a series of synchronous tasks sequentially spread over time-slices less than maxBlockingTime.
Processing yields by idleTime between time-slices.
@param {!Array.<*>} items
@param {!function(*, number)} fnProcessItem Function that synchronously processes one item
@param {number=} maxBlockingTime
@param {number... | [
"Executes",
"a",
"series",
"of",
"synchronous",
"tasks",
"sequentially",
"spread",
"over",
"time",
"-",
"slices",
"less",
"than",
"maxBlockingTime",
".",
"Processing",
"yields",
"by",
"idleTime",
"between",
"time",
"-",
"slices",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/utils/Async.js#L208-L235 |
1,796 | adobe/brackets | src/language/CodeInspection.js | setGotoEnabled | function setGotoEnabled(gotoEnabled) {
CommandManager.get(Commands.NAVIGATE_GOTO_FIRST_PROBLEM).setEnabled(gotoEnabled);
_gotoEnabled = gotoEnabled;
} | javascript | function setGotoEnabled(gotoEnabled) {
CommandManager.get(Commands.NAVIGATE_GOTO_FIRST_PROBLEM).setEnabled(gotoEnabled);
_gotoEnabled = gotoEnabled;
} | [
"function",
"setGotoEnabled",
"(",
"gotoEnabled",
")",
"{",
"CommandManager",
".",
"get",
"(",
"Commands",
".",
"NAVIGATE_GOTO_FIRST_PROBLEM",
")",
".",
"setEnabled",
"(",
"gotoEnabled",
")",
";",
"_gotoEnabled",
"=",
"gotoEnabled",
";",
"}"
] | Enable or disable the "Go to First Error" command
@param {boolean} gotoEnabled Whether it is enabled. | [
"Enable",
"or",
"disable",
"the",
"Go",
"to",
"First",
"Error",
"command"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/CodeInspection.js#L141-L144 |
1,797 | adobe/brackets | src/language/CodeInspection.js | getProvidersForPath | function getProvidersForPath(filePath) {
var language = LanguageManager.getLanguageForPath(filePath).getId(),
context = PreferencesManager._buildContext(filePath, language),
installedProviders = getProvidersForLanguageId(language),
preferredProviders,
... | javascript | function getProvidersForPath(filePath) {
var language = LanguageManager.getLanguageForPath(filePath).getId(),
context = PreferencesManager._buildContext(filePath, language),
installedProviders = getProvidersForLanguageId(language),
preferredProviders,
... | [
"function",
"getProvidersForPath",
"(",
"filePath",
")",
"{",
"var",
"language",
"=",
"LanguageManager",
".",
"getLanguageForPath",
"(",
"filePath",
")",
".",
"getId",
"(",
")",
",",
"context",
"=",
"PreferencesManager",
".",
"_buildContext",
"(",
"filePath",
",... | Returns a list of provider for given file path, if available.
Decision is made depending on the file extension.
@param {!string} filePath
@return {Array.<{name:string, scanFileAsync:?function(string, string):!{$.Promise}, scanFile:?function(string, string):?{errors:!Array, aborted:boolean}}>} | [
"Returns",
"a",
"list",
"of",
"provider",
"for",
"given",
"file",
"path",
"if",
"available",
".",
"Decision",
"is",
"made",
"depending",
"on",
"the",
"file",
"extension",
"."
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/CodeInspection.js#L157-L188 |
1,798 | adobe/brackets | src/language/CodeInspection.js | getProviderIDsForLanguage | function getProviderIDsForLanguage(languageId) {
if (!_providers[languageId]) {
return [];
}
return _providers[languageId].map(function (provider) {
return provider.name;
});
} | javascript | function getProviderIDsForLanguage(languageId) {
if (!_providers[languageId]) {
return [];
}
return _providers[languageId].map(function (provider) {
return provider.name;
});
} | [
"function",
"getProviderIDsForLanguage",
"(",
"languageId",
")",
"{",
"if",
"(",
"!",
"_providers",
"[",
"languageId",
"]",
")",
"{",
"return",
"[",
"]",
";",
"}",
"return",
"_providers",
"[",
"languageId",
"]",
".",
"map",
"(",
"function",
"(",
"provider"... | Returns an array of the IDs of providers registered for a specific language
@param {!string} languageId
@return {Array.<string>} Names of registered providers. | [
"Returns",
"an",
"array",
"of",
"the",
"IDs",
"of",
"providers",
"registered",
"for",
"a",
"specific",
"language"
] | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/CodeInspection.js#L196-L203 |
1,799 | adobe/brackets | src/language/CodeInspection.js | updatePanelTitleAndStatusBar | function updatePanelTitleAndStatusBar(numProblems, providersReportingProblems, aborted) {
var message, tooltip;
if (providersReportingProblems.length === 1) {
// don't show a header if there is only one provider available for this file type
$problemsPanelTable.find(".inspector-s... | javascript | function updatePanelTitleAndStatusBar(numProblems, providersReportingProblems, aborted) {
var message, tooltip;
if (providersReportingProblems.length === 1) {
// don't show a header if there is only one provider available for this file type
$problemsPanelTable.find(".inspector-s... | [
"function",
"updatePanelTitleAndStatusBar",
"(",
"numProblems",
",",
"providersReportingProblems",
",",
"aborted",
")",
"{",
"var",
"message",
",",
"tooltip",
";",
"if",
"(",
"providersReportingProblems",
".",
"length",
"===",
"1",
")",
"{",
"// don't show a header if... | Update the title of the problem panel and the tooltip of the status bar icon. The title and the tooltip will
change based on the number of problems reported and how many provider reported problems.
@param {Number} numProblems - total number of problems across all providers
@param {Array.<{name:string, scanFileAsync:?f... | [
"Update",
"the",
"title",
"of",
"the",
"problem",
"panel",
"and",
"the",
"tooltip",
"of",
"the",
"status",
"bar",
"icon",
".",
"The",
"title",
"and",
"the",
"tooltip",
"will",
"change",
"based",
"on",
"the",
"number",
"of",
"problems",
"reported",
"and",
... | d5d00d43602c438266d32b8eda8f8a3ca937b524 | https://github.com/adobe/brackets/blob/d5d00d43602c438266d32b8eda8f8a3ca937b524/src/language/CodeInspection.js#L315-L347 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.