Skip to content

Commit

Permalink
Bug 1834452 - [devtools] Add documentation for ignore lines r=devtool…
Browse files Browse the repository at this point in the history
…s-reviewers,ochameau

- Rename the general section to `ignoring sources`
- Update the image for the ignore a source section
- Added content and images for ignore line and ignore lines

Differential Revision: https://phabricator.services.mozilla.com/D179316
  • Loading branch information
bomsy committed Jun 1, 2023
1 parent 5ce2f13 commit 525a0cb
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 24 deletions.
Binary file not shown.
22 changes: 0 additions & 22 deletions devtools/docs/user/debugger/how_to/ignore_a_source/index.rst

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions devtools/docs/user/debugger/how_to/ignoring_sources/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
================
Ignoring sources
================

In modern web development, we often rely on libraries like `jQuery <https://jquery.com/>`_, `Ember <https://emberjs.com/>`_, or `Angular <https://angularjs.org/>`_, and 99% of the time we can safely assume that they “just work”. We don’t care about the internal implementation of these libraries. However, a library’s abstraction leaks during debugging sessions when you are forced to step through its stack frames in order to reach your own code. However, you can tell the debugger to ignore the details of selected sources.

What happens when source(s) or line(s) are ignored:

- Any breakpoints defined are disabled and are not hit on execution.
- When “Pause on Exceptions” is enabled in the :ref:`Debugger settings <settings-debugger>`, the debugger won’t pause when an exception is thrown in the ignored source; instead it waits until (and if) the stack unwinds to a frame in a source that isn’t ignored.
- The debugger skips through ignored sources when stepping.
- Any ``debugger`` statements are skipped when stepping.
- Any frames related to the source/line/lines won't be visible in the call stack.

Ignore a source
****************

To enable or disable ignoring a source file:


- In the :ref:`source list pane <debugger-ui-tour-source-list-pane>`, right-click the filename and choose **Ignore source** (or **Unignore source**).
- If the source file is displayed in the :ref:`source pane <debugger_ui_tour_source_pane>`, click the "crossed out source" icon at the bottom.

.. image:: ignore-source.png
:alt: Screenshot showing the context menu item to ignore a source file, and highlighting the "ignore" icon.
:width: 1150px
:class: border


Ignore a single line
**********************

To ignore a single line in a source file:

- When the source file is displayed in the :ref:`source pane <debugger_ui_tour_source_pane>`, right-click the content on the specific line and choose **Ignore line** (or **Unignore line**)
- Also right-click on the gutter at the specific line and choose **Ignore line** (or **Unignore line**)

.. image:: ignore-line.png
:alt: Screenshot showing the context menu item to ignore a single line in source file.
:width: 1150px
:class: border


Ignore multiple lines
***********************

To ignore multiple lines in a source file:

- When the source file is displayed in the :ref:`source pane <debugger_ui_tour_source_pane>`, select the specific lines, then right-click on the selection and choose **Ignore lines** (or **Unignore lines**)

.. image:: ignore-lines.png
:alt: Screenshot showing the context menu item to ignore a selection of lines in a source file.
:width: 1150px
:class: border
2 changes: 1 addition & 1 deletion devtools/docs/user/debugger/how_to/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ These articles describe how to use the debugger.
- :doc:`Debug eval sources <debug_eval_sources/index>`
- :doc:`Disable breakpoints <disable_breakpoints/index>`
- :doc:`Highlight and inspect DOM nodes <highlight_and_inspect_dom_nodes/index>`
- :doc:`Ignore a source <ignore_a_source/index>`
- :doc:`Ignoring sources <ignoring_sources/index>`
- :doc:`Open the debugger <open_the_debugger/index>`
- :doc:`Pretty-print a minified file <pretty-print_a_minified_file/index>`
- :doc:`Search <search/index>`
Expand Down
2 changes: 1 addition & 1 deletion devtools/docs/user/debugger/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Control execution
What can you do after execution pauses?

- :doc:`Step through code <how_to/step_through_code/index>`
- :doc:`Black box a source <how_to/ignore_a_source/index>`
- :doc:`Ignoring sources <how_to/ignoring_sources/index>`
- `Debug worker threads <https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers#debugging_worker_threads>`_
- :doc:`Debug eval sources <how_to/debug_eval_sources/index>`

Expand Down

0 comments on commit 525a0cb

Please sign in to comment.