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

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

Issue 2480423002: DevTools: Use CodeMirror syntax highlighting to improve JS autocomplete (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/console/ConsolePrompt.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/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--) {
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/console/ConsolePrompt.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698