_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 52 373k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q16700 | train | 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 | {
"resource": ""
} | |
q16701 | train | 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 | {
"resource": ""
} | |
q16702 | train | 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 | {
"resource": ""
} | |
q16703 | train | function (data, id) {
if (!data || !this.projectPath) {
return;
}
if (data[this.projectPath] && (data[this.projectPath][id] !== undefined)) {
return data[this.projectPath][id];
}
return;
} | javascript | {
"resource": ""
} | |
q16704 | train | function (data) {
if (!data) {
return;
}
return _.union.apply(null, _.map(_.values(data), _.keys));
} | javascript | {
"resource": ""
} | |
q16705 | train | 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 | {
"resource": ""
} | |
q16706 | train | 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 | {
"resource": ""
} | |
q16707 | train | function (data, id, context) {
var glob = this.getPreferenceLocation(data, id, context);
if (!glob) {
return;
}
return data[glob][id];
} | javascript | {
"resource": ""
} | |
q16708 | train | function (data, id, context) {
if (!data) {
return;
}
var relativeFilename = FileUtils.getRelativeFilename(this.prefFilePath, context[this.key]);
if (!relativeFilename) {
return;
}
return _findMatchingGlob(data, re... | javascript | {
"resource": ""
} | |
q16709 | train | 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 | {
"resource": ""
} | |
q16710 | train | function (data, context) {
if (!data) {
return;
}
var relativeFilename = FileUtils.getRelativeFilename(this.prefFilePath, context[this.key]);
if (relativeFilename) {
var glob = _findMatchingGlob(data, relativeFilename);
if... | javascript | {
"resource": ""
} | |
q16711 | train | function (data, oldContext, newContext) {
var newGlob = _findMatchingGlob(data,
FileUtils.getRelativeFilename(this.prefFilePath, newContext[this.key])),
oldGlob = _findMatchingGlob(data,
FileUtils.getRelativeFilename(this.prefFilePa... | javascript | {
"resource": ""
} | |
q16712 | train | function (id, context) {
context = context || {};
return this.base.get(this.prefix + id, this.base._getContext(context));
} | javascript | {
"resource": ""
} | |
q16713 | train | function (id, value, options, doNotSave) {
return this.base.set(this.prefix + id, value, options, doNotSave);
} | javascript | {
"resource": ""
} | |
q16714 | train | function (event, preferenceID, handler) {
if (typeof preferenceID === "function") {
handler = preferenceID;
preferenceID = null;
}
if (preferenceID) {
var pref = this.getPreference(preferenceID);
pref.on(event, handler)... | javascript | {
"resource": ""
} | |
q16715 | train | function (event, preferenceID, handler) {
if (typeof preferenceID === "function") {
handler = preferenceID;
preferenceID = null;
}
if (preferenceID) {
var pref = this.getPreference(preferenceID);
pref.off(event, handler... | javascript | {
"resource": ""
} | |
q16716 | PreferencesSystem | train | function PreferencesSystem(contextBuilder) {
this.contextBuilder = contextBuilder;
this._knownPrefs = {};
this._scopes = {
"default": new Scope(new MemoryStorage())
};
this._scopes["default"].load();
this._defaults = {
scopeOrder: ["default"],
... | javascript | {
"resource": ""
} |
q16717 | train | 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 | {
"resource": ""
} | |
q16718 | train | function (id, addBefore) {
var shadowScopeOrder = this._defaults._shadowScopeOrder,
index = _.findIndex(shadowScopeOrder, function (entry) {
return entry.id === id;
}),
entry;
if (index > -1) {
entry = shadowScop... | javascript | {
"resource": ""
} | |
q16719 | train | 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 | {
"resource": ""
} | |
q16720 | train | 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 | {
"resource": ""
} | |
q16721 | train | 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 | {
"resource": ""
} | |
q16722 | train | 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 | {
"resource": ""
} | |
q16723 | train | 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 | {
"resource": ""
} | |
q16724 | train | 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 | {
"resource": ""
} | |
q16725 | train | function () {
if (this._saveInProgress) {
if (!this._nextSaveDeferred) {
this._nextSaveDeferred = new $.Deferred();
}
return this._nextSaveDeferred.promise();
}
var deferred = this._nextSaveDeferred || (new $.Deferr... | javascript | {
"resource": ""
} | |
q16726 | train | function (oldContext, newContext) {
var changes = [];
_.each(this._scopes, function (scope) {
var changedInScope = scope.contextChanged(oldContext, newContext);
if (changedInScope) {
changes.push(changedInScope);
}
... | javascript | {
"resource": ""
} | |
q16727 | _updateWorkingSetState | train | function _updateWorkingSetState() {
if (MainViewManager.getPaneCount() === 1 &&
MainViewManager.getWorkingSetSize(MainViewManager.ACTIVE_PANE) === 0) {
$workingSetViewsContainer.hide();
$gearMenu.hide();
} else {
$workingSetViewsContainer.show();
... | javascript | {
"resource": ""
} |
q16728 | _updateUIStates | train | 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 | {
"resource": ""
} |
q16729 | addCommand | train | 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 | {
"resource": ""
} |
q16730 | Session | train | function Session(editor) {
this.editor = editor;
this.path = editor.document.file.fullPath;
this.ternHints = [];
this.ternGuesses = null;
this.fnType = null;
this.builtins = null;
} | javascript | {
"resource": ""
} |
q16731 | isOnFunctionIdentifier | train | 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 | {
"resource": ""
} |
q16732 | isInFunctionalCall | train | 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 | {
"resource": ""
} |
q16733 | penalizeUnderscoreValueCompare | train | 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 | {
"resource": ""
} |
q16734 | filterWithQueryAndMatcher | train | 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 | {
"resource": ""
} |
q16735 | install | train | function install(path, nameHint, _doUpdate) {
return _extensionManagerCall(function (extensionManager) {
var d = new $.Deferred(),
destinationDirectory = ExtensionLoader.getUserExtensionPath(),
disabledDirectory = destinationDirectory.re... | javascript | {
"resource": ""
} |
q16736 | toggleDefaultExtension | train | 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 | {
"resource": ""
} |
q16737 | disable | train | 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 | {
"resource": ""
} |
q16738 | enable | train | 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 | {
"resource": ""
} |
q16739 | installUpdate | train | 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 | {
"resource": ""
} |
q16740 | _cmdSend | train | 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 | {
"resource": ""
} |
q16741 | _cmdClose | train | function _cmdClose(clientId) {
var client = _clients[clientId];
if (client) {
client.socket.close();
delete _clients[clientId];
}
} | javascript | {
"resource": ""
} |
q16742 | nextLine | train | function nextLine() {
if (stream) {
curOffset++; // account for \n
if (curOffset >= length) {
return false;
}
}
lineStart = curOffset;
var lineEnd = text.indexOf("\n", lineStart);
if (lineEnd ... | javascript | {
"resource": ""
} |
q16743 | _shouldGetFromCache | train | 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 | {
"resource": ""
} |
q16744 | _getFunctionsForFile | train | 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 | {
"resource": ""
} |
q16745 | findMatchingFunctions | train | 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 | {
"resource": ""
} |
q16746 | findAllMatchingFunctionsInText | train | 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 | {
"resource": ""
} |
q16747 | refresh | train | function refresh(force) {
if (force) {
currentTheme = null;
}
$.when(force && loadCurrentTheme()).done(function () {
var editor = EditorManager.getActiveEditor();
if (!editor || !editor._codeMirror) {
return;
}
var cm ... | javascript | {
"resource": ""
} |
q16748 | loadFile | train | 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 | {
"resource": ""
} |
q16749 | loadPackage | train | function loadPackage(themePackage) {
var fileName = themePackage.path + "/" + themePackage.metadata.theme.file;
return loadFile(fileName, themePackage.metadata);
} | javascript | {
"resource": ""
} |
q16750 | animateUsingClass | train | function animateUsingClass(target, animClass, timeoutDuration) {
var result = new $.Deferred(),
$target = $(target);
timeoutDuration = timeoutDuration || 400;
function finish(e) {
if (e.target === target) {
result.resolve();
}
}
... | javascript | {
"resource": ""
} |
q16751 | train | 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 | {
"resource": ""
} | |
q16752 | train | 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 | {
"resource": ""
} | |
q16753 | train | 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 | {
"resource": ""
} | |
q16754 | train | 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 | {
"resource": ""
} | |
q16755 | train | 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 | {
"resource": ""
} | |
q16756 | train | function (nextProps, nextState) {
return nextProps.forceRender ||
this.props.entry !== nextProps.entry ||
this.props.extensions !== nextProps.extensions;
} | javascript | {
"resource": ""
} | |
q16757 | train | 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 | {
"resource": ""
} | |
q16758 | train | 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 | {
"resource": ""
} | |
q16759 | train | 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 | {
"resource": ""
} | |
q16760 | train | function (nextProps, nextState) {
return nextProps.forceRender ||
this.props.entry !== nextProps.entry ||
this.props.sortDirectoriesFirst !== nextProps.sortDirectoriesFirst ||
this.props.extensions !== nextProps.extensions ||
(nextState !== und... | javascript | {
"resource": ""
} | |
q16761 | train | 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 | {
"resource": ""
} | |
q16762 | train | function (nextProps, nextState) {
return nextProps.forceRender ||
this.props.contents !== nextProps.contents ||
this.props.sortDirectoriesFirst !== nextProps.sortDirectoriesFirst ||
this.props.extensions !== nextProps.extensions;
} | javascript | {
"resource": ""
} | |
q16763 | train | 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 | {
"resource": ""
} | |
q16764 | render | train | function render(element, viewModel, projectRoot, actions, forceRender, platform) {
if (!projectRoot) {
return;
}
Preact.render(fileTreeView({
treeData: viewModel.treeData,
selectionViewInfo: viewModel.selectionViewInfo,
sortDirectoriesFirst: viewM... | javascript | {
"resource": ""
} |
q16765 | sendLanguageClientInfo | train | 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 | {
"resource": ""
} |
q16766 | initDomainAndHandleNodeCrash | train | 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 | {
"resource": ""
} |
q16767 | _getStats | train | function _getStats(uri) {
return new FileSystemStats({
isFile: true,
mtime: SESSION_START_TIME.toISOString(),
size: 0,
realPath: uri,
hash: uri
});
} | javascript | {
"resource": ""
} |
q16768 | RemoteFile | train | 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 | {
"resource": ""
} |
q16769 | formatParameterHint | train | 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 | {
"resource": ""
} |
q16770 | setDeferredTimeout | train | function setDeferredTimeout(deferred, delay) {
var timer = setTimeout(function () {
deferred.reject("timeout");
}, delay);
deferred.always(function () { clearTimeout(timer); });
} | javascript | {
"resource": ""
} |
q16771 | registerHandlersAndDomains | train | 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 | {
"resource": ""
} |
q16772 | success | train | function success() {
self._ws.onclose = function () {
if (self._autoReconnect) {
var $promise = self.connect(true);
self.trigger("close", $promise);
} else {
self._cleanup();
... | javascript | {
"resource": ""
} |
q16773 | doConnect | train | function doConnect() {
attemptCount++;
attemptTimestamp = new Date();
attemptSingleConnect().then(
registerHandlersAndDomains, // succeded
function () { // failed this attempt, possibly try again
if (attemptCount < CONNECTION_ATTEMP... | javascript | {
"resource": ""
} |
q16774 | _wrapSelectedStatements | train | function _wrapSelectedStatements (wrapperName, err) {
var editor = EditorManager.getActiveEditor();
if (!editor) {
return;
}
initializeRefactoringSession(editor);
var startIndex = current.startIndex,
endIndex = current.endIndex,
selectedText =... | javascript | {
"resource": ""
} |
q16775 | createGettersAndSetters | train | function createGettersAndSetters() {
var editor = EditorManager.getActiveEditor();
if (!editor) {
return;
}
initializeRefactoringSession(editor);
var startIndex = current.startIndex,
endIndex = current.endIndex,
selectedText = current.selected... | javascript | {
"resource": ""
} |
q16776 | doSequentiallyInBackground | train | 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 | {
"resource": ""
} |
q16777 | setGotoEnabled | train | function setGotoEnabled(gotoEnabled) {
CommandManager.get(Commands.NAVIGATE_GOTO_FIRST_PROBLEM).setEnabled(gotoEnabled);
_gotoEnabled = gotoEnabled;
} | javascript | {
"resource": ""
} |
q16778 | getProvidersForPath | train | function getProvidersForPath(filePath) {
var language = LanguageManager.getLanguageForPath(filePath).getId(),
context = PreferencesManager._buildContext(filePath, language),
installedProviders = getProvidersForLanguageId(language),
preferredProviders,
... | javascript | {
"resource": ""
} |
q16779 | getProviderIDsForLanguage | train | function getProviderIDsForLanguage(languageId) {
if (!_providers[languageId]) {
return [];
}
return _providers[languageId].map(function (provider) {
return provider.name;
});
} | javascript | {
"resource": ""
} |
q16780 | updatePanelTitleAndStatusBar | train | 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 | {
"resource": ""
} |
q16781 | getProvidersForLanguageId | train | function getProvidersForLanguageId(languageId) {
var result = [];
if (_providers[languageId]) {
result = result.concat(_providers[languageId]);
}
if (_providers['*']) {
result = result.concat(_providers['*']);
}
return result;
} | javascript | {
"resource": ""
} |
q16782 | updateListeners | train | function updateListeners() {
if (_enabled) {
// register our event listeners
MainViewManager
.on("currentFileChange.codeInspection", function () {
run();
});
DocumentManager
.on("currentDocumentLanguageChange... | javascript | {
"resource": ""
} |
q16783 | toggleEnabled | train | function toggleEnabled(enabled, doNotSave) {
if (enabled === undefined) {
enabled = !_enabled;
}
// Take no action when there is no change.
if (enabled === _enabled) {
return;
}
_enabled = enabled;
CommandManager.get(Commands.VIEW_TOGGLE... | javascript | {
"resource": ""
} |
q16784 | _firstNotWs | train | function _firstNotWs(doc, lineNum) {
var text = doc.getLine(lineNum);
if (text === null || text === undefined) {
return 0;
}
return text.search(/\S|$/);
} | javascript | {
"resource": ""
} |
q16785 | prepareEditorForProvider | train | function prepareEditorForProvider(hostEditor, pos) {
var cursorLine, sel, startPos, endPos, startBookmark, endBookmark, currentMatch,
cm = hostEditor._codeMirror;
sel = hostEditor.getSelection();
if (sel.start.line !== sel.end.line) {
return {timingFunction: null, reason... | javascript | {
"resource": ""
} |
q16786 | refresh | train | function refresh(rebuild) {
_.forEach(_views, function (view) {
var top = view.$openFilesContainer.scrollTop();
if (rebuild) {
view._rebuildViewList(true);
} else {
view._redraw();
}
view.$openFilesContainer.scrollTop(to... | javascript | {
"resource": ""
} |
q16787 | _updateListItemSelection | train | function _updateListItemSelection(listItem, selectedFile) {
var shouldBeSelected = (selectedFile && $(listItem).data(_FILE_KEY).fullPath === selectedFile.fullPath);
ViewUtils.toggleClass($(listItem), "selected", shouldBeSelected);
} | javascript | {
"resource": ""
} |
q16788 | _isOpenAndDirty | train | function _isOpenAndDirty(file) {
// working set item might never have been opened; if so, then it's definitely not dirty
var docIfOpen = DocumentManager.getOpenDocumentForPath(file.fullPath);
return (docIfOpen && docIfOpen.isDirty);
} | javascript | {
"resource": ""
} |
q16789 | _suppressScrollShadowsOnAllViews | train | function _suppressScrollShadowsOnAllViews(disable) {
_.forEach(_views, function (view) {
if (disable) {
ViewUtils.removeScrollerShadow(view.$openFilesContainer[0], null);
} else if (view.$openFilesContainer[0].scrollHeight > view.$openFilesContainer[0].clientHeight) {
... | javascript | {
"resource": ""
} |
q16790 | _deactivateAllViews | train | function _deactivateAllViews(deactivate) {
_.forEach(_views, function (view) {
if (deactivate) {
if (view.$el.hasClass("active")) {
view.$el.removeClass("active").addClass("reactivate");
view.$openFilesList.trigger("selectionHide");
... | javascript | {
"resource": ""
} |
q16791 | _viewFromEl | train | function _viewFromEl($el) {
if (!$el.hasClass("working-set-view")) {
$el = $el.parents(".working-set-view");
}
var id = $el.attr("id").match(/working\-set\-list\-([\w]+[\w\d\-\.\:\_]*)/).pop();
return _views[id];
} | javascript | {
"resource": ""
} |
q16792 | scroll | train | function scroll($container, $el, dir, callback) {
var container = $container[0],
maxScroll = container.scrollHeight - container.clientHeight;
if (maxScroll && dir && !interval) {
// Scroll view if the mouse is over the first or last pixels of the container
... | javascript | {
"resource": ""
} |
q16793 | preDropCleanup | train | function preDropCleanup() {
window.onmousewheel = window.document.onmousewheel = null;
$(window).off(".wsvdragging");
if (dragged) {
$workingFilesContainer.removeClass("dragging");
$workingFilesContainer.find(".drag-show-as-selected... | javascript | {
"resource": ""
} |
q16794 | createWorkingSetViewForPane | train | function createWorkingSetViewForPane($container, paneId) {
var view = _views[paneId];
if (!view) {
view = new WorkingSetView($container, paneId);
_views[view.paneId] = view;
}
} | javascript | {
"resource": ""
} |
q16795 | _getPluginsForCurrentContext | train | function _getPluginsForCurrentContext() {
var curDoc = DocumentManager.getCurrentDocument();
if (curDoc) {
var languageId = curDoc.getLanguage().getId();
return _providerRegistrationHandler.getProvidersForLanguageId(languageId);
}
return _providerRegistrationHan... | javascript | {
"resource": ""
} |
q16796 | QuickOpenPlugin | train | function QuickOpenPlugin(name, languageIds, done, search, match, itemFocus, itemSelect, resultsFormatter, matcherOptions, label) {
this.name = name;
this.languageIds = languageIds;
this.done = done;
this.search = search;
this.match = match;
this.itemFocus = itemFocus;
... | javascript | {
"resource": ""
} |
q16797 | addQuickOpenPlugin | train | function addQuickOpenPlugin(pluginDef) {
var quickOpenProvider = new QuickOpenPlugin(
pluginDef.name,
pluginDef.languageIds,
pluginDef.done,
pluginDef.search,
pluginDef.match,
pluginDef.itemFocus,
plu... | javascript | {
"resource": ""
} |
q16798 | _filter | train | function _filter(file) {
return !LanguageManager.getLanguageForPath(file.fullPath).isBinary() ||
MainViewFactory.findSuitableFactoryForPath(file.fullPath);
} | javascript | {
"resource": ""
} |
q16799 | handleGetFile | train | function handleGetFile(file, text) {
var next = fileCallBacks[file];
if (next) {
try {
next(null, text);
} catch (e) {
_reportError(e, file);
}
}
delete fileCallBacks[file];
} | javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.