chrome-devtools-frontend 1.0.941095 → 1.0.943017
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/WATCHLISTS +1 -1
- package/config/gni/all_devtools_files.gni +0 -62
- package/config/gni/devtools_grd_files.gni +55 -19
- package/config/gni/devtools_image_files.gni +2 -3
- package/front_end/.eslintrc.js +12 -1
- package/front_end/Images/src/feedback_button_icon.svg +3 -0
- package/front_end/Images/src/{feedback_thin_16x16_icon.svg → survey_feedback_icon.svg} +1 -1
- package/front_end/Tests.js +1 -32
- package/front_end/core/common/Color.ts +5 -0
- package/front_end/core/i18n/locales/en-US.json +20 -29
- package/front_end/core/i18n/locales/en-XL.json +20 -29
- package/front_end/core/sdk/CPUProfilerModel.ts +7 -9
- package/front_end/core/sdk/ConsoleModel.ts +26 -28
- package/front_end/core/sdk/DebuggerModel.ts +4 -14
- package/front_end/core/sdk/sdk-meta.ts +17 -3
- package/front_end/entrypoints/devtools_app/devtools_app.json +1 -11
- package/front_end/entrypoints/inspector/inspector.json +1 -3
- package/front_end/entrypoints/js_app/js_app.json +1 -3
- package/front_end/entrypoints/main/MainImpl.ts +26 -0
- package/front_end/entrypoints/node_app/node_app.json +1 -3
- package/front_end/entrypoints/shell/shell.js +0 -11
- package/front_end/entrypoints/shell/shell.json +1 -5
- package/front_end/entrypoints/worker_app/worker_app.json +1 -7
- package/front_end/generated/InspectorBackendCommands.js +19 -0
- package/front_end/generated/protocol-mapping.d.ts +31 -1
- package/front_end/generated/protocol-proxy-api.d.ts +34 -2
- package/front_end/generated/protocol.d.ts +81 -6
- package/front_end/global_typings/global_defs.d.ts +5 -0
- package/front_end/legacy_test_runner/bindings_test_runner/IsolatedFilesystemTestRunner.js +2 -2
- package/front_end/legacy_test_runner/console_test_runner/console_test_runner.js +14 -2
- package/front_end/legacy_test_runner/legacy_test_runner.ts +10 -1
- package/front_end/legacy_test_runner/test_runner/TestRunner.js +11 -0
- package/front_end/models/formatter/SourceFormatter.ts +0 -10
- package/front_end/models/workspace/UISourceCode.ts +9 -42
- package/front_end/panels/animation/AnimationTimeline.ts +3 -3
- package/front_end/panels/application/ApplicationPanelSidebar.ts +3 -3
- package/front_end/panels/application/BackForwardCacheStrings.ts +3 -1
- package/front_end/panels/application/application-meta.ts +0 -3
- package/front_end/panels/application/components/EndpointsGrid.ts +1 -1
- package/front_end/panels/application/components/ReportsGrid.ts +1 -1
- package/front_end/panels/console/ConsolePinPane.ts +21 -26
- package/front_end/panels/coverage/CoverageDecorationManager.ts +4 -5
- package/front_end/panels/coverage/CoverageView.ts +2 -105
- package/front_end/panels/css_overview/components/CSSOverviewStartView.ts +11 -56
- package/front_end/panels/css_overview/components/cssOverviewStartView.css +1 -8
- package/front_end/panels/elements/ElementsTreeElement.ts +4 -9
- package/front_end/panels/elements/components/StylePropertyEditor.ts +2 -0
- package/front_end/panels/elements/components/adornerSettingsPane.css +0 -4
- package/front_end/panels/emulation/DeviceModeToolbar.ts +3 -1
- package/front_end/panels/emulation/DeviceModeView.ts +2 -1
- package/front_end/panels/emulation/InspectedPagePlaceholder.ts +3 -1
- package/front_end/panels/emulation/MediaQueryInspector.ts +3 -1
- package/front_end/panels/emulation/emulation-meta.ts +2 -4
- package/front_end/panels/issues/issues-meta.ts +0 -2
- package/front_end/panels/js_profiler/js_profiler-meta.ts +0 -3
- package/front_end/panels/layers/module.json +0 -1
- package/front_end/panels/lighthouse/LighthousePanel.ts +2 -4
- package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +1 -4
- package/front_end/panels/lighthouse/lighthouseStartView.css +4 -0
- package/front_end/panels/lighthouse/module.json +0 -6
- package/front_end/panels/media/media-meta.ts +0 -3
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +2 -1
- package/front_end/panels/network/network-meta.ts +0 -3
- package/front_end/panels/profiler/CPUProfileView.ts +10 -3
- package/front_end/panels/profiler/profiler-meta.ts +0 -2
- package/front_end/panels/screencast/screencast-meta.ts +0 -3
- package/front_end/panels/security/security-meta.ts +0 -3
- package/front_end/panels/sources/BreakpointEditDialog.ts +16 -30
- package/front_end/panels/sources/CSSPlugin.ts +310 -331
- package/front_end/panels/sources/CallStackSidebarPane.ts +28 -34
- package/front_end/panels/sources/CoveragePlugin.ts +121 -6
- package/front_end/panels/sources/DebuggerPlugin.ts +1166 -1243
- package/front_end/panels/sources/EditingLocationHistoryManager.ts +71 -101
- package/front_end/panels/sources/GoToLineQuickOpen.ts +4 -3
- package/front_end/panels/sources/InplaceFormatterEditorAction.ts +3 -3
- package/front_end/panels/sources/JavaScriptCompilerPlugin.ts +26 -23
- package/front_end/panels/sources/Plugin.ts +20 -4
- package/front_end/panels/sources/ProfilePlugin.ts +185 -0
- package/front_end/panels/sources/ScriptFormatterEditorAction.ts +3 -3
- package/front_end/panels/sources/ScriptOriginPlugin.ts +0 -10
- package/front_end/panels/sources/SnippetsPlugin.ts +1 -10
- package/front_end/panels/sources/SourcesPanel.ts +6 -5
- package/front_end/panels/sources/SourcesView.ts +10 -8
- package/front_end/panels/sources/TabbedEditorContainer.ts +31 -27
- package/front_end/panels/sources/UISourceCodeFrame.ts +335 -470
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +3 -2
- package/front_end/panels/sources/sources-legacy.ts +0 -6
- package/front_end/panels/sources/sources-meta.ts +1 -4
- package/front_end/panels/sources/sources.ts +0 -2
- package/front_end/panels/timeline/timeline-meta.ts +0 -5
- package/front_end/third_party/codemirror.next/bundle.ts +9 -13
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/javascript.js +2 -2
- package/front_end/third_party/codemirror.next/chunk/markdown.js +2 -6
- package/front_end/third_party/codemirror.next/chunk/php.js +2 -6
- package/front_end/third_party/codemirror.next/chunk/python.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/wast.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/xml.js +2 -2
- package/front_end/third_party/codemirror.next/codemirror.next.d.ts +279 -198
- package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
- package/front_end/third_party/codemirror.next/package.json +13 -11
- package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +1128 -1158
- package/front_end/third_party/lighthouse/locales/ar-XB.json +211 -79
- package/front_end/third_party/lighthouse/locales/ar.json +213 -81
- package/front_end/third_party/lighthouse/locales/bg.json +211 -79
- package/front_end/third_party/lighthouse/locales/ca.json +212 -80
- package/front_end/third_party/lighthouse/locales/cs.json +211 -79
- package/front_end/third_party/lighthouse/locales/da.json +211 -79
- package/front_end/third_party/lighthouse/locales/de.json +211 -79
- package/front_end/third_party/lighthouse/locales/el.json +213 -81
- package/front_end/third_party/lighthouse/locales/en-GB.json +211 -79
- package/front_end/third_party/lighthouse/locales/en-US.json +186 -75
- package/front_end/third_party/lighthouse/locales/en-XA.json +211 -79
- package/front_end/third_party/lighthouse/locales/en-XL.json +186 -75
- package/front_end/third_party/lighthouse/locales/es-419.json +211 -79
- package/front_end/third_party/lighthouse/locales/es.json +212 -80
- package/front_end/third_party/lighthouse/locales/fi.json +211 -79
- package/front_end/third_party/lighthouse/locales/fil.json +211 -79
- package/front_end/third_party/lighthouse/locales/fr.json +211 -79
- package/front_end/third_party/lighthouse/locales/he.json +212 -80
- package/front_end/third_party/lighthouse/locales/hi.json +214 -82
- package/front_end/third_party/lighthouse/locales/hr.json +211 -79
- package/front_end/third_party/lighthouse/locales/hu.json +211 -79
- package/front_end/third_party/lighthouse/locales/id.json +211 -79
- package/front_end/third_party/lighthouse/locales/it.json +211 -79
- package/front_end/third_party/lighthouse/locales/ja.json +211 -79
- package/front_end/third_party/lighthouse/locales/ko.json +211 -79
- package/front_end/third_party/lighthouse/locales/lt.json +211 -79
- package/front_end/third_party/lighthouse/locales/lv.json +214 -82
- package/front_end/third_party/lighthouse/locales/nl.json +211 -79
- package/front_end/third_party/lighthouse/locales/no.json +211 -79
- package/front_end/third_party/lighthouse/locales/pl.json +211 -79
- package/front_end/third_party/lighthouse/locales/pt-PT.json +211 -79
- package/front_end/third_party/lighthouse/locales/pt.json +211 -79
- package/front_end/third_party/lighthouse/locales/ro.json +212 -80
- package/front_end/third_party/lighthouse/locales/ru.json +211 -79
- package/front_end/third_party/lighthouse/locales/sk.json +211 -79
- package/front_end/third_party/lighthouse/locales/sl.json +211 -79
- package/front_end/third_party/lighthouse/locales/sr-Latn.json +211 -79
- package/front_end/third_party/lighthouse/locales/sr.json +211 -79
- package/front_end/third_party/lighthouse/locales/sv.json +211 -79
- package/front_end/third_party/lighthouse/locales/ta.json +218 -86
- package/front_end/third_party/lighthouse/locales/te.json +251 -119
- package/front_end/third_party/lighthouse/locales/th.json +211 -79
- package/front_end/third_party/lighthouse/locales/tr.json +211 -79
- package/front_end/third_party/lighthouse/locales/uk.json +212 -80
- package/front_end/third_party/lighthouse/locales/vi.json +211 -79
- package/front_end/third_party/lighthouse/locales/zh-HK.json +211 -79
- package/front_end/third_party/lighthouse/locales/zh-TW.json +211 -79
- package/front_end/third_party/lighthouse/locales/zh.json +211 -79
- package/front_end/third_party/lighthouse/report/bundle.d.ts +72 -34
- package/front_end/third_party/lighthouse/report/bundle.js +698 -492
- package/front_end/third_party/lighthouse/report-assets/report-generator.js +1 -2
- package/front_end/third_party/lighthouse/report-assets/report.js +40 -35
- package/front_end/third_party/lighthouse/report-assets/standalone-template.html +2 -4
- package/front_end/ui/components/code_highlighter/CodeHighlighter.ts +60 -68
- package/front_end/ui/components/data_grid/dataGrid.css +12 -10
- package/front_end/ui/components/docs/css_overview/start_view.html +25 -0
- package/front_end/ui/components/docs/css_overview/start_view.ts +14 -0
- package/front_end/ui/components/docs/icon_button/basic.ts +3 -3
- package/front_end/ui/components/docs/panel_feedback/button.html +25 -0
- package/front_end/ui/components/docs/panel_feedback/button.ts +18 -0
- package/front_end/ui/components/helpers/get-stylesheet.ts +0 -14
- package/front_end/ui/components/markdown_view/MarkdownImagesMap.ts +1 -1
- package/front_end/ui/components/panel_feedback/FeedbackButton.ts +67 -0
- package/front_end/ui/components/panel_feedback/panel_feedback.ts +1 -0
- package/front_end/ui/components/survey_link/SurveyLink.ts +1 -1
- package/front_end/ui/components/text_editor/TextEditor.ts +79 -36
- package/front_end/ui/components/text_editor/config.ts +42 -26
- package/front_end/ui/components/text_editor/javascript.ts +2 -3
- package/front_end/ui/components/text_editor/position.ts +17 -0
- package/front_end/ui/components/text_editor/text_editor.ts +1 -0
- package/front_end/ui/components/text_editor/theme.ts +5 -1
- package/front_end/ui/legacy/Dialog.ts +3 -1
- package/front_end/ui/legacy/DropTarget.ts +2 -1
- package/front_end/ui/legacy/EmptyWidget.ts +2 -1
- package/front_end/ui/legacy/FilterBar.ts +2 -1
- package/front_end/ui/legacy/GlassPane.ts +4 -2
- package/front_end/ui/legacy/Infobar.ts +5 -8
- package/front_end/ui/legacy/InspectorView.ts +6 -1
- package/front_end/ui/legacy/ListWidget.ts +2 -1
- package/front_end/ui/legacy/PopoverHelper.ts +2 -1
- package/front_end/ui/legacy/ProgressIndicator.ts +2 -1
- package/front_end/ui/legacy/RemoteDebuggingTerminatedScreen.ts +2 -1
- package/front_end/ui/legacy/ReportView.ts +2 -1
- package/front_end/ui/legacy/RootView.ts +2 -1
- package/front_end/ui/legacy/SearchableView.ts +2 -1
- package/front_end/ui/legacy/ShortcutRegistry.ts +11 -7
- package/front_end/ui/legacy/SoftContextMenu.ts +2 -1
- package/front_end/ui/legacy/SoftDropDown.ts +4 -2
- package/front_end/ui/legacy/SplitWidget.ts +2 -1
- package/front_end/ui/legacy/SuggestBox.ts +2 -1
- package/front_end/ui/legacy/TabbedPane.ts +2 -1
- package/front_end/ui/legacy/TargetCrashedScreen.ts +2 -1
- package/front_end/ui/legacy/TextPrompt.ts +2 -1
- package/front_end/ui/legacy/Toolbar.ts +3 -2
- package/front_end/ui/legacy/Treeoutline.ts +3 -2
- package/front_end/ui/legacy/UIUtils.ts +16 -13
- package/front_end/ui/legacy/ViewManager.ts +2 -1
- package/front_end/ui/legacy/Widget.ts +1 -1
- package/front_end/ui/legacy/components/object_ui/object_ui-meta.ts +0 -3
- package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +2 -1
- package/front_end/ui/legacy/components/perf_ui/FilmStripView.ts +3 -1
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +2 -1
- package/front_end/ui/legacy/components/perf_ui/LineLevelProfile.ts +35 -131
- package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +2 -1
- package/front_end/ui/legacy/components/perf_ui/TimelineGrid.ts +3 -1
- package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +2 -1
- package/front_end/ui/legacy/components/perf_ui/perf_ui-meta.ts +0 -2
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +2 -2
- package/front_end/ui/legacy/components/source_frame/BinaryResourceViewFactory.ts +3 -6
- package/front_end/ui/legacy/components/source_frame/FontView.ts +1 -0
- package/front_end/ui/legacy/components/source_frame/ImageView.ts +1 -0
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +1 -0
- package/front_end/ui/legacy/components/source_frame/ResourceSourceFrame.ts +19 -14
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +501 -252
- package/front_end/ui/legacy/components/source_frame/XMLView.ts +2 -0
- package/front_end/ui/legacy/components/source_frame/module.json +0 -3
- package/front_end/ui/legacy/components/source_frame/source_frame-legacy.ts +0 -11
- package/front_end/ui/legacy/components/source_frame/source_frame.ts +0 -2
- package/front_end/ui/legacy/components/text_editor/CodeMirrorTextEditor.ts +2 -0
- package/front_end/ui/legacy/components/text_editor/cmdevtools.css +3 -1
- package/front_end/ui/legacy/components/text_editor/module.json +0 -3
- package/front_end/ui/legacy/components/utils/Linkifier.ts +7 -15
- package/front_end/ui/legacy/radioButton.css +1 -13
- package/front_end/ui/legacy/textButton.css +5 -4
- package/front_end/ui/legacy/themeColors.css +36 -0
- package/front_end/ui/legacy/theme_support/theme_support_impl.ts +7 -9
- package/front_end/ui/legacy/utils/append-style.ts +9 -4
- package/front_end/ui/legacy/utils/create-shadow-root-with-core-styles.ts +2 -2
- package/front_end/ui/legacy/utils/inject-core-styles.ts +7 -4
- package/package.json +1 -1
- package/scripts/build/generate_css_js_files.js +23 -9
- package/scripts/build/ninja/generate_css.gni +10 -1
- package/scripts/eslint_rules/lib/check_css_import.js +2 -2
- package/scripts/eslint_rules/tests/check_css_import_test.js +12 -0
- package/front_end/Images/radioDot-dark-theme.png +0 -0
- package/front_end/Images/radioDot.png +0 -0
- package/front_end/emulated_devices/module.json +0 -6
- package/front_end/panels/application/module.json +0 -7
- package/front_end/panels/emulation/module.json +0 -11
- package/front_end/panels/issues/module.json +0 -6
- package/front_end/panels/js_profiler/module.json +0 -5
- package/front_end/panels/layer_viewer/module.json +0 -6
- package/front_end/panels/media/module.json +0 -6
- package/front_end/panels/network/module.json +0 -6
- package/front_end/panels/profiler/module.json +0 -6
- package/front_end/panels/screencast/module.json +0 -6
- package/front_end/panels/security/module.json +0 -5
- package/front_end/panels/timeline/module.json +0 -8
- package/front_end/third_party/lighthouse/report-assets/report.css +0 -1774
- package/front_end/ui/legacy/components/perf_ui/module.json +0 -13
- package/front_end/ui/legacy/components/source_frame/SourcesTextEditor.ts +0 -1030
- package/front_end/ui/legacy/module.json +0 -41
|
@@ -481,7 +481,8 @@ export class SourcesPanel extends UI.Panel.Panel implements UI.ContextMenu.Provi
|
|
|
481
481
|
} else {
|
|
482
482
|
this.showEditor();
|
|
483
483
|
}
|
|
484
|
-
this.sourcesViewInternal.showSourceLocation(
|
|
484
|
+
this.sourcesViewInternal.showSourceLocation(
|
|
485
|
+
uiSourceCode, lineNumber === undefined ? undefined : {lineNumber, columnNumber}, omitFocus);
|
|
485
486
|
}
|
|
486
487
|
|
|
487
488
|
private showEditor(): void {
|
|
@@ -534,8 +535,7 @@ export class SourcesPanel extends UI.Panel.Panel implements UI.ContextMenu.Provi
|
|
|
534
535
|
if (window.performance.now() - this.lastModificationTime < lastModificationTimeout) {
|
|
535
536
|
return;
|
|
536
537
|
}
|
|
537
|
-
this.sourcesViewInternal.showSourceLocation(
|
|
538
|
-
uiLocation.uiSourceCode, uiLocation.lineNumber, uiLocation.columnNumber, undefined, true);
|
|
538
|
+
this.sourcesViewInternal.showSourceLocation(uiLocation.uiSourceCode, uiLocation, undefined, true);
|
|
539
539
|
}
|
|
540
540
|
|
|
541
541
|
private lastModificationTimeoutPassedForTest(): void {
|
|
@@ -825,7 +825,7 @@ export class SourcesPanel extends UI.Panel.Panel implements UI.ContextMenu.Provi
|
|
|
825
825
|
if (!(target instanceof UISourceCodeFrame)) {
|
|
826
826
|
return;
|
|
827
827
|
}
|
|
828
|
-
if (target.uiSourceCode().contentType().isFromSourceMap() || target.textEditor.selection
|
|
828
|
+
if (target.uiSourceCode().contentType().isFromSourceMap() || target.textEditor.state.selection.main.empty) {
|
|
829
829
|
return;
|
|
830
830
|
}
|
|
831
831
|
contextMenu.debugSection().appendAction('debugger.evaluate-selection');
|
|
@@ -1312,7 +1312,8 @@ export class DebuggingActionDelegate implements UI.ActionRegistration.ActionDele
|
|
|
1312
1312
|
case 'debugger.evaluate-selection': {
|
|
1313
1313
|
const frame = UI.Context.Context.instance().flavor(UISourceCodeFrame);
|
|
1314
1314
|
if (frame) {
|
|
1315
|
-
|
|
1315
|
+
const {state: editorState} = frame.textEditor;
|
|
1316
|
+
let text = editorState.sliceDoc(editorState.selection.main.from, editorState.selection.main.to);
|
|
1316
1317
|
const executionContext = UI.Context.Context.instance().flavor(SDK.RuntimeModel.ExecutionContext);
|
|
1317
1318
|
if (executionContext) {
|
|
1318
1319
|
const message = SDK.ConsoleModel.ConsoleModel.instance().addCommandMessage(executionContext, text);
|
|
@@ -84,7 +84,7 @@ export class SourcesView extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
84
84
|
this.editorContainer.addEventListener(TabbedEditorContainerEvents.EditorSelected, this.editorSelected, this);
|
|
85
85
|
this.editorContainer.addEventListener(TabbedEditorContainerEvents.EditorClosed, this.editorClosed, this);
|
|
86
86
|
|
|
87
|
-
this.historyManager = new EditingLocationHistoryManager(this
|
|
87
|
+
this.historyManager = new EditingLocationHistoryManager(this);
|
|
88
88
|
|
|
89
89
|
this.toolbarContainerElementInternal = this.element.createChild('div', 'sources-toolbar');
|
|
90
90
|
if (!Root.Runtime.experiments.isEnabled('sourcesPrettyPrint')) {
|
|
@@ -350,15 +350,18 @@ export class SourcesView extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
350
350
|
}
|
|
351
351
|
|
|
352
352
|
showSourceLocation(
|
|
353
|
-
uiSourceCode: Workspace.UISourceCode.UISourceCode,
|
|
353
|
+
uiSourceCode: Workspace.UISourceCode.UISourceCode, location?: {lineNumber: number, columnNumber?: number}|number,
|
|
354
354
|
omitFocus?: boolean, omitHighlight?: boolean): void {
|
|
355
|
-
this.
|
|
355
|
+
const currentFrame = this.currentSourceFrame();
|
|
356
|
+
if (currentFrame) {
|
|
357
|
+
this.historyManager.updateCurrentState(
|
|
358
|
+
currentFrame.uiSourceCode(), currentFrame.textEditor.state.selection.main.head);
|
|
359
|
+
}
|
|
356
360
|
this.editorContainer.showFile(uiSourceCode);
|
|
357
361
|
const currentSourceFrame = this.currentSourceFrame();
|
|
358
|
-
if (currentSourceFrame &&
|
|
359
|
-
currentSourceFrame.revealPosition(
|
|
362
|
+
if (currentSourceFrame && location) {
|
|
363
|
+
currentSourceFrame.revealPosition(location, !omitHighlight);
|
|
360
364
|
}
|
|
361
|
-
this.historyManager.pushNewState();
|
|
362
365
|
const visibleView = this.visibleView();
|
|
363
366
|
if (!omitFocus && visibleView) {
|
|
364
367
|
visibleView.focus();
|
|
@@ -440,8 +443,7 @@ export class SourcesView extends Common.ObjectWrapper.eventMixin<EventTypes, typ
|
|
|
440
443
|
currentSourceFrame.setSearchableView(this.searchableViewInternal);
|
|
441
444
|
}
|
|
442
445
|
|
|
443
|
-
this.searchableViewInternal.setReplaceable(
|
|
444
|
-
Boolean(currentSourceFrame) && (currentSourceFrame ? currentSourceFrame.canEditSource() : false));
|
|
446
|
+
this.searchableViewInternal.setReplaceable(Boolean(currentSourceFrame?.canEditSource()));
|
|
445
447
|
this.searchableViewInternal.refreshSearch();
|
|
446
448
|
this.updateToolbarChangedListener();
|
|
447
449
|
this.updateScriptViewToolbarItems();
|
|
@@ -35,6 +35,7 @@ import * as Extensions from '../../models/extensions/extensions.js';
|
|
|
35
35
|
import * as Persistence from '../../models/persistence/persistence.js';
|
|
36
36
|
import * as TextUtils from '../../models/text_utils/text_utils.js';
|
|
37
37
|
import * as Workspace from '../../models/workspace/workspace.js';
|
|
38
|
+
import type * as CodeMirror from '../../third_party/codemirror.next/codemirror.next.js';
|
|
38
39
|
import * as SourceFrame from '../../ui/legacy/components/source_frame/source_frame.js';
|
|
39
40
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
40
41
|
import * as Snippets from '../snippets/snippets.js';
|
|
@@ -220,45 +221,48 @@ export class TabbedEditorContainer extends Common.ObjectWrapper.ObjectWrapper<Ev
|
|
|
220
221
|
if (!this.currentView || !(this.currentView instanceof SourceFrame.SourceFrame.SourceFrameImpl)) {
|
|
221
222
|
return;
|
|
222
223
|
}
|
|
223
|
-
this.currentView.
|
|
224
|
-
|
|
225
|
-
this.currentView.textEditor.addEventListener(
|
|
226
|
-
SourceFrame.SourcesTextEditor.Events.SelectionChanged, this.selectionChanged, this);
|
|
224
|
+
this.currentView.addEventListener(SourceFrame.SourceFrame.Events.EditorUpdate, this.onEditorUpdate, this);
|
|
225
|
+
this.currentView.addEventListener(SourceFrame.SourceFrame.Events.EditorScroll, this.onScrollChanged, this);
|
|
227
226
|
}
|
|
228
227
|
|
|
229
228
|
private removeViewListeners(): void {
|
|
230
229
|
if (!this.currentView || !(this.currentView instanceof SourceFrame.SourceFrame.SourceFrameImpl)) {
|
|
231
230
|
return;
|
|
232
231
|
}
|
|
233
|
-
this.currentView.
|
|
234
|
-
|
|
235
|
-
this.currentView.textEditor.removeEventListener(
|
|
236
|
-
SourceFrame.SourcesTextEditor.Events.SelectionChanged, this.selectionChanged, this);
|
|
232
|
+
this.currentView.removeEventListener(SourceFrame.SourceFrame.Events.EditorUpdate, this.onEditorUpdate, this);
|
|
233
|
+
this.currentView.removeEventListener(SourceFrame.SourceFrame.Events.EditorScroll, this.onScrollChanged, this);
|
|
237
234
|
}
|
|
238
235
|
|
|
239
|
-
private
|
|
240
|
-
if (this.
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
236
|
+
private onScrollChanged(): void {
|
|
237
|
+
if (this.currentView instanceof SourceFrame.SourceFrame.SourceFrameImpl) {
|
|
238
|
+
if (this.scrollTimer) {
|
|
239
|
+
clearTimeout(this.scrollTimer);
|
|
240
|
+
}
|
|
241
|
+
this.scrollTimer = window.setTimeout(() => this.history.save(this.previouslyViewedFilesSetting), 100);
|
|
242
|
+
if (this.currentFileInternal) {
|
|
243
|
+
const {editor} = this.currentView.textEditor;
|
|
244
|
+
const topBlock = editor.blockAtHeight(editor.scrollDOM.getBoundingClientRect().top);
|
|
245
|
+
const topLine = editor.state.doc.lineAt(topBlock.from).number - 1;
|
|
246
|
+
this.history.updateScrollLineNumber(this.currentFileInternal.url(), topLine);
|
|
247
|
+
}
|
|
250
248
|
}
|
|
251
249
|
}
|
|
252
250
|
|
|
253
|
-
private
|
|
254
|
-
if (
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
251
|
+
private onEditorUpdate({data: update}: Common.EventTarget.EventTargetEvent<CodeMirror.ViewUpdate>): void {
|
|
252
|
+
if (update.docChanged || update.selectionSet) {
|
|
253
|
+
const {main} = update.state.selection;
|
|
254
|
+
const lineFrom = update.state.doc.lineAt(main.from), lineTo = update.state.doc.lineAt(main.to);
|
|
255
|
+
const range = new TextUtils.TextRange.TextRange(
|
|
256
|
+
lineFrom.number - 1, main.from - lineFrom.from, lineTo.number - 1, main.to - lineTo.from);
|
|
257
|
+
if (this.currentFileInternal) {
|
|
258
|
+
this.history.updateSelectionRange(this.currentFileInternal.url(), range);
|
|
259
|
+
}
|
|
260
|
+
this.history.save(this.previouslyViewedFilesSetting);
|
|
258
261
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
+
if (this.currentFileInternal) {
|
|
263
|
+
Extensions.ExtensionServer.ExtensionServer.instance().sourceSelectionChanged(
|
|
264
|
+
this.currentFileInternal.url(), range);
|
|
265
|
+
}
|
|
262
266
|
}
|
|
263
267
|
}
|
|
264
268
|
|