Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/components/JavaScriptAutocomplete.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/components/JavaScriptAutocomplete.js b/third_party/WebKit/Source/devtools/front_end/components/JavaScriptAutocomplete.js |
| index c53a7e7d6a82f3c03b22217a941d142bb091c674..4c61f62fa3197ae24474347a72dd1cdd8bdffc39 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/components/JavaScriptAutocomplete.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/components/JavaScriptAutocomplete.js |
| @@ -22,9 +22,16 @@ WebInspector.JavaScriptAutocomplete.completionsForTextPromptInCurrentContext = f |
| * @param {string} text |
| * @param {string} query |
| * @param {boolean=} force |
| + * @param {string=} tokenType |
| * @return {!Promise<!Array<string>>} |
| */ |
| -WebInspector.JavaScriptAutocomplete.completionsForTextInCurrentContext = function(text, query, force) { |
| +WebInspector.JavaScriptAutocomplete.completionsForTextInCurrentContext = function(text, query, force, tokenType) { |
| + var excludedTokens = new Set(['js-comment', 'js-string-2']); |
| + if (!text.endsWith('[')) |
|
einbinder
2016/11/07 23:04:48
If the user is typing window["docu then we want to
|
| + excludedTokens.add('js-string'); |
| + if (excludedTokens.has(tokenType)) |
| + return Promise.resolve([]); |
| + |
| var index; |
| var stopChars = new Set(' =:({;,!+-*/&|^<>`'.split('')); |
| for (index = text.length - 1; index >= 0; index--) { |