chrome-devtools-frontend 1.0.946920 → 1.0.947377
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/.eslintrc.js +1 -0
- package/config/gni/all_devtools_files.gni +0 -7
- package/config/gni/devtools_grd_files.gni +1 -3
- package/front_end/.eslintrc.js +5 -1
- package/front_end/core/host/InspectorFrontendHost.ts +0 -3
- package/front_end/core/root/Runtime.ts +0 -4
- package/front_end/core/sdk/AccessibilityModel.ts +0 -2
- package/front_end/core/sdk/CSSProperty.ts +0 -2
- package/front_end/core/sdk/CSSRule.ts +0 -2
- package/front_end/core/sdk/Cookie.ts +1 -5
- package/front_end/core/sdk/EmulationModel.ts +0 -2
- package/front_end/core/sdk/HeapProfilerModel.ts +0 -2
- package/front_end/core/sdk/NetworkManager.ts +0 -3
- package/front_end/core/sdk/Resource.ts +0 -3
- package/front_end/core/sdk/ResourceTreeModel.ts +0 -3
- package/front_end/core/sdk/ServiceWorkerManager.ts +0 -2
- package/front_end/entrypoints/devtools_app/devtools_app.json +0 -1
- package/front_end/entrypoints/inspector/{inspector.js → inspector.ts} +0 -3
- package/front_end/entrypoints/worker_app/{worker_app.js → worker_app.ts} +5 -2
- package/front_end/generated/InspectorBackendCommands.js +5 -1
- package/front_end/generated/protocol.d.ts +12 -0
- package/front_end/models/bindings/CompilerScriptMapping.ts +0 -1
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +4 -11
- package/front_end/models/bindings/SASSSourceMapping.ts +0 -1
- package/front_end/models/emulation/DeviceModeModel.ts +0 -2
- package/front_end/models/issues_manager/CorsIssue.ts +8 -0
- package/front_end/panels/animation/AnimationTimeline.ts +0 -2
- package/front_end/panels/animation/AnimationUI.ts +0 -2
- package/front_end/panels/application/BackForwardCacheStrings.ts +1 -0
- package/front_end/panels/css_overview/CSSOverviewModel.ts +0 -2
- package/front_end/panels/css_overview/CSSOverviewPanel.ts +0 -7
- package/front_end/panels/css_overview/CSSOverviewProcessingView.ts +0 -2
- package/front_end/panels/issues/CorsIssueDetailsView.ts +6 -2
- package/front_end/panels/lighthouse/lighthouse-meta.ts +0 -3
- package/front_end/panels/search/SearchView.ts +24 -4
- package/front_end/panels/sources/CSSPlugin.ts +3 -0
- package/front_end/panels/sources/CoveragePlugin.ts +2 -0
- package/front_end/panels/sources/DebuggerPlugin.ts +28 -4
- package/front_end/panels/sources/JavaScriptCompilerPlugin.ts +3 -0
- package/front_end/panels/sources/ProfilePlugin.ts +3 -0
- package/front_end/panels/sources/UISourceCodeFrame.ts +11 -2
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/cpp.js +1 -2
- package/front_end/third_party/codemirror.next/chunk/java.js +1 -2
- package/front_end/third_party/codemirror.next/chunk/json.js +1 -2
- package/front_end/third_party/codemirror.next/chunk/markdown.js +1 -2
- package/front_end/third_party/codemirror.next/chunk/php.js +1 -2
- package/front_end/third_party/codemirror.next/chunk/python.js +1 -2
- package/front_end/third_party/codemirror.next/chunk/wast.js +1 -2
- package/front_end/third_party/codemirror.next/chunk/xml.js +1 -2
- package/front_end/third_party/codemirror.next/codemirror.next.js +1 -2
- package/front_end/third_party/codemirror.next/package.json +1 -0
- package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +168 -164
- package/front_end/third_party/lighthouse/locales/ar-XB.json +0 -3
- package/front_end/third_party/lighthouse/locales/ar.json +0 -3
- package/front_end/third_party/lighthouse/locales/bg.json +17 -20
- package/front_end/third_party/lighthouse/locales/ca.json +0 -3
- package/front_end/third_party/lighthouse/locales/cs.json +0 -3
- package/front_end/third_party/lighthouse/locales/da.json +16 -19
- package/front_end/third_party/lighthouse/locales/de.json +0 -3
- package/front_end/third_party/lighthouse/locales/el.json +0 -3
- package/front_end/third_party/lighthouse/locales/en-GB.json +19 -22
- package/front_end/third_party/lighthouse/locales/en-US.json +33 -3
- package/front_end/third_party/lighthouse/locales/en-XA.json +0 -3
- package/front_end/third_party/lighthouse/locales/en-XL.json +33 -3
- package/front_end/third_party/lighthouse/locales/es-419.json +17 -20
- package/front_end/third_party/lighthouse/locales/es.json +0 -3
- package/front_end/third_party/lighthouse/locales/fi.json +16 -19
- package/front_end/third_party/lighthouse/locales/fil.json +33 -36
- package/front_end/third_party/lighthouse/locales/fr.json +16 -19
- package/front_end/third_party/lighthouse/locales/he.json +16 -19
- package/front_end/third_party/lighthouse/locales/hi.json +0 -3
- package/front_end/third_party/lighthouse/locales/hr.json +16 -19
- package/front_end/third_party/lighthouse/locales/hu.json +16 -19
- package/front_end/third_party/lighthouse/locales/id.json +16 -19
- package/front_end/third_party/lighthouse/locales/it.json +37 -40
- package/front_end/third_party/lighthouse/locales/ja.json +16 -19
- package/front_end/third_party/lighthouse/locales/ko.json +16 -19
- package/front_end/third_party/lighthouse/locales/lt.json +17 -20
- package/front_end/third_party/lighthouse/locales/lv.json +0 -3
- package/front_end/third_party/lighthouse/locales/nl.json +16 -19
- package/front_end/third_party/lighthouse/locales/no.json +17 -20
- package/front_end/third_party/lighthouse/locales/pl.json +16 -19
- package/front_end/third_party/lighthouse/locales/pt-PT.json +37 -40
- package/front_end/third_party/lighthouse/locales/pt.json +16 -19
- package/front_end/third_party/lighthouse/locales/ro.json +0 -3
- package/front_end/third_party/lighthouse/locales/ru.json +16 -19
- package/front_end/third_party/lighthouse/locales/sk.json +0 -3
- package/front_end/third_party/lighthouse/locales/sl.json +0 -3
- package/front_end/third_party/lighthouse/locales/sr-Latn.json +16 -19
- package/front_end/third_party/lighthouse/locales/sr.json +16 -19
- package/front_end/third_party/lighthouse/locales/sv.json +17 -20
- package/front_end/third_party/lighthouse/locales/ta.json +0 -3
- package/front_end/third_party/lighthouse/locales/te.json +0 -3
- package/front_end/third_party/lighthouse/locales/th.json +0 -3
- package/front_end/third_party/lighthouse/locales/tr.json +0 -3
- package/front_end/third_party/lighthouse/locales/uk.json +17 -20
- package/front_end/third_party/lighthouse/locales/vi.json +0 -3
- package/front_end/third_party/lighthouse/locales/zh-HK.json +0 -3
- package/front_end/third_party/lighthouse/locales/zh-TW.json +0 -3
- package/front_end/third_party/lighthouse/locales/zh.json +0 -3
- package/front_end/third_party/lighthouse/report/bundle.d.ts +63 -61
- package/front_end/third_party/lighthouse/report/bundle.js +36 -7
- package/front_end/third_party/lighthouse/report-assets/report-generator.js +205 -192
- package/front_end/ui/components/text_editor/config.ts +5 -4
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +40 -32
- package/front_end/ui/legacy/themeColors.css +1 -1
- package/package.json +1 -1
- package/scripts/check_gn.js +1 -1
- package/scripts/eslint_rules/lib/l10n_filename_matches.js +4 -4
- package/scripts/eslint_rules/tests/l10n_filename_matches_test.js +4 -0
- package/front_end/entrypoints/inspector/inspector.json +0 -4
- package/front_end/entrypoints/worker_app/worker_app.json +0 -3
- package/front_end/panels/lighthouse/module.json +0 -6
- package/front_end/third_party/lighthouse/report-assets/report.d.ts +0 -1
- package/front_end/third_party/lighthouse/report-assets/report.js +0 -233
- package/front_end/third_party/lighthouse/report-assets/standalone-template.html +0 -38
|
@@ -207,7 +207,9 @@ export class CorsIssueDetailsView extends AffectedResourcesView {
|
|
|
207
207
|
IssuesManager.CorsIssue.IssueCode.PreflightInvalidAllowExternal|
|
|
208
208
|
IssuesManager.CorsIssue.IssueCode.InvalidResponse|
|
|
209
209
|
IssuesManager.CorsIssue.IssueCode.InvalidPrivateNetworkAccess|
|
|
210
|
-
IssuesManager.CorsIssue.IssueCode.UnexpectedPrivateNetworkAccess
|
|
210
|
+
IssuesManager.CorsIssue.IssueCode.UnexpectedPrivateNetworkAccess|
|
|
211
|
+
IssuesManager.CorsIssue.IssueCode.PreflightMissingAllowPrivateNetwork|
|
|
212
|
+
IssuesManager.CorsIssue.IssueCode.PreflightInvalidAllowPrivateNetwork>(issueCode);
|
|
211
213
|
}
|
|
212
214
|
|
|
213
215
|
this.affectedResources.appendChild(header);
|
|
@@ -433,7 +435,9 @@ export class CorsIssueDetailsView extends AffectedResourcesView {
|
|
|
433
435
|
IssuesManager.CorsIssue.IssueCode.PreflightInvalidAllowExternal|
|
|
434
436
|
IssuesManager.CorsIssue.IssueCode.InvalidResponse|
|
|
435
437
|
IssuesManager.CorsIssue.IssueCode.InvalidPrivateNetworkAccess|
|
|
436
|
-
IssuesManager.CorsIssue.IssueCode.UnexpectedPrivateNetworkAccess
|
|
438
|
+
IssuesManager.CorsIssue.IssueCode.UnexpectedPrivateNetworkAccess|
|
|
439
|
+
IssuesManager.CorsIssue.IssueCode.PreflightMissingAllowPrivateNetwork|
|
|
440
|
+
IssuesManager.CorsIssue.IssueCode.PreflightInvalidAllowPrivateNetwork>(issueCode);
|
|
437
441
|
break;
|
|
438
442
|
}
|
|
439
443
|
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
6
|
-
import * as Root from '../../core/root/root.js';
|
|
7
6
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
8
7
|
|
|
9
8
|
import type * as Lighthouse from './lighthouse.js';
|
|
@@ -22,8 +21,6 @@ let loadedLighthouseModule: (typeof Lighthouse|undefined);
|
|
|
22
21
|
|
|
23
22
|
async function loadLighthouseModule(): Promise<typeof Lighthouse> {
|
|
24
23
|
if (!loadedLighthouseModule) {
|
|
25
|
-
// Side-effect import resources in module.json
|
|
26
|
-
await Root.Runtime.Runtime.instance().loadModulePromise('panels/lighthouse');
|
|
27
24
|
loadedLighthouseModule = await import('./lighthouse.js');
|
|
28
25
|
}
|
|
29
26
|
return loadedLighthouseModule;
|
|
@@ -432,18 +432,38 @@ export class SearchView extends UI.Widget.VBox {
|
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
434
|
|
|
435
|
+
/**
|
|
436
|
+
* Handles keydown event on panel itself for handling expand/collapse all shortcut
|
|
437
|
+
*
|
|
438
|
+
* We use `event.code` instead of `event.key` here to check whether the shortcut is triggered.
|
|
439
|
+
* The reason is, `event.key` is dependent on the modification keys, locale and keyboard layout.
|
|
440
|
+
* Usually it is useful when we care about the character that needs to be printed.
|
|
441
|
+
*
|
|
442
|
+
* However, our aim in here is to assign a shortcut to the physical key combination on the keyboard
|
|
443
|
+
* not on the character that the key combination prints.
|
|
444
|
+
*
|
|
445
|
+
* For example, `Cmd + [` shortcut in global shortcuts map to focusing on previous panel.
|
|
446
|
+
* In Turkish - Q keyboard layout, the key combination that triggers the shortcut prints `ğ`
|
|
447
|
+
* character. Whereas in Turkish - Q Legacy keyboard layout, the shortcut that triggers focusing
|
|
448
|
+
* on previous panel prints `[` character. So, if we use `event.key` and check
|
|
449
|
+
* whether it is `[`, we break the shortcut in Turkish - Q keyboard layout.
|
|
450
|
+
*
|
|
451
|
+
* @param event KeyboardEvent
|
|
452
|
+
*/
|
|
435
453
|
private onKeyDownOnPanel(event: KeyboardEvent): void {
|
|
436
454
|
const isMac = Host.Platform.isMac();
|
|
437
455
|
// "Command + Alt + ]" for Mac
|
|
438
|
-
const shouldShowAllForMac =
|
|
456
|
+
const shouldShowAllForMac =
|
|
457
|
+
isMac && event.metaKey && !event.ctrlKey && event.altKey && event.code === 'BracketRight';
|
|
439
458
|
// "Ctrl + Shift + }" for other platforms
|
|
440
459
|
const shouldShowAllForOtherPlatforms =
|
|
441
|
-
!isMac && event.ctrlKey && !event.metaKey && event.shiftKey && event.
|
|
460
|
+
!isMac && event.ctrlKey && !event.metaKey && event.shiftKey && event.code === 'BracketRight';
|
|
442
461
|
// "Command + Alt + [" for Mac
|
|
443
|
-
const shouldCollapseAllForMac =
|
|
462
|
+
const shouldCollapseAllForMac =
|
|
463
|
+
isMac && event.metaKey && !event.ctrlKey && event.altKey && event.code === 'BracketLeft';
|
|
444
464
|
// "Command + Alt + {" for other platforms
|
|
445
465
|
const shouldCollapseAllForOtherPlatforms =
|
|
446
|
-
!isMac && event.ctrlKey && !event.metaKey && event.shiftKey && event.
|
|
466
|
+
!isMac && event.ctrlKey && !event.metaKey && event.shiftKey && event.code === 'BracketLeft';
|
|
447
467
|
|
|
448
468
|
if (shouldShowAllForMac || shouldShowAllForOtherPlatforms) {
|
|
449
469
|
this.searchResultsPane?.showAllMatches();
|
|
@@ -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
|
|
172
|
-
//
|
|
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) {
|
|
@@ -685,6 +702,8 @@ export class DebuggerPlugin extends Plugin {
|
|
|
685
702
|
|
|
686
703
|
private onEditorUpdate(update: CodeMirror.ViewUpdate): void {
|
|
687
704
|
if (!update.changes.empty) {
|
|
705
|
+
// If the document changed, adjust known breakpoint positions
|
|
706
|
+
// for that change
|
|
688
707
|
for (const breakpointDesc of this.breakpoints) {
|
|
689
708
|
breakpointDesc.position = update.changes.mapPos(breakpointDesc.position);
|
|
690
709
|
}
|
|
@@ -811,6 +830,7 @@ export class DebuggerPlugin extends Plugin {
|
|
|
811
830
|
dialog.focusEditor();
|
|
812
831
|
}
|
|
813
832
|
|
|
833
|
+
// Create decorations to indicate the current debugging position
|
|
814
834
|
private computeExecutionDecorations(editorState: CodeMirror.EditorState, lineNumber: number, columnNumber: number):
|
|
815
835
|
CodeMirror.DecorationSet {
|
|
816
836
|
const {doc} = editorState;
|
|
@@ -957,6 +977,8 @@ export class DebuggerPlugin extends Plugin {
|
|
|
957
977
|
return namesPerLine;
|
|
958
978
|
}
|
|
959
979
|
|
|
980
|
+
// Highlight the locations the debugger can continue to (when
|
|
981
|
+
// Control is held)
|
|
960
982
|
private async showContinueToLocations(): Promise<void> {
|
|
961
983
|
this.popoverHelper.hidePopover();
|
|
962
984
|
const executionContext = UI.Context.Context.instance().flavor(SDK.RuntimeModel.ExecutionContext);
|
|
@@ -1098,6 +1120,8 @@ export class DebuggerPlugin extends Plugin {
|
|
|
1098
1120
|
return this.breakpoints.filter(b => b.position >= line.from && b.position <= line.to).map(b => b.breakpoint);
|
|
1099
1121
|
}
|
|
1100
1122
|
|
|
1123
|
+
// Compute the decorations for existing breakpoints (both on the
|
|
1124
|
+
// gutter and inline in the code)
|
|
1101
1125
|
private async computeBreakpointDecoration(state: CodeMirror.EditorState, breakpoints: BreakpointDescription[]):
|
|
1102
1126
|
Promise<BreakpointDecoration> {
|
|
1103
1127
|
const decorations: CodeMirror.Range<CodeMirror.Decoration>[] = [];
|
|
@@ -1520,7 +1544,7 @@ export class DebuggerPlugin extends Plugin {
|
|
|
1520
1544
|
}
|
|
1521
1545
|
}
|
|
1522
1546
|
|
|
1523
|
-
// Infobar panel state
|
|
1547
|
+
// Infobar panel state, used to show additional panels below the editor.
|
|
1524
1548
|
|
|
1525
1549
|
const addInfobar = CodeMirror.StateEffect.define<UI.Infobar.Infobar>();
|
|
1526
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();
|