index.rst (3395B)
1 ================ 2 Ignoring sources 3 ================ 4 5 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. 6 7 What happens when source(s) or line(s) are ignored: 8 9 - Any breakpoints defined are disabled and are not hit on execution. 10 - 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. 11 - The debugger skips through ignored sources when stepping. 12 - Any ``debugger`` statements are skipped when stepping. 13 - Any frames related to the source/line/lines won't be visible in the call stack. 14 15 Ignore a source 16 **************** 17 18 To enable or disable ignoring a source file: 19 20 21 - In the :ref:`source list pane <debugger-ui-tour-source-list-pane>`, right-click the filename and choose **Ignore source** (or **Unignore source**). 22 - 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. 23 24 .. image:: ignore-source.png 25 :alt: Screenshot showing the context menu item to ignore a source file, and highlighting the "ignore" icon. 26 :width: 1150px 27 :class: border 28 29 30 Ignore a single line 31 ********************** 32 33 To ignore a single line in a source file: 34 35 - 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**) 36 - Also right-click on the gutter at the specific line and choose **Ignore line** (or **Unignore line**) 37 38 .. image:: ignore-line.png 39 :alt: Screenshot showing the context menu item to ignore a single line in source file. 40 :width: 1150px 41 :class: border 42 43 44 Ignore multiple lines 45 *********************** 46 47 To ignore multiple lines in a source file: 48 49 - 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**) 50 51 .. image:: ignore-lines.png 52 :alt: Screenshot showing the context menu item to ignore a selection of lines in a source file. 53 :width: 1150px 54 :class: border 55 56 57 Ignore third-party scripts 58 **************************** 59 60 Frameworks and bundlers can define third-party scripts which should be ignored, using the `x_google_ignoreList <https://developer.chrome.com/articles/x-google-ignore-list/>`_ sourcemap extension. 61 The debugger parses and reads this field from the sourcemap to automatically ignore these sources. 62 63 To ignore third-party scripts: 64 65 - Click the debugger settings menu and choose **Ignore Known Third-party Scripts** 66 67 .. image:: ignore-third-party-sources.png 68 :alt: Screenshot showing the settings menu item to ignore third party sources off the sourcemaps x_google_ignoreList field. 69 :width: 1150px 70 :class: border