| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @extends {WebInspector.Widget} | 7 * @extends {WebInspector.Widget} |
| 8 */ | 8 */ |
| 9 WebInspector.ConsolePrompt = function() | 9 WebInspector.ConsolePrompt = function() |
| 10 { | 10 { |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 * @param {!WebInspector.TextRange} substituteRange | 269 * @param {!WebInspector.TextRange} substituteRange |
| 270 * @return {!Promise.<!Array.<{title: string, className: (string|undefined)}
>>} | 270 * @return {!Promise.<!Array.<{title: string, className: (string|undefined)}
>>} |
| 271 */ | 271 */ |
| 272 _wordsWithPrefix: function(prefixRange, substituteRange) | 272 _wordsWithPrefix: function(prefixRange, substituteRange) |
| 273 { | 273 { |
| 274 var fulfill; | 274 var fulfill; |
| 275 var promise = new Promise(x => fulfill = x); | 275 var promise = new Promise(x => fulfill = x); |
| 276 var prefix = this._editor.text(prefixRange); | 276 var prefix = this._editor.text(prefixRange); |
| 277 var before = this._editor.text(new WebInspector.TextRange(0, 0, prefixRa
nge.startLine, prefixRange.startColumn)); | 277 var before = this._editor.text(new WebInspector.TextRange(0, 0, prefixRa
nge.startLine, prefixRange.startColumn)); |
| 278 var historyWords = this._historyCompletions(prefix); | 278 var historyWords = this._historyCompletions(prefix); |
| 279 WebInspector.ExecutionContextSelector.completionsForTextInCurrentContext
(before, prefix, false /* Don't force */, innerWordsWithPrefix); | 279 WebInspector.ExecutionContextSelector.completionsForTextInCurrentContext
(before, prefix, true /* force */, innerWordsWithPrefix); |
| 280 return promise; | 280 return promise; |
| 281 | 281 |
| 282 /** | 282 /** |
| 283 * @param {!Array.<string>} words | 283 * @param {!Array.<string>} words |
| 284 */ | 284 */ |
| 285 function innerWordsWithPrefix(words) | 285 function innerWordsWithPrefix(words) |
| 286 { | 286 { |
| 287 fulfill(words.map(item => ({title:item})).concat(historyWords)); | 287 fulfill(words.map(item => ({title:item})).concat(historyWords)); |
| 288 } | 288 } |
| 289 }, | 289 }, |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 }, | 383 }, |
| 384 | 384 |
| 385 /** | 385 /** |
| 386 * @return {string|undefined} | 386 * @return {string|undefined} |
| 387 */ | 387 */ |
| 388 _currentHistoryItem: function() | 388 _currentHistoryItem: function() |
| 389 { | 389 { |
| 390 return this._data[this._data.length - this._historyOffset]; | 390 return this._data[this._data.length - this._historyOffset]; |
| 391 } | 391 } |
| 392 }; | 392 }; |
| OLD | NEW |