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

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

Issue 2712513002: DevTools: extract ObjectUI module from Components (Closed)
Patch Set: fix build.gn Created 3 years, 10 months 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 unified diff | Download patch
OLDNEW
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 * @unrestricted 5 * @unrestricted
6 */ 6 */
7 Console.ConsolePrompt = class extends UI.Widget { 7 Console.ConsolePrompt = class extends UI.Widget {
8 constructor() { 8 constructor() {
9 super(); 9 super();
10 this._addCompletionsFromHistory = true; 10 this._addCompletionsFromHistory = true;
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 264
265 var excludedTokens = new Set(['js-comment', 'js-string-2', 'js-def']); 265 var excludedTokens = new Set(['js-comment', 'js-string-2', 'js-def']);
266 var trimmedBefore = before.trim(); 266 var trimmedBefore = before.trim();
267 if (!trimmedBefore.endsWith('[') && !trimmedBefore.match(/\.\s*(get|set|dele te)\s*\(\s*$/)) 267 if (!trimmedBefore.endsWith('[') && !trimmedBefore.match(/\.\s*(get|set|dele te)\s*\(\s*$/))
268 excludedTokens.add('js-string'); 268 excludedTokens.add('js-string');
269 if (!trimmedBefore.endsWith('.')) 269 if (!trimmedBefore.endsWith('.'))
270 excludedTokens.add('js-property'); 270 excludedTokens.add('js-property');
271 if (excludedTokens.has(currentTokenType)) 271 if (excludedTokens.has(currentTokenType))
272 return Promise.resolve(historyWords); 272 return Promise.resolve(historyWords);
273 273
274 return Components.JavaScriptAutocomplete.completionsForTextInCurrentContext( before, query, force) 274 return ObjectUI.JavaScriptAutocomplete.completionsForTextInCurrentContext(be fore, query, force)
275 .then(words => words.concat(historyWords)); 275 .then(words => words.concat(historyWords));
276 } 276 }
277 277
278 _editorSetForTest() { 278 _editorSetForTest() {
279 } 279 }
280 }; 280 };
281 281
282 /** 282 /**
283 * @unrestricted 283 * @unrestricted
284 */ 284 */
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 return this._currentHistoryItem(); 361 return this._currentHistoryItem();
362 } 362 }
363 363
364 /** 364 /**
365 * @return {string|undefined} 365 * @return {string|undefined}
366 */ 366 */
367 _currentHistoryItem() { 367 _currentHistoryItem() {
368 return this._data[this._data.length - this._historyOffset]; 368 return this._data[this._data.length - this._historyOffset];
369 } 369 }
370 }; 370 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698