chrome-devtools-frontend 1.0.1669021 → 1.0.1672388
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.
- package/.agents/skills/fixing-skipped-tests/SKILL.md +6 -6
- package/.agents/skills/gerrit-cli/SKILL.md +4 -10
- package/.agents/skills/gerrit-cli/references/commands.md +45 -2
- package/.agents/skills/gerrit-cli/references/workflows.md +7 -0
- package/.agents/skills/gerrit-cli/scripts/import_upstream.py +34 -152
- package/config/typescript/tsconfig.eslint.json +1 -1
- package/docs/contributing/settings-experiments-features.md +2 -8
- package/docs/ecosystem/automatic_workspace_folders.md +0 -19
- package/eslint.config.mjs +2 -2
- package/front_end/core/common/Lazy.ts +3 -3
- package/front_end/core/common/SettingRegistration.ts +0 -7
- package/front_end/core/common/Settings.ts +0 -38
- package/front_end/core/host/UserMetrics.ts +187 -953
- package/front_end/core/host/UserMetricsEnums.d.ts +949 -0
- package/front_end/core/root/Runtime.ts +21 -133
- package/front_end/core/sdk/CSSMetadata.ts +70 -65
- package/front_end/core/sdk/CategorizedBreakpoint.ts +0 -1
- package/front_end/core/sdk/ChildTargetManager.ts +0 -2
- package/front_end/core/sdk/EmulationModel.ts +0 -2
- package/front_end/core/sdk/EventBreakpointsModel.ts +0 -4
- package/front_end/core/sdk/NetworkManager.ts +0 -3
- package/front_end/core/sdk/PageResourceLoader.ts +9 -9
- package/front_end/core/sdk/RehydratingConnection.ts +52 -4
- package/front_end/core/sdk/Target.ts +0 -4
- package/front_end/devtools_compatibility.js +886 -0
- package/front_end/entrypoints/inspector_main/RenderingOptions.ts +7 -6
- package/front_end/entrypoints/main/ExecutionContextSelector.ts +0 -1
- package/front_end/entrypoints/main/MainImpl.ts +18 -22
- package/front_end/foundation/Universe.ts +7 -2
- package/front_end/generated/InspectorBackendCommands.ts +3 -10
- package/front_end/generated/protocol-mapping.d.ts +0 -42
- package/front_end/generated/protocol-proxy-api.d.ts +0 -38
- package/front_end/generated/protocol.ts +9 -169
- package/front_end/models/ai_assistance/AiAgent2.ts +11 -3
- package/front_end/models/ai_assistance/AiConversation.ts +1 -0
- package/front_end/models/ai_assistance/AiHistoryStorage.ts +8 -5
- package/front_end/models/ai_assistance/AiSetting.ts +108 -0
- package/front_end/models/ai_assistance/AiUtils.ts +47 -0
- package/front_end/models/ai_assistance/ChangeManager.ts +1 -0
- package/front_end/models/ai_assistance/ExtensionScope.ts +3 -12
- package/front_end/models/ai_assistance/agents/AiAgent.ts +11 -18
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +3 -0
- package/front_end/models/ai_assistance/agents/ExecuteJavascript.ts +42 -17
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +3 -2
- package/front_end/models/ai_assistance/agents/StorageAgent.ts +253 -155
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/ai_assistance.ts +4 -0
- package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +12 -6
- package/front_end/models/ai_assistance/data_formatters/FileFormatter.ts +3 -1
- package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +1 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +1 -0
- package/front_end/models/ai_assistance/injected.ts +1 -0
- package/front_end/models/ai_assistance/performance/AICallTree.ts +1 -0
- package/front_end/models/ai_assistance/skills/Skill.ts +1 -1
- package/front_end/models/ai_assistance/skills/SkillRegistry.ts +2 -0
- package/front_end/models/ai_assistance/skills/performance.md +10 -0
- package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +52 -5
- package/front_end/models/ai_assistance/tools/GetElementAccessibilityDetails.ts +4 -4
- package/front_end/models/ai_assistance/tools/GetLighthouseAudits.ts +4 -4
- package/front_end/models/ai_assistance/tools/GetNetworkRequestDetails.ts +5 -4
- package/front_end/models/ai_assistance/tools/GetStyles.ts +5 -4
- package/front_end/models/ai_assistance/tools/ListNetworkRequests.ts +5 -4
- package/front_end/models/ai_assistance/tools/README.md +1 -1
- package/front_end/models/ai_assistance/tools/RecordPerformanceTrace.ts +63 -0
- package/front_end/models/ai_assistance/tools/ResolveDevtoolsNodePath.ts +5 -5
- package/front_end/models/ai_assistance/tools/Tool.ts +118 -24
- package/front_end/models/ai_assistance/tools/ToolRegistry.ts +2 -0
- package/front_end/models/badges/UserBadges.ts +2 -0
- package/front_end/models/bindings/NetworkProject.ts +5 -0
- package/front_end/models/bindings/ResourceScriptMapping.ts +2 -0
- package/front_end/models/bindings/ResourceUtils.ts +3 -0
- package/front_end/models/crux-manager/CrUXManager.ts +1 -0
- package/front_end/models/emulation/DeviceModeModel.ts +140 -7
- package/front_end/models/emulation/EmulatedDevices.ts +246 -793
- package/front_end/models/issues_manager/IssuesManager.ts +10 -2
- package/front_end/models/live-metrics/LiveMetrics.ts +41 -9
- package/front_end/models/logs/LogManager.ts +8 -5
- package/front_end/models/logs/NetworkLog.ts +1 -0
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +21 -3
- package/front_end/models/persistence/NetworkPersistenceManager.ts +6 -0
- package/front_end/models/project_settings/ProjectSettingsModel.ts +8 -12
- package/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +3 -1
- package/front_end/models/workspace/IgnoreListManager.ts +2 -0
- package/front_end/models/workspace/UISourceCode.ts +2 -0
- package/front_end/models/workspace_diff/WorkspaceDiff.ts +4 -0
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +22 -22
- package/front_end/panels/ai_assistance/ai_assistance-meta.ts +0 -7
- package/front_end/panels/ai_assistance/components/ChatInput.ts +4 -0
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +79 -34
- package/front_end/panels/ai_assistance/components/WalkthroughView.ts +1 -2
- package/front_end/panels/ai_assistance/components/walkthroughView.css +1 -1
- package/front_end/panels/application/ApplicationPanelSidebar.ts +9 -106
- package/front_end/panels/application/ApplicationPanelTreeElement.ts +1 -1
- package/front_end/panels/application/application.ts +0 -10
- package/front_end/panels/application/components/components.ts +0 -4
- package/front_end/panels/browser_debugger/CategorizedBreakpointsSidebarPane.ts +0 -5
- package/front_end/panels/browser_debugger/EventListenerBreakpointsSidebarPane.ts +6 -12
- package/front_end/panels/browser_debugger/browser_debugger-meta.ts +5 -3
- package/front_end/panels/console/ConsoleFormat.ts +2 -62
- package/front_end/panels/console/ConsoleViewMessage.ts +14 -7
- package/front_end/panels/emulation/AdvancedApp.ts +1 -2
- package/front_end/panels/emulation/DeviceModeToolbar.ts +83 -69
- package/front_end/panels/emulation/DeviceModeView.ts +4 -134
- package/front_end/panels/emulation/DeviceModeWrapper.ts +52 -69
- package/front_end/panels/emulation/MediaQueryInspector.ts +2 -2
- package/front_end/panels/emulation/emulation-meta.ts +12 -12
- package/front_end/panels/issues/IssuesPane.ts +3 -1
- package/front_end/panels/lighthouse/LighthouseController.ts +6 -0
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +17 -21
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryNavigator.ts +206 -126
- package/front_end/panels/linear_memory_inspector/components/linearMemoryInspector.css +1 -1
- package/front_end/panels/mobile_throttling/CalibrationController.ts +1 -1
- package/front_end/panels/mobile_throttling/MobileThrottlingSelector.ts +3 -3
- package/front_end/panels/mobile_throttling/NetworkPanelIndicator.ts +6 -6
- package/front_end/panels/mobile_throttling/NetworkThrottlingSelector.ts +11 -11
- package/front_end/panels/mobile_throttling/ThrottlingManager.ts +13 -13
- package/front_end/panels/mobile_throttling/ThrottlingPresets.ts +10 -10
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +28 -28
- package/front_end/panels/mobile_throttling/mobile_throttling-meta.ts +6 -6
- package/front_end/panels/network/RequestHeadersView.ts +1 -1
- package/front_end/panels/network/ResourceChunkView.ts +243 -144
- package/front_end/panels/network/ResourceDirectSocketChunkView.ts +52 -29
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +21 -35
- package/front_end/panels/network/resourceChunkView.css +41 -36
- package/front_end/panels/profiler/HeapDetachedElementsDataGrid.ts +21 -12
- package/front_end/panels/profiler/profiler.ts +4 -0
- package/front_end/panels/recorder/RecorderPanel.ts +6 -14
- package/front_end/panels/sensors/LocationsSettingsTab.ts +7 -7
- package/front_end/panels/settings/AISettingsTab.ts +75 -31
- package/front_end/panels/settings/SettingsScreen.ts +8 -13
- package/front_end/panels/settings/components/SyncSection.ts +3 -4
- package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +200 -18
- package/front_end/panels/settings/emulation/devicesSettingsTab.css +18 -0
- package/front_end/panels/settings/settings-meta.ts +0 -1
- package/front_end/panels/sources/CategorizedBreakpointL10n.ts +0 -2
- package/front_end/panels/sources/DebuggerPausedMessage.ts +11 -5
- package/front_end/panels/sources/DebuggerPlugin.ts +1 -1
- package/front_end/panels/sources/EditingLocationHistoryManager.ts +12 -9
- package/front_end/panels/sources/SourcesPanel.ts +19 -17
- package/front_end/panels/sources/SourcesView.ts +191 -96
- package/front_end/panels/sources/TabbedEditorContainer.ts +3 -4
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +2 -5
- package/front_end/panels/timeline/TimelineUIUtils.ts +15 -0
- package/front_end/panels/timeline/timeline-meta.ts +3 -5
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/codemirror.next/chunk/angular.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/codemirror.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/cpp.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/cpp.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/java.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/java.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/legacy.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/less.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/less.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/markdown.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/markdown.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/php.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/php.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/python.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/python.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/sass.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/sass.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/svelte.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/svelte.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/vue.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/wast.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/wast.js.map +1 -1
- package/front_end/third_party/codemirror.next/chunk/xml.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/xml.js.map +1 -1
- package/front_end/third_party/codemirror.next/codemirror.next.d.ts +1332 -193
- package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
- package/front_end/third_party/codemirror.next/rebuild.sh +1 -1
- package/front_end/tsconfig.compatibility.json +2 -1
- package/front_end/tsconfig.json +1 -1
- package/front_end/ui/components/icon_button/IconButton.ts +1 -1
- package/front_end/ui/components/issue_counter/IssueCounter.ts +1 -1
- package/front_end/ui/components/settings/SettingCheckbox.ts +4 -7
- package/front_end/ui/components/settings/settings.ts +1 -2
- package/front_end/ui/legacy/Treeoutline.ts +52 -30
- package/front_end/ui/legacy/components/object_ui/CSSStyleSanitizer.ts +74 -0
- package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +6 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +47 -54
- package/front_end/ui/legacy/components/object_ui/object_ui.ts +2 -0
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +5 -27
- package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +10 -12
- package/front_end/ui/settings/SettingUIRegistration.ts +0 -8
- package/front_end/ui/visual_logging/KnownContextValues.ts +21 -0
- package/inspector_overlay/tsconfig.json +8 -2
- package/package.json +3 -2
- package/.agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py +0 -47
- package/front_end/core/sdk/CSSModel.test.api.ts +0 -102
- package/front_end/core/sdk/DOMModel.test.api.ts +0 -104
- package/front_end/foundation/Universe.test.api.ts +0 -73
- package/front_end/panels/application/SharedStorageEventsView.ts +0 -128
- package/front_end/panels/application/SharedStorageItemsView.ts +0 -179
- package/front_end/panels/application/SharedStorageListTreeElement.ts +0 -65
- package/front_end/panels/application/SharedStorageModel.ts +0 -249
- package/front_end/panels/application/SharedStorageTreeElement.ts +0 -40
- package/front_end/panels/application/components/SharedStorageAccessGrid.ts +0 -191
- package/front_end/panels/application/components/SharedStorageMetadataView.ts +0 -133
- package/front_end/panels/application/components/sharedStorageAccessGrid.css +0 -29
- package/front_end/panels/application/components/sharedStorageMetadataView.css +0 -29
- package/front_end/panels/application/sharedStorageEventsView.css +0 -9
- package/front_end/panels/network/OriginalResourceChunkView.ts +0 -340
- package/front_end/panels/network/originalResourceChunkView.css +0 -49
- package/front_end/ui/components/settings/SettingDeprecationWarning.ts +0 -47
- package/front_end/ui/components/settings/settingDeprecationWarning.css +0 -14
|
@@ -247,7 +247,8 @@ export class SourcesPanel extends UI.Panel.Panel implements
|
|
|
247
247
|
|
|
248
248
|
this.debugToolbar = this.createDebugToolbar();
|
|
249
249
|
this.debugToolbarDrawer = this.createDebugToolbarDrawer();
|
|
250
|
-
this.debuggerPausedMessage =
|
|
250
|
+
this.debuggerPausedMessage =
|
|
251
|
+
new DebuggerPausedMessage(undefined, [SDK.EventBreakpointsModel.EventBreakpointsManager.instance()]);
|
|
251
252
|
|
|
252
253
|
const initialDebugSidebarWidth = 225;
|
|
253
254
|
this.splitWidget =
|
|
@@ -355,8 +356,8 @@ export class SourcesPanel extends UI.Panel.Panel implements
|
|
|
355
356
|
}
|
|
356
357
|
|
|
357
358
|
static updateResizerAndSidebarButtons(panel: SourcesPanel): void {
|
|
358
|
-
|
|
359
|
-
|
|
359
|
+
const leftItems: UI.Toolbar.ToolbarItem[] = [];
|
|
360
|
+
const rightItems: UI.Toolbar.ToolbarItem[] = [];
|
|
360
361
|
panel.#sourcesView.bottomToolbar().removeToolbarItems();
|
|
361
362
|
const isInWrapper = UI.Context.Context.instance().flavor(QuickSourceView) &&
|
|
362
363
|
!UI.InspectorView.InspectorView.instance().isDrawerMinimized();
|
|
@@ -366,15 +367,17 @@ export class SourcesPanel extends UI.Panel.Panel implements
|
|
|
366
367
|
panel.splitWidget.installResizer(panel.#sourcesView.scriptViewToolbar());
|
|
367
368
|
}
|
|
368
369
|
if (!isInWrapper) {
|
|
369
|
-
|
|
370
|
+
leftItems.push(panel.toggleNavigatorSidebarButton);
|
|
370
371
|
if (!Root.Runtime.Runtime.isTraceApp()) {
|
|
371
372
|
if (panel.splitWidget.isVertical()) {
|
|
372
|
-
|
|
373
|
+
rightItems.push(panel.toggleDebuggerSidebarButton);
|
|
373
374
|
} else {
|
|
374
375
|
panel.#sourcesView.bottomToolbar().appendToolbarItem(panel.toggleDebuggerSidebarButton);
|
|
375
376
|
}
|
|
376
377
|
}
|
|
377
378
|
}
|
|
379
|
+
panel.#sourcesView.leftToolbarItems = leftItems;
|
|
380
|
+
panel.#sourcesView.rightToolbarItems = rightItems;
|
|
378
381
|
}
|
|
379
382
|
|
|
380
383
|
targetAdded(_target: SDK.Target.Target): void {
|
|
@@ -597,9 +600,8 @@ export class SourcesPanel extends UI.Panel.Panel implements
|
|
|
597
600
|
return this.#sourcesView.visibleView();
|
|
598
601
|
}
|
|
599
602
|
|
|
600
|
-
showUISourceCode(
|
|
601
|
-
|
|
602
|
-
omitFocus?: boolean): void {
|
|
603
|
+
async showUISourceCode(uiSourceCode: Workspace.UISourceCode.UISourceCode,
|
|
604
|
+
location?: SourceFrame.SourceFrame.RevealPosition, omitFocus?: boolean): Promise<void> {
|
|
603
605
|
if (omitFocus) {
|
|
604
606
|
if (!this.isShowing() && !UI.Context.Context.instance().flavor(QuickSourceView)) {
|
|
605
607
|
return;
|
|
@@ -607,7 +609,7 @@ export class SourcesPanel extends UI.Panel.Panel implements
|
|
|
607
609
|
} else {
|
|
608
610
|
this.showEditor();
|
|
609
611
|
}
|
|
610
|
-
this.#sourcesView.showSourceLocation(uiSourceCode, location, omitFocus);
|
|
612
|
+
await this.#sourcesView.showSourceLocation(uiSourceCode, location, omitFocus);
|
|
611
613
|
}
|
|
612
614
|
|
|
613
615
|
private showEditor(): void {
|
|
@@ -617,9 +619,9 @@ export class SourcesPanel extends UI.Panel.Panel implements
|
|
|
617
619
|
void this.setAsCurrentPanel();
|
|
618
620
|
}
|
|
619
621
|
|
|
620
|
-
showUILocation(uiLocation: Workspace.UISourceCode.UILocation, omitFocus?: boolean): void {
|
|
622
|
+
async showUILocation(uiLocation: Workspace.UISourceCode.UILocation, omitFocus?: boolean): Promise<void> {
|
|
621
623
|
const {uiSourceCode, lineNumber, columnNumber} = uiLocation;
|
|
622
|
-
this.showUISourceCode(uiSourceCode, {lineNumber, columnNumber}, omitFocus);
|
|
624
|
+
await this.showUISourceCode(uiSourceCode, {lineNumber, columnNumber}, omitFocus);
|
|
623
625
|
}
|
|
624
626
|
|
|
625
627
|
async revealInNavigator(uiSourceCode: Workspace.UISourceCode.UISourceCode, skipReveal?: boolean): Promise<void> {
|
|
@@ -670,7 +672,7 @@ export class SourcesPanel extends UI.Panel.Panel implements
|
|
|
670
672
|
if (window.performance.now() - this.lastModificationTime < lastModificationTimeout) {
|
|
671
673
|
return;
|
|
672
674
|
}
|
|
673
|
-
this.#sourcesView.showSourceLocation(uiLocation.uiSourceCode, uiLocation, undefined, true);
|
|
675
|
+
await this.#sourcesView.showSourceLocation(uiLocation.uiSourceCode, uiLocation, undefined, true);
|
|
674
676
|
}
|
|
675
677
|
|
|
676
678
|
private async updateDebuggerButtonsAndStatus(): Promise<void> {
|
|
@@ -1140,7 +1142,7 @@ export class SourcesPanel extends UI.Panel.Panel implements
|
|
|
1140
1142
|
await Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance().rawLocationToUILocation(
|
|
1141
1143
|
response.location);
|
|
1142
1144
|
if (uiLocation) {
|
|
1143
|
-
this.showUILocation(uiLocation);
|
|
1145
|
+
await this.showUILocation(uiLocation);
|
|
1144
1146
|
}
|
|
1145
1147
|
}
|
|
1146
1148
|
|
|
@@ -1292,7 +1294,7 @@ export const minToolbarWidth = 215;
|
|
|
1292
1294
|
|
|
1293
1295
|
export class UILocationRevealer implements Common.Revealer.Revealer<Workspace.UISourceCode.UILocation> {
|
|
1294
1296
|
async reveal(uiLocation: Workspace.UISourceCode.UILocation, omitFocus?: boolean): Promise<void> {
|
|
1295
|
-
SourcesPanel.instance().showUILocation(uiLocation, omitFocus);
|
|
1297
|
+
await SourcesPanel.instance().showUILocation(uiLocation, omitFocus);
|
|
1296
1298
|
}
|
|
1297
1299
|
}
|
|
1298
1300
|
|
|
@@ -1307,7 +1309,7 @@ export class UILocationRangeRevealer implements Common.Revealer.Revealer<Workspa
|
|
|
1307
1309
|
|
|
1308
1310
|
async reveal(uiLocationRange: Workspace.UISourceCode.UILocationRange, omitFocus?: boolean): Promise<void> {
|
|
1309
1311
|
const {uiSourceCode, range: {start: from, end: to}} = uiLocationRange;
|
|
1310
|
-
SourcesPanel.instance().showUISourceCode(uiSourceCode, {from, to}, omitFocus);
|
|
1312
|
+
await SourcesPanel.instance().showUISourceCode(uiSourceCode, {from, to}, omitFocus);
|
|
1311
1313
|
}
|
|
1312
1314
|
}
|
|
1313
1315
|
|
|
@@ -1317,14 +1319,14 @@ export class DebuggerLocationRevealer implements Common.Revealer.Revealer<SDK.De
|
|
|
1317
1319
|
await Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding.instance().rawLocationToUILocation(
|
|
1318
1320
|
rawLocation);
|
|
1319
1321
|
if (uiLocation) {
|
|
1320
|
-
SourcesPanel.instance().showUILocation(uiLocation, omitFocus);
|
|
1322
|
+
await SourcesPanel.instance().showUILocation(uiLocation, omitFocus);
|
|
1321
1323
|
}
|
|
1322
1324
|
}
|
|
1323
1325
|
}
|
|
1324
1326
|
|
|
1325
1327
|
export class UISourceCodeRevealer implements Common.Revealer.Revealer<Workspace.UISourceCode.UISourceCode> {
|
|
1326
1328
|
async reveal(uiSourceCode: Workspace.UISourceCode.UISourceCode, omitFocus?: boolean): Promise<void> {
|
|
1327
|
-
SourcesPanel.instance().showUISourceCode(uiSourceCode, undefined, omitFocus);
|
|
1329
|
+
await SourcesPanel.instance().showUISourceCode(uiSourceCode, undefined, omitFocus);
|
|
1328
1330
|
}
|
|
1329
1331
|
}
|
|
1330
1332
|
|
|
@@ -13,11 +13,10 @@ import * as SDK from '../../core/sdk/sdk.js';
|
|
|
13
13
|
import * as Bindings from '../../models/bindings/bindings.js';
|
|
14
14
|
import * as Persistence from '../../models/persistence/persistence.js';
|
|
15
15
|
import * as Workspace from '../../models/workspace/workspace.js';
|
|
16
|
-
import {createIcon} from '../../ui/kit/kit.js';
|
|
17
16
|
import * as QuickOpen from '../../ui/legacy/components/quick_open/quick_open.js';
|
|
18
17
|
import * as SourceFrame from '../../ui/legacy/components/source_frame/source_frame.js';
|
|
19
18
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
20
|
-
import {render} from '../../ui/lit/lit.js';
|
|
19
|
+
import {html, render} from '../../ui/lit/lit.js';
|
|
21
20
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
22
21
|
|
|
23
22
|
import * as Components from './components/components.js';
|
|
@@ -56,11 +55,78 @@ const UIStrings = {
|
|
|
56
55
|
const str_ = i18n.i18n.registerUIStrings('panels/sources/SourcesView.ts', UIStrings);
|
|
57
56
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
58
57
|
|
|
58
|
+
export interface Shortcut {
|
|
59
|
+
description: string;
|
|
60
|
+
onClick: () => void;
|
|
61
|
+
keys: string[];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface ViewInput {
|
|
65
|
+
placeholderElement: HTMLElement;
|
|
66
|
+
scriptViewToolbar: UI.Toolbar.Toolbar;
|
|
67
|
+
bottomToolbar: UI.Toolbar.Toolbar;
|
|
68
|
+
leftToolbarItems: UI.Toolbar.ToolbarItem[];
|
|
69
|
+
rightToolbarItems: UI.Toolbar.ToolbarItem[];
|
|
70
|
+
searchableView: UI.SearchableView.SearchableView;
|
|
71
|
+
editorContainer: TabbedEditorContainer;
|
|
72
|
+
shortcuts: Shortcut[];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface ViewOutput {
|
|
76
|
+
onSelectFolderClicked: () => void;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export type View = (input: ViewInput, output: ViewOutput, target: HTMLElement) => void;
|
|
80
|
+
|
|
81
|
+
export const DEFAULT_VIEW = (input: ViewInput, output: ViewOutput, target: HTMLElement): void => {
|
|
82
|
+
render(html`
|
|
83
|
+
<devtools-widget class="vbox flex-auto" ${UI.Widget.widget(() => input.searchableView)}>
|
|
84
|
+
<devtools-widget class="vbox flex-auto" ${UI.Widget.widget(() => input.editorContainer.view)}>
|
|
85
|
+
</devtools-widget>
|
|
86
|
+
</devtools-widget>
|
|
87
|
+
<div class="sources-toolbar" jslog=${VisualLogging.toolbar('bottom')}>
|
|
88
|
+
${input.scriptViewToolbar}
|
|
89
|
+
${input.bottomToolbar}
|
|
90
|
+
</div>`,
|
|
91
|
+
target);
|
|
92
|
+
|
|
93
|
+
// eslint-disable-next-line @devtools/no-lit-render-outside-of-view
|
|
94
|
+
render(html`
|
|
95
|
+
<div class="tabbed-pane-placeholder-row workspace">
|
|
96
|
+
<span class="icon-container">
|
|
97
|
+
<devtools-icon name="sync" class="sync-icon"></devtools-icon>
|
|
98
|
+
</span>
|
|
99
|
+
<span>
|
|
100
|
+
${i18nString(UIStrings.workspaceDropInAFolderToSyncSources)}
|
|
101
|
+
<button @click=${() => output.onSelectFolderClicked()}>${i18nString(UIStrings.selectFolder)}</button>
|
|
102
|
+
</span>
|
|
103
|
+
</div>
|
|
104
|
+
|
|
105
|
+
<div class="shortcuts-list tabbed-pane-placeholder-row" role="list"
|
|
106
|
+
aria-label=${i18nString(UIStrings.sourceViewActions)}>
|
|
107
|
+
${input.shortcuts.map(shortcut => {
|
|
108
|
+
if (!shortcut.keys.length) {
|
|
109
|
+
return html`<div class="shortcut-line" role="listitem"></div>`;
|
|
110
|
+
}
|
|
111
|
+
return html`<div class="shortcut-line" role="listitem">
|
|
112
|
+
<button @click=${shortcut.onClick}>${shortcut.description}</button>
|
|
113
|
+
<span class="shortcuts">
|
|
114
|
+
${shortcut.keys.map(key => html`
|
|
115
|
+
<span class="keybinds-key"><span>${key}</span></span>
|
|
116
|
+
`)}
|
|
117
|
+
</span>
|
|
118
|
+
</div>`;
|
|
119
|
+
})}
|
|
120
|
+
</div>`,
|
|
121
|
+
input.placeholderElement);
|
|
122
|
+
};
|
|
123
|
+
|
|
59
124
|
export class SourcesView extends Common.ObjectWrapper.eventMixin<EventTypes, typeof UI.Widget.VBox>(UI.Widget.VBox)
|
|
60
125
|
implements TabbedEditorContainerDelegate, UI.SearchableView.Searchable, UI.SearchableView.Replaceable {
|
|
61
|
-
|
|
126
|
+
#searchableView!: UI.SearchableView.SearchableView;
|
|
62
127
|
private readonly sourceViewByUISourceCode: Map<Workspace.UISourceCode.UISourceCode, UI.Widget.Widget>;
|
|
63
|
-
editorContainer
|
|
128
|
+
editorContainer?: TabbedEditorContainer;
|
|
129
|
+
#uiSourceCodes = new Set<Workspace.UISourceCode.UISourceCode>();
|
|
64
130
|
private readonly historyManager: EditingLocationHistoryManager;
|
|
65
131
|
readonly #scriptViewToolbar: UI.Toolbar.Toolbar;
|
|
66
132
|
readonly #bottomToolbar: UI.Toolbar.Toolbar;
|
|
@@ -68,6 +134,10 @@ export class SourcesView extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
68
134
|
private readonly focusedPlaceholderElement?: HTMLElement;
|
|
69
135
|
private searchView?: UISourceCodeFrame;
|
|
70
136
|
private searchConfig?: UI.SearchableView.SearchConfig;
|
|
137
|
+
#leftToolbarItems: UI.Toolbar.ToolbarItem[] = [];
|
|
138
|
+
#rightToolbarItems: UI.Toolbar.ToolbarItem[] = [];
|
|
139
|
+
#placeholderElement: HTMLElement;
|
|
140
|
+
#view: View = DEFAULT_VIEW;
|
|
71
141
|
|
|
72
142
|
constructor() {
|
|
73
143
|
super({jslog: `${VisualLogging.pane('editor').track({keydown: 'Escape'})}`});
|
|
@@ -78,31 +148,31 @@ export class SourcesView extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
78
148
|
|
|
79
149
|
const workspace = Workspace.Workspace.WorkspaceImpl.instance();
|
|
80
150
|
|
|
81
|
-
this.#
|
|
82
|
-
this.#
|
|
83
|
-
this.#searchableView.show(this.element);
|
|
151
|
+
this.#placeholderElement = document.createElement('div');
|
|
152
|
+
this.#placeholderElement.classList.add('sources-placeholder');
|
|
84
153
|
|
|
85
154
|
this.sourceViewByUISourceCode = new Map();
|
|
86
155
|
|
|
87
|
-
this.editorContainer = new TabbedEditorContainer(
|
|
88
|
-
this, Common.Settings.Settings.instance().createLocalSetting('previously-viewed-files', []),
|
|
89
|
-
this.placeholderElement(), this.focusedPlaceholderElement);
|
|
90
|
-
this.editorContainer.show(this.#searchableView.element);
|
|
91
|
-
this.editorContainer.addEventListener(TabbedEditorContainerEvents.EDITOR_SELECTED, this.editorSelected, this);
|
|
92
|
-
this.editorContainer.addEventListener(TabbedEditorContainerEvents.EDITOR_CLOSED, this.editorClosed, this);
|
|
93
|
-
|
|
94
156
|
this.historyManager = new EditingLocationHistoryManager(this);
|
|
95
157
|
|
|
96
|
-
|
|
97
|
-
toolbarContainerElementInternal.setAttribute('jslog', `${VisualLogging.toolbar('bottom')}`);
|
|
98
|
-
this.#scriptViewToolbar = toolbarContainerElementInternal.createChild('devtools-toolbar');
|
|
158
|
+
this.#scriptViewToolbar = document.createElement('devtools-toolbar') as UI.Toolbar.Toolbar;
|
|
99
159
|
this.#scriptViewToolbar.style.flex = 'auto';
|
|
100
|
-
this.#bottomToolbar =
|
|
160
|
+
this.#bottomToolbar = document.createElement('devtools-toolbar') as UI.Toolbar.Toolbar;
|
|
101
161
|
|
|
102
162
|
this.toolbarChangedListener = null;
|
|
103
163
|
|
|
164
|
+
this.#searchableView = new UI.SearchableView.SearchableView(this, this, 'sources-view-search-config');
|
|
165
|
+
this.#searchableView.setMinimalSearchQuerySize(0);
|
|
166
|
+
|
|
167
|
+
const previouslyViewedFilesSetting =
|
|
168
|
+
Common.Settings.Settings.instance().createLocalSetting('previously-viewed-files', []);
|
|
169
|
+
this.editorContainer = new TabbedEditorContainer(this, previouslyViewedFilesSetting, this.#placeholderElement,
|
|
170
|
+
this.focusedPlaceholderElement);
|
|
171
|
+
this.editorContainer.addEventListener(TabbedEditorContainerEvents.EDITOR_SELECTED, this.editorSelected, this);
|
|
172
|
+
this.editorContainer.addEventListener(TabbedEditorContainerEvents.EDITOR_CLOSED, this.editorClosed, this);
|
|
173
|
+
|
|
104
174
|
UI.UIUtils.startBatchUpdate();
|
|
105
|
-
workspace.uiSourceCodes().forEach(this.addUISourceCode
|
|
175
|
+
workspace.uiSourceCodes().forEach(ui => this.addUISourceCode(ui));
|
|
106
176
|
UI.UIUtils.endBatchUpdate();
|
|
107
177
|
|
|
108
178
|
workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeAdded, this.uiSourceCodeAdded, this);
|
|
@@ -110,6 +180,8 @@ export class SourcesView extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
110
180
|
workspace.addEventListener(Workspace.Workspace.Events.ProjectRemoved, this.projectRemoved.bind(this), this);
|
|
111
181
|
SDK.TargetManager.TargetManager.instance().addScopeChangeListener(this.#onScopeChange.bind(this));
|
|
112
182
|
|
|
183
|
+
this.requestUpdate();
|
|
184
|
+
|
|
113
185
|
function handleBeforeUnload(event: Event): void {
|
|
114
186
|
if (event.returnValue) {
|
|
115
187
|
return;
|
|
@@ -142,55 +214,30 @@ export class SourcesView extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
142
214
|
}
|
|
143
215
|
}
|
|
144
216
|
|
|
145
|
-
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
const browseButton = text.createChild('button');
|
|
157
|
-
browseButton.textContent = i18nString(UIStrings.selectFolder);
|
|
158
|
-
browseButton.addEventListener('click', this.addFileSystemClicked.bind(this));
|
|
159
|
-
|
|
160
|
-
const shortcuts = [
|
|
161
|
-
{actionId: 'quick-open.show', description: i18nString(UIStrings.openFile)},
|
|
162
|
-
{actionId: 'quick-open.show-command-menu', description: i18nString(UIStrings.runCommand)},
|
|
163
|
-
];
|
|
217
|
+
override performUpdate(): void {
|
|
218
|
+
const input: ViewInput = {
|
|
219
|
+
placeholderElement: this.#placeholderElement,
|
|
220
|
+
scriptViewToolbar: this.#scriptViewToolbar,
|
|
221
|
+
bottomToolbar: this.#bottomToolbar,
|
|
222
|
+
leftToolbarItems: this.#leftToolbarItems,
|
|
223
|
+
rightToolbarItems: this.#rightToolbarItems,
|
|
224
|
+
searchableView: this.#searchableView,
|
|
225
|
+
editorContainer: this.editorContainer as TabbedEditorContainer,
|
|
226
|
+
shortcuts: this.#getPlaceholderShortcuts(),
|
|
227
|
+
};
|
|
164
228
|
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
229
|
+
const output: ViewOutput = {
|
|
230
|
+
onSelectFolderClicked: () => {
|
|
231
|
+
void this.addFileSystemClicked();
|
|
232
|
+
},
|
|
233
|
+
};
|
|
169
234
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
const listItemElement = list.createChild('div');
|
|
173
|
-
listItemElement.classList.add('shortcut-line');
|
|
174
|
-
|
|
175
|
-
UI.ARIAUtils.markAsListitem(listItemElement);
|
|
176
|
-
|
|
177
|
-
// Take the first shortcut for display.
|
|
178
|
-
if (shortcutKeys?.[0]) {
|
|
179
|
-
const button = listItemElement.createChild('button');
|
|
180
|
-
button.textContent = shortcut.description;
|
|
181
|
-
const action = UI.ActionRegistry.ActionRegistry.instance().getAction(shortcut.actionId);
|
|
182
|
-
button.addEventListener('click', () => action.execute());
|
|
183
|
-
|
|
184
|
-
const shortcutElement = listItemElement.createChild('span', 'shortcuts');
|
|
185
|
-
const separator = Host.Platform.isMac() ? '\u2004' : ' + ';
|
|
186
|
-
const keys = shortcutKeys[0].descriptors.flatMap(descriptor => descriptor.name.split(separator));
|
|
187
|
-
keys.forEach(key => {
|
|
188
|
-
shortcutElement.createChild('span', 'keybinds-key').createChild('span').textContent = key;
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
}
|
|
235
|
+
this.#view(input, output, this.element);
|
|
236
|
+
}
|
|
192
237
|
|
|
193
|
-
|
|
238
|
+
override onDetach(): void {
|
|
239
|
+
super.onDetach();
|
|
240
|
+
this.editorContainer?.view.detachChildWidgets();
|
|
194
241
|
}
|
|
195
242
|
|
|
196
243
|
private async addFileSystemClicked(): Promise<void> {
|
|
@@ -202,11 +249,38 @@ export class SourcesView extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
202
249
|
void UI.ViewManager.ViewManager.instance().showView('navigator-files');
|
|
203
250
|
}
|
|
204
251
|
|
|
252
|
+
#getPlaceholderShortcuts(): Shortcut[] {
|
|
253
|
+
const shortcuts = [
|
|
254
|
+
{actionId: 'quick-open.show', description: i18nString(UIStrings.openFile)},
|
|
255
|
+
{actionId: 'quick-open.show-command-menu', description: i18nString(UIStrings.runCommand)},
|
|
256
|
+
];
|
|
257
|
+
const separator = Host.Platform.isMac() ? '\u2004' : ' + ';
|
|
258
|
+
return shortcuts.map(shortcut => {
|
|
259
|
+
const shortcutKeys = UI.ShortcutRegistry.ShortcutRegistry.instance().shortcutsForAction(shortcut.actionId);
|
|
260
|
+
if (!shortcutKeys?.[0]) {
|
|
261
|
+
return {
|
|
262
|
+
description: shortcut.description,
|
|
263
|
+
onClick: () => {},
|
|
264
|
+
keys: [],
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
const action = UI.ActionRegistry.ActionRegistry.instance().getAction(shortcut.actionId);
|
|
268
|
+
const keys = shortcutKeys[0].descriptors.flatMap(descriptor => descriptor.name.split(separator));
|
|
269
|
+
return {
|
|
270
|
+
description: shortcut.description,
|
|
271
|
+
onClick: () => {
|
|
272
|
+
void action.execute();
|
|
273
|
+
},
|
|
274
|
+
keys,
|
|
275
|
+
};
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
|
|
205
279
|
static defaultUISourceCodeScores(): Map<Workspace.UISourceCode.UISourceCode, number> {
|
|
206
280
|
const defaultScores = new Map<Workspace.UISourceCode.UISourceCode, number>();
|
|
207
281
|
const sourcesView = UI.Context.Context.instance().flavor(SourcesView);
|
|
208
282
|
if (sourcesView) {
|
|
209
|
-
const uiSourceCodes = sourcesView.editorContainer
|
|
283
|
+
const uiSourceCodes = sourcesView.editorContainer?.historyUISourceCodes() ?? [];
|
|
210
284
|
for (let i = 1; i < uiSourceCodes.length; ++i) // Skip current element
|
|
211
285
|
{
|
|
212
286
|
defaultScores.set(uiSourceCodes[i], uiSourceCodes.length - i);
|
|
@@ -215,12 +289,30 @@ export class SourcesView extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
215
289
|
return defaultScores;
|
|
216
290
|
}
|
|
217
291
|
|
|
218
|
-
|
|
219
|
-
|
|
292
|
+
set leftToolbarItems(items: UI.Toolbar.ToolbarItem[]) {
|
|
293
|
+
this.#leftToolbarItems = items;
|
|
294
|
+
const container = this.editorContainer;
|
|
295
|
+
if (container) {
|
|
296
|
+
container.leftToolbar().removeToolbarItems();
|
|
297
|
+
items.forEach(item => container.leftToolbar().appendToolbarItem(item));
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
get leftToolbarItems(): UI.Toolbar.ToolbarItem[] {
|
|
302
|
+
return this.#leftToolbarItems;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
set rightToolbarItems(items: UI.Toolbar.ToolbarItem[]) {
|
|
306
|
+
this.#rightToolbarItems = items;
|
|
307
|
+
const container = this.editorContainer;
|
|
308
|
+
if (container) {
|
|
309
|
+
container.rightToolbar().removeToolbarItems();
|
|
310
|
+
items.forEach(item => container.rightToolbar().appendToolbarItem(item));
|
|
311
|
+
}
|
|
220
312
|
}
|
|
221
313
|
|
|
222
|
-
|
|
223
|
-
return this
|
|
314
|
+
get rightToolbarItems(): UI.Toolbar.ToolbarItem[] {
|
|
315
|
+
return this.#rightToolbarItems;
|
|
224
316
|
}
|
|
225
317
|
|
|
226
318
|
bottomToolbar(): UI.Toolbar.Toolbar {
|
|
@@ -246,7 +338,7 @@ export class SourcesView extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
246
338
|
}
|
|
247
339
|
|
|
248
340
|
visibleView(): UI.Widget.Widget|null {
|
|
249
|
-
return this.editorContainer
|
|
341
|
+
return (this.editorContainer?.visibleView ?? null) as UI.Widget.Widget | null;
|
|
250
342
|
}
|
|
251
343
|
|
|
252
344
|
currentSourceFrame(): UISourceCodeFrame|null {
|
|
@@ -258,15 +350,15 @@ export class SourcesView extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
258
350
|
}
|
|
259
351
|
|
|
260
352
|
currentUISourceCode(): Workspace.UISourceCode.UISourceCode|null {
|
|
261
|
-
return this.editorContainer
|
|
353
|
+
return this.editorContainer?.currentFile() ?? null;
|
|
262
354
|
}
|
|
263
355
|
|
|
264
356
|
onCloseEditorTab(): boolean {
|
|
265
|
-
const uiSourceCode = this.editorContainer
|
|
357
|
+
const uiSourceCode = this.editorContainer?.currentFile();
|
|
266
358
|
if (!uiSourceCode) {
|
|
267
359
|
return false;
|
|
268
360
|
}
|
|
269
|
-
this.editorContainer
|
|
361
|
+
this.editorContainer?.closeFile(uiSourceCode);
|
|
270
362
|
return true;
|
|
271
363
|
}
|
|
272
364
|
|
|
@@ -317,7 +409,8 @@ export class SourcesView extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
317
409
|
}
|
|
318
410
|
}
|
|
319
411
|
}
|
|
320
|
-
this.
|
|
412
|
+
this.#uiSourceCodes.add(uiSourceCode);
|
|
413
|
+
this.editorContainer?.addUISourceCode(uiSourceCode);
|
|
321
414
|
}
|
|
322
415
|
|
|
323
416
|
private uiSourceCodeRemoved(event: Common.EventTarget.EventTargetEvent<Workspace.UISourceCode.UISourceCode>): void {
|
|
@@ -326,7 +419,8 @@ export class SourcesView extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
326
419
|
}
|
|
327
420
|
|
|
328
421
|
private removeUISourceCodes(uiSourceCodes: Workspace.UISourceCode.UISourceCode[]): void {
|
|
329
|
-
this.
|
|
422
|
+
uiSourceCodes.forEach(ui => this.#uiSourceCodes.delete(ui));
|
|
423
|
+
this.editorContainer?.removeUISourceCodes(uiSourceCodes);
|
|
330
424
|
for (let i = 0; i < uiSourceCodes.length; ++i) {
|
|
331
425
|
this.removeSourceFrame(uiSourceCodes[i]);
|
|
332
426
|
this.historyManager.removeHistoryForSourceCode(uiSourceCodes[i]);
|
|
@@ -357,15 +451,15 @@ export class SourcesView extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
357
451
|
}
|
|
358
452
|
}
|
|
359
453
|
|
|
360
|
-
showSourceLocation(
|
|
361
|
-
|
|
362
|
-
|
|
454
|
+
async showSourceLocation(uiSourceCode: Workspace.UISourceCode.UISourceCode,
|
|
455
|
+
location?: SourceFrame.SourceFrame.RevealPosition, omitFocus?: boolean,
|
|
456
|
+
omitHighlight?: boolean): Promise<void> {
|
|
363
457
|
const currentFrame = this.currentSourceFrame();
|
|
364
458
|
if (currentFrame) {
|
|
365
|
-
this.historyManager.updateCurrentState(
|
|
366
|
-
|
|
459
|
+
this.historyManager.updateCurrentState(currentFrame.uiSourceCode(),
|
|
460
|
+
currentFrame.textEditor.state.selection.main.head);
|
|
367
461
|
}
|
|
368
|
-
this.editorContainer
|
|
462
|
+
this.editorContainer?.showFile(uiSourceCode);
|
|
369
463
|
const currentSourceFrame = this.currentSourceFrame();
|
|
370
464
|
if (currentSourceFrame && location) {
|
|
371
465
|
currentSourceFrame.revealPosition(location, !omitHighlight);
|
|
@@ -432,7 +526,8 @@ export class SourcesView extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
432
526
|
if (this.#sourceViewTypeForWidget(widget) !== this.#sourceViewTypeForUISourceCode(uiSourceCode)) {
|
|
433
527
|
// Remove the existing editor tab and create a new one of the correct type.
|
|
434
528
|
this.removeUISourceCodes([uiSourceCode]);
|
|
435
|
-
this.
|
|
529
|
+
this.#uiSourceCodes.add(uiSourceCode);
|
|
530
|
+
void this.showSourceLocation(uiSourceCode);
|
|
436
531
|
}
|
|
437
532
|
}
|
|
438
533
|
}
|
|
@@ -446,8 +541,8 @@ export class SourcesView extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
446
541
|
}
|
|
447
542
|
|
|
448
543
|
recycleUISourceCodeFrame(sourceFrame: UISourceCodeFrame, uiSourceCode: Workspace.UISourceCode.UISourceCode): void {
|
|
449
|
-
sourceFrame.uiSourceCode().removeEventListener(
|
|
450
|
-
|
|
544
|
+
sourceFrame.uiSourceCode().removeEventListener(Workspace.UISourceCode.Events.TitleChanged,
|
|
545
|
+
this.#uiSourceCodeTitleChanged, this);
|
|
451
546
|
this.sourceViewByUISourceCode.delete(sourceFrame.uiSourceCode());
|
|
452
547
|
sourceFrame.setUISourceCode(uiSourceCode);
|
|
453
548
|
this.sourceViewByUISourceCode.set(uiSourceCode, sourceFrame);
|
|
@@ -472,7 +567,7 @@ export class SourcesView extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
472
567
|
this.historyManager.removeHistoryForSourceCode(uiSourceCode);
|
|
473
568
|
|
|
474
569
|
let wasSelected = false;
|
|
475
|
-
if (!this.editorContainer
|
|
570
|
+
if (!this.editorContainer?.currentFile()) {
|
|
476
571
|
wasSelected = true;
|
|
477
572
|
}
|
|
478
573
|
|
|
@@ -503,7 +598,7 @@ export class SourcesView extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
503
598
|
this.updateToolbarChangedListener();
|
|
504
599
|
this.updateScriptViewToolbarItems();
|
|
505
600
|
|
|
506
|
-
const currentFile = this.editorContainer
|
|
601
|
+
const currentFile = this.editorContainer?.currentFile();
|
|
507
602
|
if (currentFile) {
|
|
508
603
|
this.dispatchEventToListeners(Events.EDITOR_SELECTED, currentFile);
|
|
509
604
|
}
|
|
@@ -522,8 +617,8 @@ export class SourcesView extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
522
617
|
if (!sourceFrame) {
|
|
523
618
|
return;
|
|
524
619
|
}
|
|
525
|
-
this.toolbarChangedListener = sourceFrame.addEventListener(
|
|
526
|
-
|
|
620
|
+
this.toolbarChangedListener = sourceFrame.addEventListener(UISourceCodeFrameEvents.TOOLBAR_ITEMS_CHANGED,
|
|
621
|
+
this.updateScriptViewToolbarItems, this);
|
|
527
622
|
}
|
|
528
623
|
|
|
529
624
|
onSearchCanceled(): void {
|
|
@@ -611,7 +706,7 @@ export class SourcesView extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
611
706
|
}
|
|
612
707
|
|
|
613
708
|
showGoToLineQuickOpen(): void {
|
|
614
|
-
if (this.editorContainer
|
|
709
|
+
if (this.editorContainer?.currentFile()) {
|
|
615
710
|
QuickOpen.QuickOpen.QuickOpenImpl.show(':');
|
|
616
711
|
}
|
|
617
712
|
}
|
|
@@ -621,7 +716,7 @@ export class SourcesView extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
621
716
|
}
|
|
622
717
|
|
|
623
718
|
saveAll(): void {
|
|
624
|
-
const sourceFrames = this.editorContainer
|
|
719
|
+
const sourceFrames = this.editorContainer?.fileViews() ?? [];
|
|
625
720
|
sourceFrames.forEach(this.saveSourceFrame.bind(this));
|
|
626
721
|
}
|
|
627
722
|
|
|
@@ -634,7 +729,7 @@ export class SourcesView extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
634
729
|
}
|
|
635
730
|
|
|
636
731
|
toggleBreakpointsActiveState(active: boolean): void {
|
|
637
|
-
this.editorContainer
|
|
732
|
+
this.editorContainer?.view.element.classList.toggle('breakpoints-deactivated', !active);
|
|
638
733
|
}
|
|
639
734
|
}
|
|
640
735
|
|
|
@@ -696,7 +791,7 @@ export class SwitchFileActionDelegate implements UI.ActionRegistration.ActionDel
|
|
|
696
791
|
if (!nextUISourceCode) {
|
|
697
792
|
return false;
|
|
698
793
|
}
|
|
699
|
-
sourcesView.showSourceLocation(nextUISourceCode);
|
|
794
|
+
void sourcesView.showSourceLocation(nextUISourceCode);
|
|
700
795
|
return true;
|
|
701
796
|
}
|
|
702
797
|
}
|
|
@@ -710,7 +805,7 @@ export class ActionDelegate implements UI.ActionRegistration.ActionDelegate {
|
|
|
710
805
|
|
|
711
806
|
switch (actionId) {
|
|
712
807
|
case 'sources.close-all':
|
|
713
|
-
sourcesView.editorContainer
|
|
808
|
+
sourcesView.editorContainer?.closeAllFiles();
|
|
714
809
|
return true;
|
|
715
810
|
case 'sources.jump-to-previous-location':
|
|
716
811
|
sourcesView.onJumpToPreviousLocation();
|
|
@@ -719,10 +814,10 @@ export class ActionDelegate implements UI.ActionRegistration.ActionDelegate {
|
|
|
719
814
|
sourcesView.onJumpToNextLocation();
|
|
720
815
|
return true;
|
|
721
816
|
case 'sources.next-editor-tab':
|
|
722
|
-
sourcesView.editorContainer
|
|
817
|
+
sourcesView.editorContainer?.selectNextTab();
|
|
723
818
|
return true;
|
|
724
819
|
case 'sources.previous-editor-tab':
|
|
725
|
-
sourcesView.editorContainer
|
|
820
|
+
sourcesView.editorContainer?.selectPrevTab();
|
|
726
821
|
return true;
|
|
727
822
|
case 'sources.close-editor-tab':
|
|
728
823
|
return sourcesView.onCloseEditorTab();
|
|
@@ -73,13 +73,12 @@ export class TabbedEditorContainer extends Common.ObjectWrapper.ObjectWrapper<Ev
|
|
|
73
73
|
private currentView!: UI.Widget.Widget|null;
|
|
74
74
|
private scrollTimer?: number;
|
|
75
75
|
private reentrantShow: boolean;
|
|
76
|
-
constructor(
|
|
77
|
-
|
|
78
|
-
placeholderElement: Element, focusedPlaceholderElement?: Element) {
|
|
76
|
+
constructor(delegate: TabbedEditorContainerDelegate, setting: Common.Settings.Setting<SerializedHistoryItem[]>,
|
|
77
|
+
placeholderElement: Element, focusedPlaceholderElement?: Element, element?: HTMLElement) {
|
|
79
78
|
super();
|
|
80
79
|
this.delegate = delegate;
|
|
81
80
|
|
|
82
|
-
this.tabbedPane = new UI.TabbedPane.TabbedPane();
|
|
81
|
+
this.tabbedPane = new UI.TabbedPane.TabbedPane(element);
|
|
83
82
|
this.tabbedPane.setPlaceholderElement(placeholderElement, focusedPlaceholderElement);
|
|
84
83
|
this.tabbedPane.setTabDelegate(new EditorContainerTabDelegate(this));
|
|
85
84
|
|
|
@@ -150,11 +150,8 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
150
150
|
}
|
|
151
151
|
};
|
|
152
152
|
|
|
153
|
-
const renderNameElement = (e: WatchExpression):
|
|
154
|
-
|
|
155
|
-
UI.Tooltip.Tooltip.install(nameElement as HTMLElement, e.expression);
|
|
156
|
-
return nameElement;
|
|
157
|
-
};
|
|
153
|
+
const renderNameElement = (e: WatchExpression): TemplateResult => ObjectUI.ObjectPropertiesSection.renderPropertyName(
|
|
154
|
+
e.expression, /* isPrivate= */ false, e.expression ?? undefined);
|
|
158
155
|
|
|
159
156
|
const renderTreeElement = (e: WatchExpression): TemplateResult =>
|
|
160
157
|
// clang-format off
|
|
@@ -542,6 +542,21 @@ export class TimelineUIUtils {
|
|
|
542
542
|
tokens.push(url);
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
|
+
if (Trace.Types.Extensions.isSyntheticExtensionEntry(traceEvent)) {
|
|
546
|
+
// Extension entries are synthetic events that carry the text shown to the
|
|
547
|
+
// user on the event itself rather than in `args`, so gather it explicitly.
|
|
548
|
+
const {tooltipText, properties} = traceEvent.devtoolsObj;
|
|
549
|
+
if (tooltipText) {
|
|
550
|
+
tokens.push(tooltipText);
|
|
551
|
+
}
|
|
552
|
+
for (const [propertyName, propertyValue] of properties ?? []) {
|
|
553
|
+
tokens.push(propertyName);
|
|
554
|
+
appendObjectProperties({propertyValue} as ContentObject, 3);
|
|
555
|
+
}
|
|
556
|
+
if (traceEvent.userDetail !== null) {
|
|
557
|
+
appendObjectProperties({userDetail: traceEvent.userDetail} as ContentObject, 3);
|
|
558
|
+
}
|
|
559
|
+
}
|
|
545
560
|
if (TimelineUIUtils.getGetDebugModeEnabled()) {
|
|
546
561
|
// When in debug mode append top level properties (like timestamp)
|
|
547
562
|
// and deeply nested properties.
|