_id
stringlengths
2
6
title
stringlengths
0
58
partition
stringclasses
3 values
text
stringlengths
52
373k
language
stringclasses
1 value
meta_information
dict
q29200
train
function(onDone) { var result = Array.isArray(this._selections) ? this._selections.slice() : []; if (typeof onDone === "function") { //$NON-NLS-0$ onDone(result); } return result; }
javascript
{ "resource": "" }
q29201
inherits
train
function inherits(ctor, sctor) { ctor.prototype = Object.create(sctor.prototype); ctor._super = sctor; }
javascript
{ "resource": "" }
q29202
train
function(type, listener, useCapture) { if (!this._eventTypes) { this._eventTypes = {}; } var state = this._eventTypes[type]; if (!state) { state = this._eventTypes[type] = {level: 0, listeners: []}; } var listeners = state.listeners; listeners.push({listener: listener, useCapture: useCapture}); ...
javascript
{ "resource": "" }
q29203
train
function(mouseEvent /* optional */) { var actionTaken = false; if (!this.isVisible()) { this.dispatchEvent({type: "triggered", dropdown: this, event: mouseEvent}); //$NON-NLS-0$ if (this._populate) { this.empty(); this._populate(this._dropdownNode); } var items = this.getItems(); if ...
javascript
{ "resource": "" }
q29204
train
function(mouseEvent) {//Sub classes can override this to position the drop down differently. this._dropdownNode.style.left = ""; this._dropdownNode.style.top = ""; if(this._positioningNode) { this._dropdownNode.style.left = this._positioningNode.offsetLeft + "px"; return; } var bounds = l...
javascript
{ "resource": "" }
q29205
train
function(restoreFocus) { var actionTaken = false; if (this.isVisible()) { this._triggerNode.classList.remove("dropdownTriggerOpen"); //$NON-NLS-0$ this._triggerNode.setAttribute("aria-expanded", "false"); //$NON-NLS-1$ //$NON-NLS-0$ if (this._selectionClass) { this._triggerNode.classList.remove(t...
javascript
{ "resource": "" }
q29206
train
function(item, direction, select) { while (item.parentNode && (document !== item.parentNode) && item.parentNode.getAttribute("role") !== "menubar") { item = item.parentNode; } if (!item.parentNode || document === item.parentNode) { return; // item is not in a menubar } var trigger = item.childNo...
javascript
{ "resource": "" }
q29207
train
function(item) { var itemToSelect = item || this.getItems()[0]; if (itemToSelect) { if (this._selectedItem) { this._selectedItem.classList.remove("dropdownMenuItemSelected"); //$NON-NLS-0$ } this._selectedItem = itemToSelect; this._selectedItem.classList.add("dropdownMenuItemSelected")...
javascript
{ "resource": "" }
q29208
train
function(text, innerNodeType) { var li = createMenuItem(text, innerNodeType); this._dropdownNode.appendChild(li); return li; }
javascript
{ "resource": "" }
q29209
createMenuItem
train
function createMenuItem(text, innerNodeType) { innerNodeType = innerNodeType === undefined ? "span" : innerNodeType; //$NON-NLS-0$ var element = document.createElement(innerNodeType); //$NON-NLS-0$ element.className = "dropdownMenuItem"; //$NON-NLS-0$ element.setAttribute("role", "menuitem"); //$NON-NLS-0...
javascript
{ "resource": "" }
q29210
appendKeyBindingString
train
function appendKeyBindingString(element, keyBindingString) { var span = document.createElement("span"); //$NON-NLS-0$ span.classList.add("dropdownKeyBinding"); //$NON-NLS-0$ span.appendChild(document.createTextNode(keyBindingString)); element.appendChild(span); }
javascript
{ "resource": "" }
q29211
addScrollButtons
train
function addScrollButtons() { var dropdown = this; if(!this._topScrollButton && !this._bottomScrollButton) { // if scroll buttons haven't been made yet this._topScrollButton = document.createElement("button"); this._bottomScrollButton = document.createElement("button"); this._topScrollButton.classList.add...
javascript
{ "resource": "" }
q29212
updateScrollButtonVisibility
train
function updateScrollButtonVisibility(hideAll) { if (hideAll && this._topScrollButton && this._bottomScrollButton) { this._topScrollButton.style.display = "none"; this._bottomScrollButton.style.display = "none"; } else if (!hideAll) { if (this._dropdownNode.scrollTop > 0) { this._topScrollButton.sty...
javascript
{ "resource": "" }
q29213
positionScrollButtons
train
function positionScrollButtons() { this._topScrollButton.style.width = this._dropdownNode.clientWidth + 1 + "px"; this._bottomScrollButton.style.width = this._dropdownNode.clientWidth + 1 + "px"; this._topScrollButton.style.top = this._dropdownNode.style.top; this._topScrollButton.style.left = this._topScrollBu...
javascript
{ "resource": "" }
q29214
train
function (text, type, args, isRtl, locale) { return getHandler(type).format(text, args, isRtl, true, locale); }
javascript
{ "resource": "" }
q29215
train
function (element, type, args, isRtl, locale) { return attachElement(element, type, args, isRtl, locale); }
javascript
{ "resource": "" }
q29216
train
function(env) { var envConfig = this.createEmptyConfig(); if (env) { envConfig.env = env; Object.keys(env).filter(function(name) { return env[name]; }).forEach(function(name) { var environment = Environments.name; if (environment) { if (environment.globals) { assign(en...
javascript
{ "resource": "" }
q29217
train
function(config) { if (config.env && typeof config.env === "object") { return this.merge(this.createEnvironmentConfig(config.env), config); } return config; }
javascript
{ "resource": "" }
q29218
train
function(ruleConfig) { var severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig; if (typeof severity === "string") { severity = RULE_SEVERITY[severity.toLowerCase()] || 0; } return typeof severity === "number" && severity === 2; }
javascript
{ "resource": "" }
q29219
train
function(ruleConfig) { var severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig; if (typeof severity === "string") { severity = severity.toLowerCase(); } return VALID_SEVERITIES.indexOf(severity) !== -1; }
javascript
{ "resource": "" }
q29220
train
function(promise, result, output, isProgress) { var element = document.createElement("div"); //$NON-NLS-0$ var waitCount = 0; var successFn = function(file) { this.callback = function() { var string = i18nUtil.formatMessage( messages["WroteMsg"], typeof(file) === "string" ? file : ...
javascript
{ "resource": "" }
q29221
train
function(hunkRangeNo ){ var lastToken = " "; //$NON-NLS-0$ var startNo = this._hunkRanges[hunkRangeNo][0] + 1; var endNo = (hunkRangeNo === (this._hunkRanges.length - 1) ) ? this._diffContents.length : this._hunkRanges[hunkRangeNo+1][0]; var oCursor = 0; var nCursor = 0; var oBlkStart = this._hunkRan...
javascript
{ "resource": "" }
q29222
train
function(body , retVal){ if( body ){ var number = parseInt(body, 10); retVal.push( number >= 0 ? number : 1); } else { retVal.push(1); } }
javascript
{ "resource": "" }
q29223
checkRestartQueue
train
function checkRestartQueue() { // Kill one worker only if maximum count are working. if (restartQueue.length > 0 && listeningWorkersCount === workersCount && !currentRestartingPid) { var pid = restartQueue.shift(); try { // Store process id to ...
javascript
{ "resource": "" }
q29224
fork
train
function fork() { cluster.fork().on('message', function(message) { if (message.cmd === 'restart' && message.pid && restartQueue.indexOf(message.pid) === -1) { // When worker asks to restart gracefully in cluster, then add it to restart queue. log('Clus...
javascript
{ "resource": "" }
q29225
checkIfNoWorkersAndExit
train
function checkIfNoWorkersAndExit() { if (!currentWorkersCount) { log('Cluster graceful shutdown: done.'); if (shutdownTimer) clearTimeout(shutdownTimer); exitFunction(); } else { log('Cluster graceful shutdown: wait ' + currentWorke...
javascript
{ "resource": "" }
q29226
train
function(){ /* * media_query_list * : S* [media_query [ ',' S* media_query ]* ]? * ; */ var tokenStream = this._tokenStream, mediaList = []; this._readWhitespace(); ...
javascript
{ "resource": "" }
q29227
train
function(){ /* * ruleset * : selectors_group * '{' S* declaration? [ ';' S* declaration? ]* '}' S* * ; */ var tokenStream = this._tokenStream, tt, selecto...
javascript
{ "resource": "" }
q29228
train
function(checkStart, readMargins){ /* * Reads the pattern * S* '{' S* declaration [ ';' S* declaration ]* '}' S* * or * S* '{' S* [ declaration | margin ]? [ ';' S* [ declaration | margin ]? ]* '}' S* * Note that this i...
javascript
{ "resource": "" }
q29229
train
function(){ var tokenStream = this._tokenStream, ws = ""; while(tokenStream.match(Tokens.S)){ ws += tokenStream.token().value; } return ws; }
javascript
{ "resource": "" }
q29230
train
function(token){ throw new SyntaxError("Unexpected token '" + token.value + "' at line " + token.startLine + ", col " + token.startCol + ".", token.startLine, token.startCol); }
javascript
{ "resource": "" }
q29231
SelectorSubPart
train
function SelectorSubPart(text, type, line, col) { SyntaxUnit.call(this, text, line, col, Parser.SELECTOR_SUB_PART_TYPE); /** * The type of modifier. * @type String * @property type */ this.type = type; /** * Some subparts have arguments, this represents them. * @type Arr...
javascript
{ "resource": "" }
q29232
train
function(other) { var comps = ["a", "b", "c", "d"], i, len; for (i=0, len=comps.length; i < len; i++) { if (this[comps[i]] < other[comps[i]]) { return -1; } else if (this[comps[i]] > other[comps[i]]) { return 1; } }...
javascript
{ "resource": "" }
q29233
train
function(c, startLine, startCol) { var reader = this._reader, comparison = c + reader.read(), tt = Tokens.type(comparison) || Tokens.CHAR; return this.createToken(tt, comparison, startLine, startCol); }
javascript
{ "resource": "" }
q29234
train
function(first, startLine, startCol) { var reader = this._reader, value = this.readNumber(first), ident, tt = Tokens.NUMBER, c = reader.peek(); if (isIdentStart(c)) { ident = this.readName(reader.read()); value += ide...
javascript
{ "resource": "" }
q29235
train
function(first, startLine, startCol) { var value = first + this.readWhitespace(); return this.createToken(Tokens.S, value, startLine, startCol); }
javascript
{ "resource": "" }
q29236
train
function(first) { var reader = this._reader, url = first || "", c; for (c = reader.peek(); c; c = reader.peek()) { // Note that the grammar at // https://www.w3.org/TR/CSS2/grammar.html#scanner // incorrectly includes the backslash charac...
javascript
{ "resource": "" }
q29237
SyntaxError
train
function SyntaxError(message, line, col) { Error.call(this); this.name = this.constructor.name; /** * The column at which the error occurred. * @type int * @property col */ this.col = col; /** * The line at which the error occurred. * @type int * @property line ...
javascript
{ "resource": "" }
q29238
train
function(index) { var total = index, tt; if (index > 0) { //TODO: Store 5 somewhere if (index > 5) { throw new Error("Too much lookahead."); } //get all those tokens while (total) { tt = this.get(); ...
javascript
{ "resource": "" }
q29239
applyEmbeddedRuleset
train
function applyEmbeddedRuleset(text, ruleset) { var valueMap, embedded = text && text.match(embeddedRuleset), rules = embedded && embedded[1]; if (rules) { valueMap = { "true": 2, // true is error "": 1, // blank is warning ...
javascript
{ "resource": "" }
q29240
Reporter
train
function Reporter(lines, ruleset, allow, ignore) { "use strict"; /** * List of messages being reported. * @property messages * @type String[] */ this.messages = []; /** * List of statistics being reported. * @property stats * @type String[] */ this.stats = [...
javascript
{ "resource": "" }
q29241
train
function(message, line, col, rule, data) { "use strict"; var err = { type : "error", line : line, col : col, message : message, evidence: this.lines[line-1], rule : rule || {} }; if (data) { err...
javascript
{ "resource": "" }
q29242
train
function(message, line, col, rule, data) { "use strict"; // Check if rule violation should be allowed if (this.allow.hasOwnProperty(line) && this.allow[line].hasOwnProperty(rule.id)) { return; } var ignore = false; CSSLint.Util.forEach(this.ignore, function ...
javascript
{ "resource": "" }
q29243
train
function(message, rule) { "use strict"; this.messages.push({ type : "error", rollup : true, message : message, rule : rule }); }
javascript
{ "resource": "" }
q29244
train
function(message, rule, data) { "use strict"; var err = { type : "warning", rollup : true, message : message, rule : rule }; if(data) { err.data = data; } this.messages.push(err); }
javascript
{ "resource": "" }
q29245
train
function() { "use strict"; var ret = ""; if (this.json.length > 0) { if (this.json.length === 1) { ret = JSON.stringify(this.json[0]); } else { ret = JSON.stringify(this.json); } } return ret; }
javascript
{ "resource": "" }
q29246
DiffTreeNavigator
train
function DiffTreeNavigator(charOrWordDiff, oldEditor, newEditor, oldDiffBlockFeeder, newDiffBlockFeeder, curveRuler) { this._root = {type: "root", children: []}; //$NON-NLS-0$ this._initialized = false; this.initAll(charOrWordDiff, oldEditor, newEditor, oldDiffBlockFeeder, newDiffBlockFeeder, curveRuler); }
javascript
{ "resource": "" }
q29247
train
function(changeIndex) { var count = 0; var blockIndex = 0; if (0 <= changeIndex) { // iterate through blocks looking for the one that contains // the change with the specified changeIndex while (blockIndex < this._root.children.length) { var numChangesInCurrentBlock = this._root.children[...
javascript
{ "resource": "" }
q29248
train
function(e) { this.iterate(false, false, e.shiftKey, true); if(!this._ctrlKeyOn(e) && !e.shiftKey){ this.setSelection(this.currentModel(), false, true); } e.preventDefault(); return false; }
javascript
{ "resource": "" }
q29249
train
function(e) { if(this._shouldMoveColumn(e)){ this.moveColumn(null, 1); e.preventDefault(); return true; } var curModel = this._modelIterator.cursor(); if(!curModel){ return false; } if(this.isExpandable(curModel)){ if(!this.isExpanded(curModel)){ this.explorer.myTree.expand(cu...
javascript
{ "resource": "" }
q29250
train
function(e) { if (!e.target.classList.contains("treeTableRow")) return; if(this.setSelection(this.currentModel(), true, true)) { e.preventDefault(); } }
javascript
{ "resource": "" }
q29251
train
function(e) { var currentGrid = this.getCurrentGrid(this._modelIterator.cursor()); if(currentGrid){ if(currentGrid.widget){ if(typeof currentGrid.onClick === "function"){ //$NON-NLS-0$ currentGrid.onClick(); } else if(typeof currentGrid.widget.focus === "function"){ //$NON-NLS-0$ current...
javascript
{ "resource": "" }
q29252
train
function(model) { var rowDiv = this.getRowDiv(model); if (this.isExpandable(model) && this.isExpanded(model)) { this._modelIterator.collapse(model); this.explorer.myTree.toggle(rowDiv.id); // collapse tree visually } rowDiv.classList.remove("checkedRow"); //$NON-NLS-0$ rowDiv.classList.add("disab...
javascript
{ "resource": "" }
q29253
train
function(model) { var rowDiv = this.getRowDiv(model); if (rowDiv) { rowDiv.classList.remove("disabledNavRow"); //$NON-NLS-0$ this.setIsNotSelectable(model, false); } }
javascript
{ "resource": "" }
q29254
train
function(modelItem, rowDomNode){ var modelId = this._model.getId(modelItem); this._dict[modelId] = {model: modelItem, rowDomNode: rowDomNode}; }
javascript
{ "resource": "" }
q29255
train
function(modelItem, lazyCreate) { if(!modelItem){ return null; } var modelId = this._model.getId(modelItem); if(this._dict[modelId]){ if(!this._dict[modelId].gridChildren && lazyCreate){ this._dict[modelId].gridChildren = []; } return this._dict[modelId].gridChildren; } return nul...
javascript
{ "resource": "" }
q29256
train
function(modelItem) { if(!modelItem){ return null; } var modelId = this._model.getId(modelItem); if(this._dict[modelId]){ this._dict[modelId].gridChildren = null; } }
javascript
{ "resource": "" }
q29257
BlankField
train
function BlankField(type, options) { Field.call(this, type, options); this.element = util.createElement(this.document, 'div'); this.onFieldChange = util.createEvent('BlankField.onFieldChange'); }
javascript
{ "resource": "" }
q29258
ProgressService
train
function ProgressService(serviceRegistry, operationsClient, commandRegistry, progressMonitorClass, preferenceService){ this._serviceRegistry = serviceRegistry; this._serviceRegistration = serviceRegistry.registerService("orion.page.progress", this); //$NON-NLS-0$ this._commandRegistry = commandRegistry; this._...
javascript
{ "resource": "" }
q29259
isSimple
train
function isSimple(typed) { for (var i = 0; i < typed.length; i++) { var c = typed.charAt(i); if (c === ' ' || c === '"' || c === '\'' || c === '{' || c === '}' || c === '\\') { return false; } } return true; }
javascript
{ "resource": "" }
q29260
naiveHasReturn
train
function naiveHasReturn(node) { if (node.type === "BlockStatement") { var body = node.body, lastChildNode = body[body.length - 1]; return lastChildNode && checkForReturn(lastChildNode); } return checkForReturn(node); }
javascript
{ "resource": "" }
q29261
importPlugin
train
function importPlugin(pluginRules, pluginName) { Object.keys(pluginRules).forEach(function(ruleId) { var qualifiedRuleId = pluginName + "/" + ruleId, rule = pluginRules[ruleId]; define(qualifiedRuleId, rule); }); }
javascript
{ "resource": "" }
q29262
_updateMap
train
function _updateMap(arr, state) { if(Array.isArray(arr)) { arr.forEach(function(file) { var f, toQ, toN, n; switch(state) { case 'onCreated': { n = file.result ? file.result.Name : undefined; f = file.result ? file.result.Location : undefined; break; } case 'onDel...
javascript
{ "resource": "" }
q29263
Searcher
train
function Searcher(options) { this._registry= options.serviceRegistry; this._commandService = options.commandService; this._fileClient = options.fileService; //TODO clean up the search client API. Make any helper private this._registry.registerService("orion.core.search.client", this); //$NON-NLS-1$ }
javascript
{ "resource": "" }
q29264
train
function(meta, useParentLocation){ var locationName = ""; var noneRootMeta = null; this._setLocationbyURL(meta); this._searchRootLocation = meta.WorkspaceLocation || this._fileClient.fileServiceRootURL(meta.Location); if(useParentLocation && meta && meta.Parents && meta.Parents.length > 0){ if(usePar...
javascript
{ "resource": "" }
q29265
train
function(searchParams, generateMatches, generateMeta) { try { return this.getFileClient().search(searchParams).then(function(jsonData) { var searchResult = this.convert(jsonData, searchParams); return this._generateMatches(searchParams, searchResult, generateMatches).then(function() { return this...
javascript
{ "resource": "" }
q29266
train
function(keyword, nameSearch, useRoot, advancedOptions, searchScope) { var searchOn = useRoot ? this.getSearchRootLocation(): this.getSearchLocation(searchScope); if (nameSearch) { //assume implicit trailing wildcard if there isn't one already //var wildcard= (/\*$/.test(keyword) ? "" : "*"); //$NON-NLS-...
javascript
{ "resource": "" }
q29267
displayErrorOnStatus
train
function displayErrorOnStatus(error) { var display = {}; display.Severity = "Error"; //$NON-NLS-0$ display.HTML = false; try { var resp = JSON.parse(error.responseText); display.Message = resp.DetailedMessage ? resp.DetailedMessage : (resp.Message ? resp.Message : messages["Problem while p...
javascript
{ "resource": "" }
q29268
train
function(data) { if (data && data.handler.changedItem) { data.handler.changedItem(); } else { explorer.changedItem(); } }
javascript
{ "resource": "" }
q29269
calculateTruePrefix
train
function calculateTruePrefix(buffer, offset, escapeCharacter) { var char = buffer.charAt(offset - 1); switch (char) { case '\n': var escapedPrefix = ""; for (var i = offset - 1; i >= 0; i--) { if (buffer.charAt(i) === '\n') { if (buffer.charAt(i - 1) === escapeCharacter) { i--; ...
javascript
{ "resource": "" }
q29270
checkCollabServerToken
train
function checkCollabServerToken(authorization) { if (authorization.substr(0, 7) !== "Bearer ") { return false; } try { var decoded = jwt.verify(authorization.substr(7), options.configParams.get("orion.jwt.secret")); return true; } catch (ex) { return false; } }
javascript
{ "resource": "" }
q29271
train
function(child, branchNameOrSha, asSha) { var _this = this; var shaValue = asSha ? branchNameOrSha : branchNameOrSha + "&path=" + child.CommitPath; return xhr("GET", _this._repoURL.href + "/commits?sha=" + shaValue + "&per_page=1", {//https://developer.github.com/v3/#pagination headers: this._headers, ...
javascript
{ "resource": "" }
q29272
isDoubleLogicalNegating
train
function isDoubleLogicalNegating(node) { return node.operator === "!" && node.argument.type === "UnaryExpression" && node.argument.operator === "!"; }
javascript
{ "resource": "" }
q29273
isAppendEmptyString
train
function isAppendEmptyString(node) { return node.operator === "+=" && node.right.type === "Literal" && node.right.value === ""; }
javascript
{ "resource": "" }
q29274
getOtherOperand
train
function getOtherOperand(node, value) { if (node.left.type === "Literal" && node.left.value === value) { return node.right; } return node.left; }
javascript
{ "resource": "" }
q29275
isInsideOfStorableFunction
train
function isInsideOfStorableFunction(id, rhsNode) { var funcNode = getUpperFunction(id); return ( funcNode && isInside(funcNode, rhsNode) && isStorableFunction(funcNode, rhsNode) ); }
javascript
{ "resource": "" }
q29276
CollabSocket
train
function CollabSocket(hubUrl, sessionId) { var self = this; this.socket = io.connect( hubUrl+ "?sessionId=" +sessionId, { path: "/socket.io/" }); this.socket.on('connect', function() { self.dispatchEvent({ type: 'ready' }); }); this....
javascript
{ "resource": "" }
q29277
OutlineRenderer
train
function OutlineRenderer (options, explorer, title, inputManager) { this.explorer = explorer; this._init(options); this.title = title; this.inputManager = inputManager; }
javascript
{ "resource": "" }
q29278
train
function() { if (!this._isActive()) { return; } this._filterInput.value = ""; //$NON-NLS-0$ lib.empty(this._outlineNode); // display spinner while outline is being calculated var spinner = document.createElement("span"); //$NON-NLS-0$ spinner.classList.add("modelDecorationSprite"); //$N...
javascript
{ "resource": "" }
q29279
train
function(provider) { var isActive = this._slideout.isVisible() && (this === this._slideout.getCurrentViewMode()); if (isActive && provider) { isActive = (provider.getProperty("id") === this.providerId); //$NON-NLS-0$ if (isActive) { isActive = (provider.getProperty("name") === this.providerName); //$...
javascript
{ "resource": "" }
q29280
train
function(fileContentType, title) { if (!fileContentType) return; var lspServer = this.languageServerRegistry.getServerByContentType(fileContentType); var filteredProviders = null; var _self = this; if (lspServer) { filteredProviders = []; filteredProviders.push(lspServer); } else { var all...
javascript
{ "resource": "" }
q29281
getReplacedFileContent
train
function getReplacedFileContent(newContentHolder, updating, fileItem) { mSearchUtils.generateNewContents(updating, fileItem.contents, newContentHolder, fileItem, this._searchHelper.params.replace, this._searchHelper.inFileQuery.searchStrLength); newContentHolder.lineDelim = this._lineDelimiter; }
javascript
{ "resource": "" }
q29282
writeReplacedContents
train
function writeReplacedContents(reportList){ var promises = []; var validFileList = this.getValidFileList(); validFileList.forEach(function(fileItem) { promises.push(this._writeOneFile(fileItem, reportList)); }.bind(this)); return Deferred.all(promises, function(error) { return {_error: error}; ...
javascript
{ "resource": "" }
q29283
isReflectApply
train
function isReflectApply(node) { return node.type === "MemberExpression" && node.object.type === "Identifier" && node.object.name === "Reflect" && node.property.type === "Identifier" && node.property.name === "apply" && node.computed === false; }
javascript
{ "resource": "" }
q29284
isES5Constructor
train
function isES5Constructor(node) { return node.id && node.id.name[0] !== node.id.name[0].toLocaleLowerCase(); }
javascript
{ "resource": "" }
q29285
train
function(node) { var current = stack.getCurrent(); if (current && !current.valid) { context.report(node, ProblemMessages.noInvalidThis); } }
javascript
{ "resource": "" }
q29286
train
function() { BaseEditor.prototype.destroy.call(this); this._textViewFactory = this._undoStackFactory = this._textDNDFactory = this._annotationFactory = this._foldingRulerFactory = this._lineNumberRulerFactory = this._contentAssistFactory = this._keyBindingFactory = this._hoverFactory = this._zoomRulerFact...
javascript
{ "resource": "" }
q29287
train
function(start, end) { var annotationModel = this.getAnnotationModel(); if(annotationModel) { var foldingAnnotation = new mAnnotations.FoldingAnnotation(start, end, this.getTextView().getModel()); annotationModel.addAnnotation(foldingAnnotation); return foldingAnnotation; } return null; }
javascript
{ "resource": "" }
q29288
train
function() { if (!this._textView) { return null; } var model = this._textView.getModel(); if (model.getBaseModel) { model = model.getBaseModel(); } return model; }
javascript
{ "resource": "" }
q29289
train
function(visible, force) { if (this._annotationRulerVisible === visible && !force) { return; } this._annotationRulerVisible = visible; if (!this._annotationRuler) { return; } var textView = this._textView; if (visible) { textView.addRuler(this._annotationRuler, 0); } else { textView.removeRule...
javascript
{ "resource": "" }
q29290
train
function(visible, force) { if (this._foldingRulerVisible === visible && !force) { return; } if (!visible) { var textActions = this.getTextActions(); if (textActions) { textActions.expandAnnotations(true); } } this._foldingRulerVisible = visible; if (!this._foldingRuler) { return; } va...
javascript
{ "resource": "" }
q29291
train
function(visible, force) { if (this._lineNumberRulerVisible === visible && !force) { return; } this._lineNumberRulerVisible = visible; if (!this._lineNumberRuler) { return; } var textView = this._textView; if (visible) { textView.addRuler(this._lineNumberRuler, !this._annotationRulerVisible ? 0 : 1);...
javascript
{ "resource": "" }
q29292
train
function(visible, force) { if (this._overviewRulerVisible === visible && !force) { return; } this._overviewRulerVisible = visible; if (!this._overviewRuler) { return; } var textView = this._textView; if (visible) { textView.addRuler(this._overviewRuler); } else { textView.removeRuler(this._ove...
javascript
{ "resource": "" }
q29293
train
function(visible, force) { if (this._zoomRulerVisible === visible && !force) { return; } this._zoomRulerVisible = visible; if (!this._zoomRuler) { return; } var textView = this._textView; if (visible) { textView.addRuler(this._zoomRuler); } else { textView.removeRuler(this._zoomRuler); } ...
javascript
{ "resource": "" }
q29294
train
function(types) { if (textUtil.compare(this._annotationTypesVisible, types)) return; this._annotationTypesVisible = types; if (!this._annotationRuler || !this._textView || !this._annotationRulerVisible) { return; } this._annotationRuler.setAnnotationTypeVisible(types); this._textView.redrawLines(0, undef...
javascript
{ "resource": "" }
q29295
train
function(types) { if (textUtil.compare(this._overviewAnnotationTypesVisible, types)) return; this._overviewAnnotationTypesVisible = types; if (!this._overviewRuler || !this._textView || !this._overviewRulerVisible) { return; } this._overviewRuler.setAnnotationTypeVisible(types); this._textView.redrawLine...
javascript
{ "resource": "" }
q29296
train
function(types) { if (textUtil.compare(this._textAnnotationTypesVisible, types)) return; this._textAnnotationTypesVisible = types; if (!this._annotationStyler || !this._textView) { return; } this._annotationStyler.setAnnotationTypeVisible(types); this._textView.redrawLines(0, undefined); }
javascript
{ "resource": "" }
q29297
train
function(line) { // Find any existing annotation var annotationModel = this.getAnnotationModel(); var textModel = this.getModel(); if (textModel.getBaseModel) { textModel = textModel.getBaseModel(); } var type = AT.ANNOTATION_HIGHLIGHTED_LINE; var annotations = annotationModel.getAnnotations(0,...
javascript
{ "resource": "" }
q29298
train
function() { var annotationModel = this.getAnnotationModel(); var textModel = this.getModel(); if (textModel.getBaseModel) { textModel = textModel.getBaseModel(); } var type = AT.ANNOTATION_HIGHLIGHTED_LINE; var annotations = annotationModel.getAnnotations(0, textModel.getCharCount()); var remo...
javascript
{ "resource": "" }
q29299
train
function(diffs) { this.showAnnotations(diffs, [ AT.ANNOTATION_DIFF_ADDED, AT.ANNOTATION_DIFF_MODIFIED, AT.ANNOTATION_DIFF_DELETED ], null, function(annotation) { if(annotation.type === "added")//$NON-NLS-0$ return AT.ANNOTATION_DIFF_ADDED; else if (annotation.type === "modified")//$NON-NL...
javascript
{ "resource": "" }