Title: [226728] trunk/Source/WebInspectorUI
Revision
226728
Author
commit-qu...@webkit.org
Date
2018-01-10 12:19:20 -0800 (Wed, 10 Jan 2018)

Log Message

Web Inspector: Should not try to autocomplete subsections of a string
https://bugs.webkit.org/show_bug.cgi?id=181461
<rdar://problem/36369421>

Patch by Joseph Pecoraro <pecor...@apple.com> on 2018-01-10
Reviewed by Brian Burg.

* UserInterface/Controllers/CodeMirrorCompletionController.js:
(WI.CodeMirrorCompletionController.prototype._completeAtCurrentPosition):
Disable autocompletion within strings.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (226727 => 226728)


--- trunk/Source/WebInspectorUI/ChangeLog	2018-01-10 20:07:09 UTC (rev 226727)
+++ trunk/Source/WebInspectorUI/ChangeLog	2018-01-10 20:19:20 UTC (rev 226728)
@@ -1,3 +1,15 @@
+2018-01-10  Joseph Pecoraro  <pecor...@apple.com>
+
+        Web Inspector: Should not try to autocomplete subsections of a string
+        https://bugs.webkit.org/show_bug.cgi?id=181461
+        <rdar://problem/36369421>
+
+        Reviewed by Brian Burg.
+
+        * UserInterface/Controllers/CodeMirrorCompletionController.js:
+        (WI.CodeMirrorCompletionController.prototype._completeAtCurrentPosition):
+        Disable autocompletion within strings.
+
 2018-01-09  Joseph Pecoraro  <pecor...@apple.com>
 
         REGRESSION(r201855): Web Inspector: Should see "length" autocompletion suggestion on a string literal

Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.js (226727 => 226728)


--- trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.js	2018-01-10 20:07:09 UTC (rev 226727)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorCompletionController.js	2018-01-10 20:19:20 UTC (rev 226728)
@@ -475,8 +475,8 @@
         var cursor = this._codeMirror.getCursor();
         var token = this._codeMirror.getTokenAt(cursor);
 
-        // Don't try to complete inside comments.
-        if (token.type && /\bcomment\b/.test(token.type)) {
+        // Don't try to complete inside comments or strings.
+        if (token.type && /\b(comment|string)\b/.test(token.type)) {
             this.hideCompletions();
             return;
         }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to