Closed Bug 717985 Opened 13 years ago Closed 4 years ago

Set breakpoints from View Source

Categories

(DevTools :: Debugger, enhancement, P5)

10 Branch
x86
macOS
enhancement

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: dcamp, Unassigned)

References

Details

      No description provided.
There used to be a plan to use SourceEditor in View Source, but IIRC it was decided that hsivonen's new parser was better? In the old plan bug 707987 would provide (most of) the solution, but if we end up not using SourceEditor we should hack View Source directly?
hsivonen's viewsource update is useful for HTML files. I wonder if we could use some smarts there and display CSS and JS using the SourceEditor? That would allow us to use the same mechanism for setting breakpoints as the debugger.

cc-ing Henri for his opinion.
It's not clear what the question that my opinion is being asked on is.
(In reply to Henri Sivonen (:hsivonen) from comment #3)
> It's not clear what the question that my opinion is being asked on is.

I think Rob's asking whether we could use your HTML parser in viewsource for HTML docs and SourceEditor/Orion for JS & CSS docs.
If SourceEditor/Orion can highlight a line by line number, I expect it to work for JS/CSS.

Does SourceEditor support showing line numbers? Could it be used for plain text, too? (In order to avoid having to add support for plain text line numbering to the current View Source back end?)
(In reply to Henri Sivonen (:hsivonen) from comment #5)
> If SourceEditor/Orion can highlight a line by line number, I expect it to
> work for JS/CSS.
> 
> Does SourceEditor support showing line numbers? Could it be used for plain
> text, too? (In order to avoid having to add support for plain text line
> numbering to the current View Source back end?)

Sure. You can see in the way it's used in Scratchpad that there are always line numbers displayed and there's SourceEditor.setCaretPosition(line, column) that highlights the selected line (but do note bug 717219).

CC-ing Mihai who's the expert on SourceEditor.
(In reply to Henri Sivonen (:hsivonen) from comment #5)
> If SourceEditor/Orion can highlight a line by line number, I expect it to
> work for JS/CSS.

That is correct. SourceEditor/Orion can highlight a line by line number and it can work with JS and CSS for View Source.

> Does SourceEditor support showing line numbers?

Yes. See Scratchpad.

> Could it be used for plain text, too? (In order to avoid having to add support for plain
> text line numbering to the current View Source back end?)

Yes. SourceEditor can be used for plain text as well.
Priority: -- → P3
Priority: P3 → P4
Sounds related to being able to set breakpoints from itchpad when itchpad eventually lands.
Component: Developer Tools: Debugger → Developer Tools: User Stories
Component: Developer Tools: User Stories → Developer Tools: Debugger
Product: Firefox → DevTools
Type: defect → enhancement
Priority: P4 → P5

@Harald, I can't imagine us ever doing this, can we just close it?

Flags: needinfo?(hkirschner)

Let's close it for now until we have a better idea for the future of View Source.

Flags: needinfo?(hkirschner)
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.