ASSIGNED142844
Web Inspector: Improve Autocomplete in the Console
https://bugs.webkit.org/show_bug.cgi?id=142844
Summary Web Inspector: Improve Autocomplete in the Console
Nikita Vasilyev
Reported 2015-03-18 14:59:11 PDT
Created attachment 248969 [details] Animated GIF of the current behavior Don’t autocomplete: var a| function a| function myFunc(a| class a| {a| {get a| (Text cursor is marked by |) The current behavior is demonstrated in the attached animated GIF.
Attachments
Animated GIF of the current behavior (77.29 KB, image/gif)
2015-03-18 14:59 PDT, Nikita Vasilyev
no flags
Nikita Vasilyev
Comment 1 2015-03-18 16:27:59 PDT
http://trac.webkit.org/browser/trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.js#L579 CodeMirror provides lexical types which I was hoping to leverage. Unfortunately, for both cases below the lexical type is the same "vardef": var a| <- shouldn’t autocomplete var a = myFunc| <- should autocomplete Lexical type ")": function a(b| <- shouldn’t autocomplete if(myFunc| <- should autocomplete Lexical type "stat": {a| <- shouldn’t autocomplete myFunc| <- shouldn’t autocomplete
Nikita Vasilyev
Comment 2 2015-03-18 17:59:33 PDT
Seems like the only case I can fix is: function a| At this case CodeMirror’s lexical type is "block". However, var fn = function a| is lexical type "vardef" and function fn() {return function a| is lexical type "stat". These two will still trigger pointless autocomplete.
David Kilzer (:ddkilzer)
Comment 3 2016-09-09 11:49:02 PDT
Note You need to log in before you can comment on or make changes to this bug.