Bug 108697 - Web Inspector: highlight matching braces in DTE.
Summary: Web Inspector: highlight matching braces in DTE.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Andrey Lushnikov
URL:
Keywords:
Depends on: 108685 108692
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-01 14:35 PST by Andrey Lushnikov
Modified: 2013-02-07 03:52 PST (History)
12 users (show)

See Also:


Attachments
Patch (22.08 KB, patch)
2013-02-01 15:07 PST, Andrey Lushnikov
no flags Details | Formatted Diff | Diff
Cursor inside OR block (5.13 KB, image/png)
2013-02-01 15:07 PST, Andrey Lushnikov
no flags Details
Patch (23.18 KB, patch)
2013-02-05 03:40 PST, Andrey Lushnikov
no flags Details | Formatted Diff | Diff
Patch (31.62 KB, patch)
2013-02-06 01:20 PST, Andrey Lushnikov
no flags Details | Formatted Diff | Diff
Patch (31.64 KB, patch)
2013-02-06 04:47 PST, Andrey Lushnikov
no flags Details | Formatted Diff | Diff
Patch (33.38 KB, patch)
2013-02-06 07:43 PST, Andrey Lushnikov
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Lushnikov 2013-02-01 14:35:31 PST
Highlight matching braces in DefaultTextEditor:
- when cursor on a curly/round brace, highlight matching one
- when cursor not on a curly/round brace, highlight enclosing braces
Comment 1 Andrey Lushnikov 2013-02-01 15:07:15 PST
Created attachment 186154 [details]
Patch
Comment 2 Andrey Lushnikov 2013-02-01 15:07:54 PST
Created attachment 186155 [details]
Cursor inside OR block
Comment 3 Build Bot 2013-02-01 17:46:39 PST
Comment on attachment 186154 [details]
Patch

Attachment 186154 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/16330404

New failing tests:
inspector/editor/brace-matcher.html
Comment 4 WebKit Review Bot 2013-02-01 18:27:28 PST
Comment on attachment 186154 [details]
Patch

Attachment 186154 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/16331433

New failing tests:
inspector/editor/brace-matcher.html
Comment 5 Build Bot 2013-02-01 20:12:47 PST
Comment on attachment 186154 [details]
Patch

Attachment 186154 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://queues.webkit.org/results/16336468

New failing tests:
inspector/editor/brace-matcher.html
Comment 6 Andrey Lushnikov 2013-02-05 03:40:41 PST
Created attachment 186594 [details]
Patch
Comment 7 Andrey Lushnikov 2013-02-06 01:20:50 PST
Created attachment 186783 [details]
Patch
Comment 8 Pavel Feldman 2013-02-06 04:09:19 PST
Comment on attachment 186783 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=186783&action=review

Overall looks good. Please migrate the {} auto-indent code to the new matcher to test if the API is universal enough.

> Source/WebCore/inspector/front-end/TextEditorHighlighter.js:199
> +                        else

{} around multiline block please.

> Source/WebCore/inspector/front-end/TextEditorModel.js:676
> +        if (lineNumber >= this._textModel.linesCount || lineNumber < 0)

When does this happen?

> Source/WebCore/inspector/front-end/TextEditorModel.js:702
> +    findLeftPretendent: function(lineNumber, column, maxBraceIteration)

Pretendent -> Candidate

> Source/WebCore/inspector/front-end/TextEditorModel.js:796
> +

You don't need to make every other line a whitespace.
Comment 9 Andrey Lushnikov 2013-02-06 04:46:59 PST
Comment on attachment 186783 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=186783&action=review

>> Source/WebCore/inspector/front-end/TextEditorHighlighter.js:199
>> +                        else
> 
> {} around multiline block please.

fixed

>> Source/WebCore/inspector/front-end/TextEditorModel.js:676
>> +        if (lineNumber >= this._textModel.linesCount || lineNumber < 0)
> 
> When does this happen?

in while-loop of findLeftPretendent:
..
while ((braces = this._braceRanges(--lineNumber)) && !braces.length) {};
..

and in a symmetrical findRightCandidate:
...
while ((braces = this._braceRanges(++lineNumber)) && !braces.length) {};
...

>> Source/WebCore/inspector/front-end/TextEditorModel.js:702
>> +    findLeftPretendent: function(lineNumber, column, maxBraceIteration)
> 
> Pretendent -> Candidate

fixed

>> Source/WebCore/inspector/front-end/TextEditorModel.js:796
>> +
> 
> You don't need to make every other line a whitespace.

removed couple of newlines.
Comment 10 Andrey Lushnikov 2013-02-06 04:47:53 PST
Created attachment 186830 [details]
Patch
Comment 11 WebKit Review Bot 2013-02-06 06:47:59 PST
Comment on attachment 186830 [details]
Patch

Rejecting attachment 186830 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '--bot-id=gce-cq-01', 'apply-attachment', '--no-update', '--non-interactive', 186830, '--port=chromium-xvfb']" exit_code: 2 cwd: /mnt/git/webkit-commit-queue

Last 500 characters of output:
113.
2 out of 2 hunks FAILED -- saving rejects to file LayoutTests/inspector/editor/highlighter-basics-expected.txt.rej
patching file LayoutTests/inspector/editor/text-editor-long-line-expected.txt
Hunk #1 FAILED at 2.
1 out of 1 hunk FAILED -- saving rejects to file LayoutTests/inspector/editor/text-editor-long-line-expected.txt.rej

Failed to run "[u'/mnt/git/webkit-commit-queue/Tools/Scripts/svn-apply', '--force', '--reviewer', 'Pavel Feldman']" exit_code: 1 cwd: /mnt/git/webkit-commit-queue

Full output: http://queues.webkit.org/results/16389274
Comment 12 Andrey Lushnikov 2013-02-06 07:43:03 PST
Created attachment 186853 [details]
Patch
Comment 13 WebKit Review Bot 2013-02-07 03:52:45 PST
Comment on attachment 186853 [details]
Patch

Clearing flags on attachment: 186853

Committed r142091: <http://trac.webkit.org/changeset/142091>
Comment 14 WebKit Review Bot 2013-02-07 03:52:50 PST
All reviewed patches have been landed.  Closing bug.