| Index: third_party/WebKit/Source/devtools/front_end/console/ConsolePrompt.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/console/ConsolePrompt.js b/third_party/WebKit/Source/devtools/front_end/console/ConsolePrompt.js
|
| index 1c248790657d5247463b1e1238fe074a3ae6e288..67a0ee797be36dc711820de845f855afc5ed4d84 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/console/ConsolePrompt.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/console/ConsolePrompt.js
|
| @@ -27,7 +27,7 @@ WebInspector.ConsolePrompt = class extends WebInspector.Widget {
|
|
|
| this._editor.configureAutocomplete({
|
| substituteRangeCallback: this._substituteRange.bind(this),
|
| - suggestionsCallback: this._wordsWithPrefix.bind(this),
|
| + suggestionsCallback: this._wordsWithQuery.bind(this),
|
| captureEnter: true
|
| });
|
| this._editor.widget().element.addEventListener('keydown', this._editorKeyDown.bind(this), true);
|
| @@ -248,22 +248,21 @@ WebInspector.ConsolePrompt = class extends WebInspector.Widget {
|
| }
|
|
|
| /**
|
| - * @param {!WebInspector.TextRange} prefixRange
|
| + * @param {!WebInspector.TextRange} queryRange
|
| * @param {!WebInspector.TextRange} substituteRange
|
| * @return {!Promise<!WebInspector.SuggestBox.Suggestions>}
|
| */
|
| - _wordsWithPrefix(prefixRange, substituteRange) {
|
| - var prefix = this._editor.text(prefixRange);
|
| - var before = this._editor.text(new WebInspector.TextRange(0, 0, prefixRange.startLine, prefixRange.startColumn));
|
| - var historyWords = this._historyCompletions(prefix);
|
| - return WebInspector.JavaScriptAutocomplete.completionsForTextInCurrentContext(before, prefix, true /* force */)
|
| - .then(innerWordsWithPrefix);
|
| -
|
| + _wordsWithQuery(queryRange, substituteRange) {
|
| + var query = this._editor.text(queryRange);
|
| + var before = this._editor.text(new WebInspector.TextRange(0, 0, queryRange.startLine, queryRange.startColumn));
|
| + var historyWords = this._historyCompletions(query);
|
| + return WebInspector.JavaScriptAutocomplete.completionsForTextInCurrentContext(before, query, true /* force */)
|
| + .then(innerWordsWithQuery);
|
| /**
|
| * @param {!Array<string>} words
|
| * @return {!WebInspector.SuggestBox.Suggestions}
|
| */
|
| - function innerWordsWithPrefix(words) {
|
| + function innerWordsWithQuery(words) {
|
| return words.map(item => ({title: item})).concat(historyWords);
|
| }
|
| }
|
|
|