chrome-devtools-frontend 1.0.945884 → 1.0.948295

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. package/.eslintrc.js +1 -0
  2. package/config/gni/all_devtools_files.gni +1 -20
  3. package/config/gni/devtools_grd_files.gni +9 -48
  4. package/config/gni/devtools_image_files.gni +1 -0
  5. package/front_end/.eslintrc.js +6 -1
  6. package/front_end/Images/src/circled_backslash_icon.svg +3 -0
  7. package/front_end/core/host/InspectorFrontendHost.ts +0 -3
  8. package/front_end/core/host/InspectorFrontendHostAPI.ts +0 -1
  9. package/front_end/core/host/UserMetrics.ts +1 -23
  10. package/front_end/core/i18n/locales/en-US.json +41 -41
  11. package/front_end/core/i18n/locales/en-XL.json +41 -41
  12. package/front_end/core/platform/platform.ts +0 -2
  13. package/front_end/core/platform/string-utilities.ts +14 -1
  14. package/front_end/core/platform/utilities.ts +0 -29
  15. package/front_end/core/root/Runtime.ts +4 -212
  16. package/front_end/core/sdk/AccessibilityModel.ts +0 -2
  17. package/front_end/core/sdk/CSSProperty.ts +16 -11
  18. package/front_end/core/sdk/CSSRule.ts +0 -2
  19. package/front_end/core/sdk/Cookie.ts +0 -25
  20. package/front_end/core/sdk/EmulationModel.ts +0 -2
  21. package/front_end/core/sdk/HeapProfilerModel.ts +0 -2
  22. package/front_end/core/sdk/NetworkManager.ts +0 -3
  23. package/front_end/core/sdk/Resource.ts +0 -3
  24. package/front_end/core/sdk/ResourceTreeModel.ts +0 -3
  25. package/front_end/core/sdk/ServiceWorkerManager.ts +0 -2
  26. package/front_end/core/sdk/sdk-legacy.ts +0 -3
  27. package/front_end/devtools_compatibility.js +1 -8
  28. package/front_end/entrypoints/devtools_app/{devtools_app-meta-files.ts → devtools_app.ts} +9 -2
  29. package/front_end/entrypoints/formatter_worker/CSSFormatter.ts +1 -3
  30. package/front_end/entrypoints/formatter_worker/FormatterActions.ts +0 -2
  31. package/front_end/entrypoints/formatter_worker/FormatterWorker.ts +0 -120
  32. package/front_end/entrypoints/formatter_worker/formatter_worker-entrypoint.ts +1 -11
  33. package/front_end/entrypoints/formatter_worker/formatter_worker.ts +5 -0
  34. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +2 -1
  35. package/front_end/entrypoints/inspector/{inspector.js → inspector.ts} +0 -3
  36. package/front_end/entrypoints/js_app/{JsMain.ts → js_app.ts} +5 -1
  37. package/front_end/entrypoints/main/MainImpl.ts +0 -7
  38. package/front_end/entrypoints/ndb_app/{ndb_app.js → ndb_app.ts} +3 -2
  39. package/front_end/entrypoints/{node_main → node_app}/NodeConnectionsPanel.ts +1 -1
  40. package/front_end/entrypoints/{node_main → node_app}/NodeMain.ts +2 -4
  41. package/front_end/entrypoints/{node_main → node_app}/nodeConnectionsPanel.css +0 -0
  42. package/front_end/entrypoints/node_app/node_app.ts +79 -0
  43. package/front_end/entrypoints/shell/{shell-meta-files.ts → shell.ts} +7 -1
  44. package/front_end/entrypoints/worker_app/{worker_app.js → worker_app.ts} +6 -2
  45. package/front_end/generated/InspectorBackendCommands.js +5 -1
  46. package/front_end/generated/protocol.d.ts +12 -0
  47. package/front_end/legacy/legacy-defs.d.ts +0 -4
  48. package/front_end/legacy_test_runner/sources_test_runner/sources_test_runner.js +0 -1
  49. package/front_end/legacy_test_runner/test_runner/TestRunner.js +35 -59
  50. package/front_end/models/bindings/CompilerScriptMapping.ts +0 -1
  51. package/front_end/models/bindings/DebuggerLanguagePlugins.ts +4 -11
  52. package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +1 -1
  53. package/front_end/models/bindings/ResourceMapping.ts +1 -1
  54. package/front_end/models/bindings/SASSSourceMapping.ts +0 -1
  55. package/front_end/models/emulation/DeviceModeModel.ts +0 -2
  56. package/front_end/models/formatter/FormatterWorkerPool.ts +0 -18
  57. package/front_end/models/issues_manager/CorsIssue.ts +17 -9
  58. package/front_end/models/issues_manager/descriptions/{corsInsecurePrivateNetworkPreflight.md → corsPreflightAllowPrivateNetworkError.md} +1 -1
  59. package/front_end/models/text_utils/CodeMirrorUtils.ts +6 -51
  60. package/front_end/models/text_utils/TextUtils.ts +1 -2
  61. package/front_end/models/text_utils/text_utils-legacy.ts +0 -5
  62. package/front_end/panels/accessibility/AccessibilitySidebarView.ts +3 -1
  63. package/front_end/panels/animation/AnimationTimeline.ts +0 -2
  64. package/front_end/panels/animation/AnimationUI.ts +0 -2
  65. package/front_end/panels/application/ApplicationPanelSidebar.ts +2 -4
  66. package/front_end/panels/application/BackForwardCacheStrings.ts +2 -5
  67. package/front_end/panels/application/BackForwardCacheView.ts +150 -58
  68. package/front_end/panels/application/ResourcesPanel.ts +0 -42
  69. package/front_end/panels/application/application-legacy.ts +0 -3
  70. package/front_end/panels/application/application-meta.ts +0 -13
  71. package/front_end/panels/application/backForwardCacheView.css +44 -6
  72. package/front_end/panels/application/components/FrameDetailsView.ts +3 -3
  73. package/front_end/panels/application/components/OriginTrialTreeView.ts +3 -3
  74. package/front_end/panels/application/components/StackTrace.ts +1 -1
  75. package/front_end/panels/coverage/CoverageView.ts +1 -1
  76. package/front_end/panels/css_overview/CSSOverviewModel.ts +0 -2
  77. package/front_end/panels/css_overview/CSSOverviewPanel.ts +0 -7
  78. package/front_end/panels/css_overview/CSSOverviewProcessingView.ts +0 -2
  79. package/front_end/panels/css_overview/components/cssOverviewStartView.css +1 -0
  80. package/front_end/panels/css_overview/cssOverviewCompletedView.css +1 -1
  81. package/front_end/panels/developer_resources/DeveloperResourcesView.ts +2 -1
  82. package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +0 -11
  83. package/front_end/panels/elements/ElementsPanel.ts +9 -1
  84. package/front_end/panels/elements/ElementsTreeElement.ts +1 -1
  85. package/front_end/panels/elements/StylesSidebarPane.ts +0 -1
  86. package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +1 -1
  87. package/front_end/panels/elements/elementsTreeOutline.css +0 -13
  88. package/front_end/panels/emulation/DeviceModeToolbar.ts +0 -16
  89. package/front_end/panels/issues/CorsIssueDetailsView.ts +18 -2
  90. package/front_end/panels/lighthouse/lighthouse-meta.ts +0 -3
  91. package/front_end/panels/network/NetworkConfigView.ts +10 -0
  92. package/front_end/panels/network/NetworkItemView.ts +3 -0
  93. package/front_end/panels/network/NetworkWaterfallColumn.ts +2 -0
  94. package/front_end/panels/network/networkConfigView.css +5 -0
  95. package/front_end/panels/profiler/CPUProfileFlameChart.ts +3 -1
  96. package/front_end/panels/profiler/ProfileDataGrid.ts +2 -1
  97. package/front_end/panels/profiler/profilesPanel.css +1 -1
  98. package/front_end/panels/search/SearchView.ts +24 -4
  99. package/front_end/panels/settings/components/SyncSection.ts +2 -2
  100. package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +52 -50
  101. package/front_end/panels/settings/emulation/components/userAgentClientHintsForm.css +0 -12
  102. package/front_end/panels/sources/CSSPlugin.ts +3 -0
  103. package/front_end/panels/sources/CoveragePlugin.ts +2 -0
  104. package/front_end/panels/sources/DebuggerPlugin.ts +35 -7
  105. package/front_end/panels/sources/JavaScriptCompilerPlugin.ts +3 -0
  106. package/front_end/panels/sources/ProfilePlugin.ts +3 -0
  107. package/front_end/panels/sources/UISourceCodeFrame.ts +11 -2
  108. package/front_end/panels/sources/sourcesView.css +0 -130
  109. package/front_end/panels/timeline/TimelineTreeView.ts +3 -1
  110. package/front_end/third_party/codemirror/codemirror-tsconfig.json +1 -25
  111. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
  112. package/front_end/third_party/codemirror.next/chunk/cpp.js +1 -2
  113. package/front_end/third_party/codemirror.next/chunk/java.js +1 -2
  114. package/front_end/third_party/codemirror.next/chunk/json.js +1 -2
  115. package/front_end/third_party/codemirror.next/chunk/markdown.js +1 -2
  116. package/front_end/third_party/codemirror.next/chunk/php.js +1 -2
  117. package/front_end/third_party/codemirror.next/chunk/python.js +1 -2
  118. package/front_end/third_party/codemirror.next/chunk/wast.js +1 -2
  119. package/front_end/third_party/codemirror.next/chunk/xml.js +1 -2
  120. package/front_end/third_party/codemirror.next/codemirror.next.d.ts +1486 -1423
  121. package/front_end/third_party/codemirror.next/codemirror.next.js +1 -2
  122. package/front_end/third_party/codemirror.next/package.json +10 -9
  123. package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +168 -164
  124. package/front_end/third_party/lighthouse/locales/ar-XB.json +0 -3
  125. package/front_end/third_party/lighthouse/locales/ar.json +0 -3
  126. package/front_end/third_party/lighthouse/locales/bg.json +17 -20
  127. package/front_end/third_party/lighthouse/locales/ca.json +0 -3
  128. package/front_end/third_party/lighthouse/locales/cs.json +0 -3
  129. package/front_end/third_party/lighthouse/locales/da.json +16 -19
  130. package/front_end/third_party/lighthouse/locales/de.json +0 -3
  131. package/front_end/third_party/lighthouse/locales/el.json +0 -3
  132. package/front_end/third_party/lighthouse/locales/en-GB.json +19 -22
  133. package/front_end/third_party/lighthouse/locales/en-US.json +33 -3
  134. package/front_end/third_party/lighthouse/locales/en-XA.json +0 -3
  135. package/front_end/third_party/lighthouse/locales/en-XL.json +33 -3
  136. package/front_end/third_party/lighthouse/locales/es-419.json +17 -20
  137. package/front_end/third_party/lighthouse/locales/es.json +0 -3
  138. package/front_end/third_party/lighthouse/locales/fi.json +16 -19
  139. package/front_end/third_party/lighthouse/locales/fil.json +33 -36
  140. package/front_end/third_party/lighthouse/locales/fr.json +16 -19
  141. package/front_end/third_party/lighthouse/locales/he.json +16 -19
  142. package/front_end/third_party/lighthouse/locales/hi.json +0 -3
  143. package/front_end/third_party/lighthouse/locales/hr.json +16 -19
  144. package/front_end/third_party/lighthouse/locales/hu.json +16 -19
  145. package/front_end/third_party/lighthouse/locales/id.json +16 -19
  146. package/front_end/third_party/lighthouse/locales/it.json +37 -40
  147. package/front_end/third_party/lighthouse/locales/ja.json +16 -19
  148. package/front_end/third_party/lighthouse/locales/ko.json +16 -19
  149. package/front_end/third_party/lighthouse/locales/lt.json +17 -20
  150. package/front_end/third_party/lighthouse/locales/lv.json +0 -3
  151. package/front_end/third_party/lighthouse/locales/nl.json +16 -19
  152. package/front_end/third_party/lighthouse/locales/no.json +17 -20
  153. package/front_end/third_party/lighthouse/locales/pl.json +16 -19
  154. package/front_end/third_party/lighthouse/locales/pt-PT.json +37 -40
  155. package/front_end/third_party/lighthouse/locales/pt.json +16 -19
  156. package/front_end/third_party/lighthouse/locales/ro.json +0 -3
  157. package/front_end/third_party/lighthouse/locales/ru.json +16 -19
  158. package/front_end/third_party/lighthouse/locales/sk.json +0 -3
  159. package/front_end/third_party/lighthouse/locales/sl.json +0 -3
  160. package/front_end/third_party/lighthouse/locales/sr-Latn.json +16 -19
  161. package/front_end/third_party/lighthouse/locales/sr.json +16 -19
  162. package/front_end/third_party/lighthouse/locales/sv.json +17 -20
  163. package/front_end/third_party/lighthouse/locales/ta.json +0 -3
  164. package/front_end/third_party/lighthouse/locales/te.json +0 -3
  165. package/front_end/third_party/lighthouse/locales/th.json +0 -3
  166. package/front_end/third_party/lighthouse/locales/tr.json +0 -3
  167. package/front_end/third_party/lighthouse/locales/uk.json +17 -20
  168. package/front_end/third_party/lighthouse/locales/vi.json +0 -3
  169. package/front_end/third_party/lighthouse/locales/zh-HK.json +0 -3
  170. package/front_end/third_party/lighthouse/locales/zh-TW.json +0 -3
  171. package/front_end/third_party/lighthouse/locales/zh.json +0 -3
  172. package/front_end/third_party/lighthouse/report/bundle.d.ts +63 -61
  173. package/front_end/third_party/lighthouse/report/bundle.js +36 -7
  174. package/front_end/third_party/lighthouse/report-assets/report-generator.js +205 -192
  175. package/front_end/ui/components/diff_view/DiffView.ts +4 -4
  176. package/front_end/ui/components/helpers/component-server-setup.ts +1 -12
  177. package/front_end/ui/components/helpers/helpers.ts +0 -2
  178. package/front_end/ui/components/icon_button/IconButton.ts +1 -1
  179. package/front_end/ui/components/issue_counter/IssueCounter.ts +2 -2
  180. package/front_end/ui/components/linear_memory_inspector/LinearMemoryViewer.ts +3 -3
  181. package/front_end/ui/components/markdown_view/MarkdownView.ts +4 -4
  182. package/front_end/ui/components/panel_feedback/PreviewToggle.ts +98 -0
  183. package/front_end/ui/components/panel_feedback/panel_feedback.ts +1 -0
  184. package/front_end/ui/components/panel_feedback/previewToggle.css +24 -0
  185. package/front_end/ui/components/report_view/ReportView.ts +22 -0
  186. package/front_end/ui/components/report_view/reportSection.css +20 -0
  187. package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +1 -1
  188. package/front_end/ui/components/settings/SettingCheckbox.ts +2 -2
  189. package/front_end/ui/components/text_editor/config.ts +11 -9
  190. package/front_end/ui/components/text_editor/javascript.ts +34 -12
  191. package/front_end/ui/components/text_editor/theme.ts +1 -0
  192. package/front_end/ui/components/text_prompt/TextPrompt.ts +2 -2
  193. package/front_end/ui/legacy/GlassPane.ts +1 -1
  194. package/front_end/ui/legacy/InspectorView.ts +10 -0
  195. package/front_end/ui/legacy/SearchableView.ts +2 -1
  196. package/front_end/ui/legacy/Treeoutline.ts +1 -1
  197. package/front_end/ui/legacy/Widget.ts +1 -1
  198. package/front_end/ui/legacy/XWidget.ts +0 -5
  199. package/front_end/ui/legacy/components/inline_editor/CSSVarSwatch.ts +2 -2
  200. package/front_end/ui/legacy/components/inline_editor/ColorSwatch.ts +1 -1
  201. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +2 -3
  202. package/front_end/ui/legacy/components/object_ui/objectPropertiesSection.css +0 -1
  203. package/front_end/ui/legacy/components/object_ui/object_ui-legacy.ts +0 -8
  204. package/front_end/ui/legacy/components/object_ui/object_ui.ts +0 -4
  205. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +40 -29
  206. package/front_end/ui/legacy/inspectorSyntaxHighlight.css +0 -211
  207. package/front_end/ui/legacy/legacy-legacy.ts +0 -6
  208. package/front_end/ui/legacy/legacy.ts +0 -2
  209. package/front_end/ui/legacy/tabbedPane.css +1 -1
  210. package/front_end/ui/legacy/themeColors.css +1 -1
  211. package/front_end/ui/legacy/utils/append-style.ts +2 -13
  212. package/front_end/ui/legacy/utils/create-shadow-root-with-core-styles.ts +7 -5
  213. package/package.json +2 -4
  214. package/scripts/build/build_inspector_overlay.py +15 -1
  215. package/scripts/build/rjsmin.py +84 -115
  216. package/scripts/eslint_rules/lib/l10n_filename_matches.js +4 -4
  217. package/scripts/eslint_rules/lib/lit_html_no_attribute_quotes.js +101 -0
  218. package/scripts/eslint_rules/lib/no_only_eslint_tests.js +53 -0
  219. package/scripts/eslint_rules/tests/.eslintrc.js +14 -0
  220. package/scripts/eslint_rules/tests/l10n_filename_matches_test.js +4 -0
  221. package/scripts/eslint_rules/tests/lit_html_no_attribute_quotes_test.js +45 -0
  222. package/scripts/eslint_rules/tests/no_only_eslint_tests_test.js +94 -0
  223. package/scripts/hosted_mode/server.js +17 -2
  224. package/front_end/entrypoints/devtools_app/devtools_app.js +0 -8
  225. package/front_end/entrypoints/devtools_app/devtools_app.json +0 -6
  226. package/front_end/entrypoints/inspector/inspector.json +0 -4
  227. package/front_end/entrypoints/js_app/js_app.js +0 -9
  228. package/front_end/entrypoints/js_app/js_app.json +0 -4
  229. package/front_end/entrypoints/ndb_app/ndb_app.json +0 -5
  230. package/front_end/entrypoints/node_app/node_app-meta.ts +0 -43
  231. package/front_end/entrypoints/node_app/node_app.js +0 -13
  232. package/front_end/entrypoints/node_app/node_app.json +0 -4
  233. package/front_end/entrypoints/node_main/node_main-meta.ts +0 -48
  234. package/front_end/entrypoints/node_main/node_main.ts +0 -11
  235. package/front_end/entrypoints/shell/shell.js +0 -13
  236. package/front_end/entrypoints/shell/shell.json +0 -5
  237. package/front_end/entrypoints/startup/RuntimeInstantiator.ts +0 -95
  238. package/front_end/entrypoints/startup/startup.ts +0 -9
  239. package/front_end/entrypoints/worker_app/worker_app.json +0 -4
  240. package/front_end/panels/lighthouse/module.json +0 -6
  241. package/front_end/third_party/lighthouse/report-assets/report.d.ts +0 -1
  242. package/front_end/third_party/lighthouse/report-assets/report.js +0 -233
  243. package/front_end/third_party/lighthouse/report-assets/standalone-template.html +0 -38
  244. package/front_end/ui/components/helpers/get-stylesheet.ts +0 -45
  245. package/front_end/ui/legacy/TextEditor.ts +0 -82
  246. package/front_end/ui/legacy/components/object_ui/JavaScriptAutocomplete.ts +0 -836
  247. package/front_end/ui/legacy/components/text_editor/CodeMirrorTextEditor.ts +0 -1676
  248. package/front_end/ui/legacy/components/text_editor/TextEditorAutocompleteController.ts +0 -586
  249. package/front_end/ui/legacy/components/text_editor/autocompleteTooltip.css +0 -20
  250. package/front_end/ui/legacy/components/text_editor/cm_modes.ts +0 -23
  251. package/front_end/ui/legacy/components/text_editor/cmdevtools.css +0 -995
  252. package/front_end/ui/legacy/components/text_editor/module.json +0 -7
  253. package/front_end/ui/legacy/components/text_editor/text_editor-legacy.ts +0 -33
  254. package/front_end/ui/legacy/components/text_editor/text_editor.ts +0 -13
  255. package/scripts/build/build_release_applications.py +0 -216
  256. package/scripts/build/modular_build.py +0 -184
  257. package/scripts/check_gn.js +0 -119
  258. package/scripts/json_validator/module.schema.json +0 -19
  259. package/scripts/json_validator/validate_module_json.js +0 -44
@@ -13,6 +13,9 @@ import * as UI from '../../ui/legacy/legacy.js';
13
13
 
14
14
  import {Plugin} from './Plugin.js';
15
15
 
16
+ // Plugin to add CSS completion, shortcuts, and color/curve swatches
17
+ // to editors with CSS content.
18
+
16
19
  const UIStrings = {
17
20
  /**
18
21
  *@description Swatch icon element title in CSSPlugin of the Sources panel
@@ -14,6 +14,8 @@ import * as Coverage from '../coverage/coverage.js';
14
14
 
15
15
  import {Plugin} from './Plugin.js';
16
16
 
17
+ // Plugin that shows a gutter with coverage information when available.
18
+
17
19
  const UIStrings = {
18
20
  /**
19
21
  *@description Text for Coverage Status Bar Item in Sources Panel
@@ -158,24 +158,37 @@ type BreakpointDescription = {
158
158
 
159
159
  export class DebuggerPlugin extends Plugin {
160
160
  private editor: TextEditor.TextEditor.TextEditor|undefined = undefined;
161
+ // Set if the debugger is stopped on a breakpoint in this file
161
162
  private executionLocation: Workspace.UISourceCode.UILocation|null = null;
163
+ // Track state of the control key because holding it makes debugger
164
+ // target locations show up in the editor
162
165
  private controlDown: boolean = false;
163
- private sourceMapInfobar: UI.Infobar.Infobar|null = null;
164
166
  private controlTimeout: number|undefined = undefined;
167
+ private sourceMapInfobar: UI.Infobar.Infobar|null = null;
165
168
  private readonly scriptsPanel: SourcesPanel;
166
169
  private readonly breakpointManager: Bindings.BreakpointManager.BreakpointManager;
170
+ // Manages pop-overs shown when the debugger is active and the user
171
+ // hovers over an expression
167
172
  private readonly popoverHelper: UI.PopoverHelper.PopoverHelper;
168
173
  private scriptFileForDebuggerModel:
169
174
  Map<SDK.DebuggerModel.DebuggerModel, Bindings.ResourceScriptMapping.ResourceScriptFile>;
170
175
  // The current set of breakpoints for this file. The locations in
171
- // here are only in sync with editor positions when `this.muted` is
172
- // false.
176
+ // here are kept in sync with their editor position. When a file's
177
+ // content is edited and later saved, these are used as a source of
178
+ // truth for re-creating the breakpoints.
173
179
  private breakpoints: BreakpointDescription[] = [];
174
180
  // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration)
175
181
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
176
182
  private continueToLocations: {from: number, to: number, async: boolean, click: () => void}[]|null = null;
177
183
  private readonly liveLocationPool: Bindings.LiveLocation.LiveLocationPool;
184
+ // When the editor content is changed by the user, this becomes
185
+ // true. When the plugin is muted, breakpoints show up as disabled
186
+ // and can't be manipulated. It is cleared again when the content is
187
+ // saved.
178
188
  private muted: boolean;
189
+ // If the plugin is initialized in muted state, we cannot correlated
190
+ // breakpoint position in the breakpoint manager with editor
191
+ // locations, so breakpoint manipulation is permanently disabled.
179
192
  private initializedMuted: boolean;
180
193
  private ignoreListInfobar: UI.Infobar.Infobar|null;
181
194
  private prettyPrintInfobar!: UI.Infobar.Infobar|null;
@@ -236,6 +249,8 @@ export class DebuggerPlugin extends Plugin {
236
249
  }
237
250
 
238
251
  editorExtension(): CodeMirror.Extension {
252
+ // Kludge to hook editor keyboard events into the ShortcutRegistry
253
+ // system.
239
254
  const handlers = this.shortcutHandlers();
240
255
 
241
256
  return [
@@ -309,6 +324,8 @@ export class DebuggerPlugin extends Plugin {
309
324
  }
310
325
 
311
326
  editorInitialized(editor: TextEditor.TextEditor.TextEditor): void {
327
+ // Start asynchronous actions that require access to the editor
328
+ // instance
312
329
  this.editor = editor;
313
330
  computeNonBreakableLines(editor.state, this.uiSourceCode).then(linePositions => {
314
331
  if (linePositions.length) {
@@ -589,8 +606,12 @@ export class DebuggerPlugin extends Plugin {
589
606
  if (node.firstChild) {
590
607
  return null;
591
608
  }
592
- while (node && node.name !== 'VariableDefinition' && node.name !== 'VariableName' &&
593
- node.name !== 'MemberExpression') {
609
+ while (
610
+ node && node.name !== 'VariableDefinition' && node.name !== 'VariableName' &&
611
+ node.name !== 'MemberExpression' &&
612
+ !(node.name === 'PropertyName' && node.parent?.name === 'PatternProperty' &&
613
+ node.nextSibling?.name !== ':') &&
614
+ !(node.name === 'PropertyDefinition' && node.parent?.name === 'Property' && node.nextSibling?.name !== ':')) {
594
615
  node = node.parent;
595
616
  }
596
617
  if (!node) {
@@ -681,6 +702,8 @@ export class DebuggerPlugin extends Plugin {
681
702
 
682
703
  private onEditorUpdate(update: CodeMirror.ViewUpdate): void {
683
704
  if (!update.changes.empty) {
705
+ // If the document changed, adjust known breakpoint positions
706
+ // for that change
684
707
  for (const breakpointDesc of this.breakpoints) {
685
708
  breakpointDesc.position = update.changes.mapPos(breakpointDesc.position);
686
709
  }
@@ -807,6 +830,7 @@ export class DebuggerPlugin extends Plugin {
807
830
  dialog.focusEditor();
808
831
  }
809
832
 
833
+ // Create decorations to indicate the current debugging position
810
834
  private computeExecutionDecorations(editorState: CodeMirror.EditorState, lineNumber: number, columnNumber: number):
811
835
  CodeMirror.DecorationSet {
812
836
  const {doc} = editorState;
@@ -953,6 +977,8 @@ export class DebuggerPlugin extends Plugin {
953
977
  return namesPerLine;
954
978
  }
955
979
 
980
+ // Highlight the locations the debugger can continue to (when
981
+ // Control is held)
956
982
  private async showContinueToLocations(): Promise<void> {
957
983
  this.popoverHelper.hidePopover();
958
984
  const executionContext = UI.Context.Context.instance().flavor(SDK.RuntimeModel.ExecutionContext);
@@ -1094,6 +1120,8 @@ export class DebuggerPlugin extends Plugin {
1094
1120
  return this.breakpoints.filter(b => b.position >= line.from && b.position <= line.to).map(b => b.breakpoint);
1095
1121
  }
1096
1122
 
1123
+ // Compute the decorations for existing breakpoints (both on the
1124
+ // gutter and inline in the code)
1097
1125
  private async computeBreakpointDecoration(state: CodeMirror.EditorState, breakpoints: BreakpointDescription[]):
1098
1126
  Promise<BreakpointDecoration> {
1099
1127
  const decorations: CodeMirror.Range<CodeMirror.Decoration>[] = [];
@@ -1298,7 +1326,7 @@ export class DebuggerPlugin extends Plugin {
1298
1326
  Bindings.ResourceScriptMapping.ResourceScriptFile.Events.DidMergeToVM, this.didMergeToVM, this);
1299
1327
  oldScriptFile.removeEventListener(
1300
1328
  Bindings.ResourceScriptMapping.ResourceScriptFile.Events.DidDivergeFromVM, this.didDivergeFromVM, this);
1301
- if (this.muted && !this.uiSourceCode.isDirty() && this.consistentScripts) {
1329
+ if (this.muted && !this.uiSourceCode.isDirty() && this.consistentScripts()) {
1302
1330
  this.setMuted(false);
1303
1331
  }
1304
1332
  }
@@ -1516,7 +1544,7 @@ export class DebuggerPlugin extends Plugin {
1516
1544
  }
1517
1545
  }
1518
1546
 
1519
- // Infobar panel state
1547
+ // Infobar panel state, used to show additional panels below the editor.
1520
1548
 
1521
1549
  const addInfobar = CodeMirror.StateEffect.define<UI.Infobar.Infobar>();
1522
1550
  const removeInfobar = CodeMirror.StateEffect.define<UI.Infobar.Infobar>();
@@ -12,6 +12,9 @@ import * as Snippets from '../snippets/snippets.js';
12
12
 
13
13
  import {Plugin} from './Plugin.js';
14
14
 
15
+ // Plugin that tries to compile the editor content and highlights
16
+ // compilation errors.
17
+
15
18
  export class JavaScriptCompilerPlugin extends Plugin {
16
19
  private compiling: boolean = false;
17
20
  private recompileScheduled: boolean = false;
@@ -11,6 +11,9 @@ import type * as TextEditor from '../../ui/components/text_editor/text_editor.js
11
11
 
12
12
  import {Plugin} from './Plugin.js';
13
13
 
14
+ // Defines plugins that show profiling information in the editor
15
+ // gutter when available.
16
+
14
17
  const UIStrings = {
15
18
  /**
16
19
  *@description The milisecond unit
@@ -52,7 +52,8 @@ import {SnippetsPlugin} from './SnippetsPlugin.js';
52
52
  import {SourcesPanel} from './SourcesPanel.js';
53
53
 
54
54
  function sourceFramePlugins(): (typeof Plugin)[] {
55
- // The order of these plugins matters for toolbar items
55
+ // The order of these plugins matters for toolbar items and editor
56
+ // extension precedence
56
57
  return [
57
58
  CSSPlugin,
58
59
  DebuggerPlugin,
@@ -74,6 +75,8 @@ export class UISourceCodeFrame extends
74
75
  private uiSourceCodeEventListeners: Common.EventTarget.EventDescriptor[];
75
76
  private messageAndDecorationListeners: Common.EventTarget.EventDescriptor[];
76
77
  private readonly boundOnBindingChanged: () => void;
78
+ // The active plugins. These are created in setContent, and
79
+ // recreated when the binding changes
77
80
  private plugins: Plugin[] = [];
78
81
  private readonly errorPopoverHelper: UI.PopoverHelper.PopoverHelper;
79
82
 
@@ -114,6 +117,7 @@ export class UISourceCodeFrame extends
114
117
  return [
115
118
  super.editorConfiguration(doc),
116
119
  rowMessages([...this.allMessages()]),
120
+ // Inject editor extensions from plugins
117
121
  pluginCompartment.of(this.plugins.map(plugin => plugin.editorExtension())),
118
122
  ];
119
123
  }
@@ -547,7 +551,11 @@ export type EventTypes = {
547
551
 
548
552
  const pluginCompartment = new CodeMirror.Compartment();
549
553
 
550
- // Row message management and display logic
554
+ // Row message management and display logic. The frame manages a
555
+ // collection of messages, organized by line (row), as a wavy
556
+ // underline starting at the start of the first message, up to the end
557
+ // of the line, with icons indicating the message severity and content
558
+ // at the end of the line.
551
559
 
552
560
  function addMessage(rows: Workspace.UISourceCode.Message[][], message: Workspace.UISourceCode.Message):
553
561
  Workspace.UISourceCode.Message[][] {
@@ -608,6 +616,7 @@ const setRowMessages = CodeMirror.StateEffect.define<RowMessages>();
608
616
 
609
617
  const underlineMark = CodeMirror.Decoration.mark({class: 'cm-waveUnderline'});
610
618
 
619
+ // The widget shown at the end of a message annotation.
611
620
  class MessageWidget extends CodeMirror.WidgetType {
612
621
  constructor(readonly messages: Workspace.UISourceCode.Message[]) {
613
622
  super();
@@ -58,133 +58,3 @@
58
58
  .-theme-with-dark-background .source-frame-debugger-script {
59
59
  --override-debugger-background-tint: rgb(61 61 0 / 50%);
60
60
  }
61
-
62
- @keyframes source-frame-value-update-highlight-animation {
63
- from {
64
- background-color: inherit;
65
- color: inherit;
66
- }
67
-
68
- 10% {
69
- background-color: var(--override-highlight-animation-10pc-background-color);
70
- color: var(--override-highlight-animation-10pc-foreground-color);
71
- }
72
-
73
- to {
74
- background-color: inherit;
75
- color: inherit;
76
- }
77
- }
78
-
79
- .source-frame-value-update-highlight {
80
- animation: source-frame-value-update-highlight-animation 0.8s 1 cubic-bezier(0, 0, 0.2, 1);
81
- border-radius: 2px;
82
- }
83
-
84
- .diff-entry-insert {
85
- --override-diff-line-number-background-color: hsl(144deg 55% 49% / 20%);
86
- }
87
-
88
- .-theme-with-dark-background .diff-entry-insert,
89
- :host-context(.-theme-with-dark-background) .diff-entry-insert {
90
- --override-diff-line-number-background-color: rgb(61 199 116 / 20%);
91
- }
92
-
93
- .diff-entry-insert .diff-marker {
94
- border-left: 4px solid var(--color-accent-green);
95
- }
96
-
97
- .diff-entry-insert .CodeMirror-gutter-background {
98
- background-color: var(--override-diff-line-number-background-color);
99
- }
100
-
101
- .diff-entry-modify {
102
- --override-diff-line-number-background-color: rgb(186 104 200 / 20%);
103
- --override-diff-line-number-border-color: #9c27b0;
104
- }
105
-
106
- .-theme-with-dark-background .diff-entry-modify,
107
- :host-context(.-theme-with-dark-background) .diff-entry-modify {
108
- --override-diff-line-number-background-color: rgb(137 55 151 / 20%);
109
- --override-diff-line-number-border-color: rgb(196 79 216);
110
- }
111
-
112
- .diff-entry-modify .diff-marker {
113
- border-left: 4px solid var(--override-diff-line-number-border-color);
114
- }
115
-
116
- .diff-entry-modify .CodeMirror-gutter-background {
117
- background-color: var(--override-diff-line-number-background-color);
118
- }
119
-
120
- .diff-entry-delete {
121
- --override-diff-deletion-color: #d32f2f;
122
- }
123
-
124
- .-theme-with-dark-background .diff-entry-delete,
125
- :host-context(.-theme-with-dark-background) .diff-entry-delete {
126
- --override-diff-deletion-color: rgb(208 44 44);
127
- }
128
-
129
- .diff-entry-delete .diff-marker {
130
- width: 0;
131
- height: 0;
132
- border-top: 6px solid transparent;
133
- border-bottom: 6px solid transparent;
134
- border-left: 6px solid var(--override-diff-deletion-color);
135
- position: relative;
136
- top: 6px;
137
- cursor: pointer;
138
- left: 0;
139
- }
140
-
141
- .diff-entry-delete .CodeMirror-gutter-background {
142
- border-bottom: 2px solid var(--override-diff-deletion-color);
143
- }
144
-
145
- .CodeMirror-gutter-diff {
146
- width: 4px;
147
- }
148
-
149
- .highlight-line-modification {
150
- --override-modification-background-fadeout-from: rgb(158 54 153 / 50%);
151
- --override-modification-background-fadeout-90pc: rgb(158 54 153 / 0%);
152
- --override-modification-foreground-fadeout-from: #fff;
153
-
154
- animation: source-line-modification-background-fadeout 0.4s 0s;
155
- animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
156
- }
157
-
158
- .highlight-line-modification span {
159
- animation: source-line-modification-foreground-fadeout 0.4s 0s;
160
- animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
161
- }
162
-
163
- @keyframes source-line-modification-background-fadeout {
164
- from {
165
- background-color: var(--override-modification-background-fadeout-from);
166
- }
167
-
168
- 50% {
169
- /* Purposefully uses the `from` color to delay the animation from 0-50% */
170
- background-color: var(--override-modification-background-fadeout-from);
171
- }
172
-
173
- 90% {
174
- background-color: var(--override-modification-background-fadeout-90pc);
175
- }
176
- to { background-color: transparent; }
177
- }
178
-
179
- @keyframes source-line-modification-foreground-fadeout {
180
- from {
181
- color: var(--override-modification-foreground-fadeout-from);
182
- }
183
-
184
- 50% {
185
- /* Purposefully uses the `from` color to delay the animation from 0-50% */
186
- color: var(--override-modification-foreground-fadeout-from);
187
- }
188
- 90% { color: initial; }
189
- to { color: initial; }
190
- }
@@ -284,7 +284,8 @@ export class TimelineTreeView extends UI.Widget.VBox implements UI.SearchableVie
284
284
  new UI.Toolbar.ToolbarInput(i18nString(UIStrings.filter), this.getToolbarInputAccessiblePlaceHolder());
285
285
  textFilterUI.addEventListener(UI.Toolbar.ToolbarInput.Event.TextChanged, () => {
286
286
  const searchQuery = textFilterUI.value();
287
- this.textFilterInternal.setRegExp(searchQuery ? createPlainTextSearchRegex(searchQuery, 'i') : null);
287
+ this.textFilterInternal.setRegExp(
288
+ searchQuery ? Platform.StringUtilities.createPlainTextSearchRegex(searchQuery, 'i') : null);
288
289
  this.refreshTree();
289
290
  }, this);
290
291
  this.textFilterUI = textFilterUI;
@@ -651,6 +652,7 @@ export class GridNode extends DataGrid.SortableDataGrid.SortableDataGridNode<Gri
651
652
  }
652
653
  const cell = this.createTD(columnId);
653
654
  cell.className = 'numeric-column';
655
+ cell.setAttribute('title', i18nString(UIStrings.fms, {PH1: value.toFixed(4)}));
654
656
  const textDiv = cell.createChild('div');
655
657
  textDiv.createChild('span').textContent = i18nString(UIStrings.fms, {PH1: value.toFixed(1)});
656
658
 
@@ -3,33 +3,9 @@
3
3
  "composite": true
4
4
  },
5
5
  "files": [
6
- "package/addon/comment/comment.js",
7
- "package/addon/edit/closebrackets.js",
8
- "package/addon/edit/matchbrackets.js",
9
- "package/addon/fold/brace-fold.js",
10
- "package/addon/fold/foldcode.js",
11
- "package/addon/fold/foldgutter.js",
12
- "package/addon/mode/multiplex.js",
13
- "package/addon/mode/overlay.js",
14
- "package/addon/mode/simple.js",
15
6
  "package/addon/runmode/runmode-standalone.js",
16
- "package/addon/selection/active-line.js",
17
- "package/addon/selection/mark-selection.js",
18
- "package/lib/codemirror.js",
19
- "package/mode/clike/clike.js",
20
- "package/mode/clojure/clojure.js",
21
- "package/mode/coffeescript/coffeescript.js",
22
7
  "package/mode/css/css.js",
23
- "package/mode/htmlembedded/htmlembedded.js",
24
- "package/mode/htmlmixed/htmlmixed.js",
25
8
  "package/mode/javascript/javascript.js",
26
- "package/mode/jsx/jsx.js",
27
- "package/mode/livescript/livescript.js",
28
- "package/mode/markdown/markdown.js",
29
- "package/mode/php/php.js",
30
- "package/mode/python/python.js",
31
- "package/mode/shell/shell.js",
32
- "package/mode/wast/wast.js",
33
9
  "package/mode/xml/xml.js"
34
10
  ]
35
- }
11
+ }