Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Unified Diff: third_party/WebKit/Source/devtools/front_end/console/ConsolePrompt.js

Issue 2478923003: DevTools: Distinguish between forced and unforced autocomplete in CMTE (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorTextEditor.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 67a0ee797be36dc711820de845f855afc5ed4d84..53ca7697a7eaa70e3af665785bb5232989db3721 100644
--- a/third_party/WebKit/Source/devtools/front_end/console/ConsolePrompt.js
+++ b/third_party/WebKit/Source/devtools/front_end/console/ConsolePrompt.js
@@ -201,10 +201,11 @@ WebInspector.ConsolePrompt = class extends WebInspector.Widget {
/**
* @param {string} prefix
+ * @param {boolean=} force
* @return {!WebInspector.SuggestBox.Suggestions}
*/
- _historyCompletions(prefix) {
- if (!this._addCompletionsFromHistory || !this._isCaretAtEndOfPrompt())
+ _historyCompletions(prefix, force) {
+ if (!this._addCompletionsFromHistory || !this._isCaretAtEndOfPrompt() || (!prefix && !force))
return [];
var result = [];
var text = this.text();
@@ -250,13 +251,14 @@ WebInspector.ConsolePrompt = class extends WebInspector.Widget {
/**
* @param {!WebInspector.TextRange} queryRange
* @param {!WebInspector.TextRange} substituteRange
+ * @param {boolean=} force
* @return {!Promise<!WebInspector.SuggestBox.Suggestions>}
*/
- _wordsWithQuery(queryRange, substituteRange) {
+ _wordsWithQuery(queryRange, substituteRange, force) {
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 */)
+ var historyWords = this._historyCompletions(query, force);
+ return WebInspector.JavaScriptAutocomplete.completionsForTextInCurrentContext(before, query, force)
.then(innerWordsWithQuery);
/**
* @param {!Array<string>} words
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/text_editor/CodeMirrorTextEditor.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698