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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/components/JavaScriptAutocomplete.js

Issue 2479943002: DevTools: Don't show autocomplete when the user is typing a number (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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/console/console-correct-suggestions-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 WebInspector.JavaScriptAutocomplete = {}; 5 WebInspector.JavaScriptAutocomplete = {};
6 6
7 /** 7 /**
8 * @param {!Element} proxyElement 8 * @param {!Element} proxyElement
9 * @param {!Range} wordRange 9 * @param {!Range} wordRange
10 * @param {boolean} force 10 * @param {boolean} force
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 var lastIndex = expressionString.length - 1; 68 var lastIndex = expressionString.length - 1;
69 69
70 var dotNotation = (expressionString[lastIndex] === '.'); 70 var dotNotation = (expressionString[lastIndex] === '.');
71 var bracketNotation = (expressionString[lastIndex] === '['); 71 var bracketNotation = (expressionString[lastIndex] === '[');
72 72
73 if (dotNotation || bracketNotation) 73 if (dotNotation || bracketNotation)
74 expressionString = expressionString.substr(0, lastIndex); 74 expressionString = expressionString.substr(0, lastIndex);
75 75
76 // User is entering float value, do not suggest anything. 76 // User is entering float value, do not suggest anything.
77 if (expressionString && !isNaN(expressionString)) 77 if ((expressionString && !isNaN(expressionString)) || (!expressionString && qu ery && !isNaN(query)))
78 return Promise.resolve([]); 78 return Promise.resolve([]);
79 79
80 if (!query && !expressionString && !force) 80 if (!query && !expressionString && !force)
81 return Promise.resolve([]); 81 return Promise.resolve([]);
82 82
83 var fufill; 83 var fufill;
84 var promise = new Promise(x => fufill = x); 84 var promise = new Promise(x => fufill = x);
85 if (!expressionString && executionContext.debuggerModel.selectedCallFrame()) 85 if (!expressionString && executionContext.debuggerModel.selectedCallFrame())
86 executionContext.debuggerModel.selectedCallFrame().variableNames(receivedPro pertyNames); 86 executionContext.debuggerModel.selectedCallFrame().variableNames(receivedPro pertyNames);
87 else 87 else
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 caseSensitivePrefix.push(prop); 283 caseSensitivePrefix.push(prop);
284 else if (property.toLowerCase().startsWith(query.toLowerCase())) 284 else if (property.toLowerCase().startsWith(query.toLowerCase()))
285 caseInsensitivePrefix.push(prop); 285 caseInsensitivePrefix.push(prop);
286 else if (property.indexOf(query) !== -1) 286 else if (property.indexOf(query) !== -1)
287 caseSensitiveAnywhere.push(prop); 287 caseSensitiveAnywhere.push(prop);
288 else 288 else
289 caseInsensitiveAnywhere.push(prop); 289 caseInsensitiveAnywhere.push(prop);
290 } 290 }
291 return caseSensitivePrefix.concat(caseInsensitivePrefix).concat(caseSensitiveA nywhere).concat(caseInsensitiveAnywhere); 291 return caseSensitivePrefix.concat(caseInsensitivePrefix).concat(caseSensitiveA nywhere).concat(caseInsensitiveAnywhere);
292 }; 292 };
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/console/console-correct-suggestions-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698