Bug 159732 - Web Inspector: Support for :lineNumber syntax in Open Resource Dialog
Summary: Web Inspector: Support for :lineNumber syntax in Open Resource Dialog
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-07-13 12:09 PDT by Nikita Vasilyev
Modified: 2016-08-12 16:11 PDT (History)
7 users (show)

See Also:


Attachments
[Animated GIF] ":123" doesn't jump to line 123 (33.39 KB, image/gif)
2016-08-03 11:08 PDT, Nikita Vasilyev
no flags Details
[PATCH] Proposed Fix (11.12 KB, patch)
2016-08-11 19:10 PDT, Joseph Pecoraro
mattbaker: review+
Details | Formatted Diff | Diff
[PATCH] For Landing (11.11 KB, patch)
2016-08-12 12:10 PDT, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikita Vasilyev 2016-07-13 12:09:04 PDT
Open Resource Dialog (aka Quick Open) in Sublime Text and Chrome DevTools
support "path/to/file.js:lineNumber" syntax. It would be nice if we had it too.

Steps:
1. Open Web Inspector on this page.
2. Press Cmd-Shift-O.
3. Enter "global.css:200".

Expected:
global.css opens on 200th line.

Actual:
Open Resource Dialog doesn't find any matching files.
Comment 1 BJ Burg 2016-08-03 10:57:18 PDT
In ST2+, just :nnn will seek to that line within the current text editor.
Comment 2 Nikita Vasilyev 2016-08-03 11:08:00 PDT
Created attachment 285251 [details]
[Animated GIF] ":123" doesn't jump to line 123

(In reply to comment #1)
> In ST2+, just :nnn will seek to that line within the current text editor.

Doesn't work for me.
Comment 3 Matt Baker 2016-08-03 13:26:05 PDT
Similar to Chrome and Sublime, we should also bring up the dialog pre-populated with a ":" when pressing Control-G. Removing the colon should return the dialog to Quick Open mode.
Comment 4 Radar WebKit Bug Importer 2016-08-03 13:26:26 PDT
<rdar://problem/27684491>
Comment 5 Joseph Pecoraro 2016-08-11 01:24:48 PDT
Easy enough to do. Textmate supports all kinds of syntax:

  • basic position ":<line>:<column>"
  • multiple cursors ":10:0&:11:0"
  • ranges ":10:0-:11:0"

But I think for starters basic positions will work fine. I have this working, I just need to clean the code up a bit.
Comment 6 Joseph Pecoraro 2016-08-11 19:10:02 PDT
Created attachment 285881 [details]
[PATCH] Proposed Fix
Comment 7 Matt Baker 2016-08-11 20:16:40 PDT
Comment on attachment 285881 [details]
[PATCH] Proposed Fix

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

Works great!

> Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.js:164
> +                    let [_, lineNumber, columnNumber] = this._inputElement.value.split(":");

Placeholders aren't necessary to ignore destructured return values.
Comment 8 Nikita Vasilyev 2016-08-11 22:59:01 PDT
Comment on attachment 285881 [details]
[PATCH] Proposed Fix

Would be nice to focus on a CodeMirror instance after ":<line>:<column>" query is entered, so I could type right away.
Comment 9 Joseph Pecoraro 2016-08-12 11:24:44 PDT
(In reply to comment #7)
> Comment on attachment 285881 [details]
> [PATCH] Proposed Fix
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=285881&action=review
> 
> Works great!
> 
> > Source/WebInspectorUI/UserInterface/Views/OpenResourceDialog.js:164
> > +                    let [_, lineNumber, columnNumber] = this._inputElement.value.split(":");
> 
> Placeholders aren't necessary to ignore destructured return values.

Oh snap!
Comment 10 Joseph Pecoraro 2016-08-12 11:26:36 PDT
(In reply to comment #8)
> Comment on attachment 285881 [details]
> [PATCH] Proposed Fix
> 
> Would be nice to focus on a CodeMirror instance after ":<line>:<column>"
> query is entered, so I could type right away.

I agree and almost tackled it with this patch. In the end, focusing is a more generic problem that I think could be handled in a separate patch. Maybe its as easy as adding a field to the cookie (alongside lineNumber/columnNumber) or maybe showing text content views should always focus when shown.
Comment 11 Joseph Pecoraro 2016-08-12 12:10:05 PDT
Created attachment 285927 [details]
[PATCH] For Landing
Comment 12 WebKit Commit Bot 2016-08-12 13:36:18 PDT
Comment on attachment 285927 [details]
[PATCH] For Landing

Clearing flags on attachment: 285927

Committed r204418: <http://trac.webkit.org/changeset/204418>
Comment 13 Nikita Vasilyev 2016-08-12 16:11:08 PDT
Closing manually. I don't know why it didn't get closed after committing.