chrome-devtools-frontend 1.0.954271 → 1.0.954777
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/front_end/core/i18n/locales/en-US.json +2 -2
- package/front_end/core/i18n/locales/en-XL.json +2 -2
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +6 -0
- package/front_end/panels/console/ConsoleFormat.ts +89 -47
- package/front_end/panels/console/consoleView.css +4 -0
- package/front_end/panels/elements/ElementsTreeElement.ts +1 -1
- package/front_end/panels/elements/elementsTreeOutline.css +5 -9
- package/front_end/panels/profiler/HeapTimelineOverview.ts +1 -1
- package/front_end/panels/sources/SourcesPanel.ts +1 -1
- package/front_end/ui/legacy/Treeoutline.ts +4 -0
- package/front_end/ui/legacy/components/object_ui/objectValue.css +1 -1
- package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +4 -0
- package/front_end/ui/legacy/components/quick_open/QuickOpen.ts +2 -2
- package/package.json +1 -1
|
@@ -11912,8 +11912,8 @@
|
|
|
11912
11912
|
"ui/legacy/components/quick_open/QuickInput.ts | pressEnterToConfirmOrEscapeTo": {
|
|
11913
11913
|
"message": "{PH1} (Press 'Enter' to confirm or 'Escape' to cancel.)"
|
|
11914
11914
|
},
|
|
11915
|
-
"ui/legacy/components/quick_open/QuickOpen.ts |
|
|
11916
|
-
"message": "
|
|
11915
|
+
"ui/legacy/components/quick_open/QuickOpen.ts | typeToSeeAvailableCommands": {
|
|
11916
|
+
"message": "Type '?' to see available commands"
|
|
11917
11917
|
},
|
|
11918
11918
|
"ui/legacy/components/source_frame/FontView.ts | font": {
|
|
11919
11919
|
"message": "Font"
|
|
@@ -11912,8 +11912,8 @@
|
|
|
11912
11912
|
"ui/legacy/components/quick_open/QuickInput.ts | pressEnterToConfirmOrEscapeTo": {
|
|
11913
11913
|
"message": "{PH1} (P̂ŕêśŝ 'Én̂t́êŕ' t̂ó ĉón̂f́îŕm̂ ór̂ 'Éŝćâṕê' t́ô ćâńĉél̂.)"
|
|
11914
11914
|
},
|
|
11915
|
-
"ui/legacy/components/quick_open/QuickOpen.ts |
|
|
11916
|
-
"message": "
|
|
11915
|
+
"ui/legacy/components/quick_open/QuickOpen.ts | typeToSeeAvailableCommands": {
|
|
11916
|
+
"message": "T̂ýp̂é '?' t̂ó ŝéê áv̂áîĺâb́l̂é ĉóm̂ḿâńd̂ś"
|
|
11917
11917
|
},
|
|
11918
11918
|
"ui/legacy/components/source_frame/FontView.ts | font": {
|
|
11919
11919
|
"message": "F̂ón̂t́"
|
|
@@ -120,6 +120,12 @@ export class DebuggerWorkspaceBinding implements SDK.TargetManager.SDKModelObser
|
|
|
120
120
|
if (!compilerMapping) {
|
|
121
121
|
return [];
|
|
122
122
|
}
|
|
123
|
+
if (mode === SDK.DebuggerModel.StepMode.StepOut) {
|
|
124
|
+
// We should actually return the source range for the entire function
|
|
125
|
+
// to skip over. Since we don't have that, we return an empty range
|
|
126
|
+
// instead, to signal that we should perform a regular step-out.
|
|
127
|
+
return [];
|
|
128
|
+
}
|
|
123
129
|
ranges = compilerMapping.getLocationRangesForSameSourceLocation(rawLocation);
|
|
124
130
|
ranges = ranges.filter(range => contained(rawLocation, range));
|
|
125
131
|
return ranges;
|
|
@@ -4,47 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
import type * as SDK from '../../core/sdk/sdk.js';
|
|
6
6
|
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const ANSI_COLOR_CODES = new Map([
|
|
11
|
-
// Foreground codes
|
|
12
|
-
[30, 'color:black'],
|
|
13
|
-
[31, 'color:red'],
|
|
14
|
-
[32, 'color:green'],
|
|
15
|
-
[33, 'color:yellow'],
|
|
16
|
-
[34, 'color:blue'],
|
|
17
|
-
[35, 'color:magenta'],
|
|
18
|
-
[36, 'color:cyan'],
|
|
19
|
-
[37, 'color:lightGray'],
|
|
20
|
-
[39, 'color:default'],
|
|
21
|
-
[90, 'color:darkGray'],
|
|
22
|
-
[91, 'color:lightRed'],
|
|
23
|
-
[92, 'color:lightGreen'],
|
|
24
|
-
[93, 'color:lightYellow'],
|
|
25
|
-
[94, 'color:lightBlue'],
|
|
26
|
-
[95, 'color:lightMagenta'],
|
|
27
|
-
[96, 'color:lightCyan'],
|
|
28
|
-
[97, 'color:white'],
|
|
29
|
-
// Background codes
|
|
30
|
-
[40, 'background:black'],
|
|
31
|
-
[41, 'background:red'],
|
|
32
|
-
[42, 'background:green'],
|
|
33
|
-
[43, 'background:yellow'],
|
|
34
|
-
[44, 'background:blue'],
|
|
35
|
-
[45, 'background:magenta'],
|
|
36
|
-
[46, 'background:cyan'],
|
|
37
|
-
[47, 'background:lightGray'],
|
|
38
|
-
[49, 'background:default'],
|
|
39
|
-
[100, 'background:darkGray'],
|
|
40
|
-
[101, 'background:lightRed'],
|
|
41
|
-
[102, 'background:lightGreen'],
|
|
42
|
-
[103, 'background:lightYellow'],
|
|
43
|
-
[104, 'background:lightBlue'],
|
|
44
|
-
[105, 'background:lightMagenta'],
|
|
45
|
-
[106, 'background:lightCyan'],
|
|
46
|
-
[107, 'background:white'],
|
|
47
|
-
]);
|
|
7
|
+
// VGA color palette
|
|
8
|
+
const ANSI_COLORS = ['#000000', '#AA0000', '#00AA00', '#AA5500', '#0000AA', '#AA00AA', '#00AAAA', '#AAAAAA'];
|
|
9
|
+
const ANSI_BRIGHT_COLORS = ['#555555', '#FF5555', '#55FF55', '#FFFF55', '#5555FF', '#FF55FF', '#55FFFF', '#FFFFFF'];
|
|
48
10
|
|
|
49
11
|
export type FormatToken = {
|
|
50
12
|
type: 'generic'|'optimal',
|
|
@@ -71,6 +33,23 @@ export const format = (fmt: string, args: SDK.RemoteObject.RemoteObject[]): {
|
|
|
71
33
|
} => {
|
|
72
34
|
const tokens: FormatToken[] = [];
|
|
73
35
|
|
|
36
|
+
// Current maintained style for ANSI color codes.
|
|
37
|
+
const currentStyle = new Map<string, string>();
|
|
38
|
+
function addTextDecoration(value: string): void {
|
|
39
|
+
const textDecoration = currentStyle.get('text-decoration') ?? '';
|
|
40
|
+
if (!textDecoration.includes(value)) {
|
|
41
|
+
currentStyle.set('text-decoration', `${textDecoration} ${value}`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function removeTextDecoration(value: string): void {
|
|
45
|
+
const textDecoration = currentStyle.get('text-decoration')?.replace(` ${value}`, '');
|
|
46
|
+
if (textDecoration) {
|
|
47
|
+
currentStyle.set('text-decoration', textDecoration);
|
|
48
|
+
} else {
|
|
49
|
+
currentStyle.delete('text-decoration');
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
74
53
|
function addStringToken(value: string): void {
|
|
75
54
|
if (!value) {
|
|
76
55
|
return;
|
|
@@ -83,7 +62,7 @@ export const format = (fmt: string, args: SDK.RemoteObject.RemoteObject[]): {
|
|
|
83
62
|
}
|
|
84
63
|
|
|
85
64
|
let argIndex = 0;
|
|
86
|
-
const re = /%([%_Oocsdfi])|\x1B\[(\d
|
|
65
|
+
const re = /%([%_Oocsdfi])|\x1B\[([\d;]*)m/;
|
|
87
66
|
for (let match = re.exec(fmt); match !== null; match = re.exec(fmt)) {
|
|
88
67
|
addStringToken(match.input.substring(0, match.index));
|
|
89
68
|
let substitution: number|string|undefined = undefined;
|
|
@@ -134,12 +113,75 @@ export const format = (fmt: string, args: SDK.RemoteObject.RemoteObject[]): {
|
|
|
134
113
|
}
|
|
135
114
|
break;
|
|
136
115
|
case undefined: {
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
|
|
116
|
+
const codes = (match[2] || '0').split(';').map(code => code ? parseInt(code, 10) : 0);
|
|
117
|
+
while (codes.length) {
|
|
118
|
+
const code = codes.shift() as number;
|
|
119
|
+
switch (code) {
|
|
120
|
+
case 0:
|
|
121
|
+
currentStyle.clear();
|
|
122
|
+
break;
|
|
123
|
+
case 1:
|
|
124
|
+
currentStyle.set('font-weight', 'bold');
|
|
125
|
+
break;
|
|
126
|
+
case 2:
|
|
127
|
+
currentStyle.set('font-weight', 'lighter');
|
|
128
|
+
break;
|
|
129
|
+
case 3:
|
|
130
|
+
currentStyle.set('font-style', 'italic');
|
|
131
|
+
break;
|
|
132
|
+
case 4:
|
|
133
|
+
addTextDecoration('underline');
|
|
134
|
+
break;
|
|
135
|
+
case 9:
|
|
136
|
+
addTextDecoration('line-through');
|
|
137
|
+
break;
|
|
138
|
+
case 22:
|
|
139
|
+
currentStyle.delete('font-weight');
|
|
140
|
+
break;
|
|
141
|
+
case 23:
|
|
142
|
+
currentStyle.delete('font-style');
|
|
143
|
+
break;
|
|
144
|
+
case 24:
|
|
145
|
+
removeTextDecoration('underline');
|
|
146
|
+
break;
|
|
147
|
+
case 29:
|
|
148
|
+
removeTextDecoration('line-through');
|
|
149
|
+
break;
|
|
150
|
+
case 38:
|
|
151
|
+
case 48:
|
|
152
|
+
if (codes.shift() === 2) {
|
|
153
|
+
const r = codes.shift() ?? 0, g = codes.shift() ?? 0, b = codes.shift() ?? 0;
|
|
154
|
+
currentStyle.set(code === 38 ? 'color' : 'background', `rgb(${r},${g},${b})`);
|
|
155
|
+
}
|
|
156
|
+
break;
|
|
157
|
+
case 39:
|
|
158
|
+
case 49:
|
|
159
|
+
currentStyle.delete(code === 39 ? 'color' : 'background');
|
|
160
|
+
break;
|
|
161
|
+
case 53:
|
|
162
|
+
addTextDecoration('overline');
|
|
163
|
+
break;
|
|
164
|
+
case 55:
|
|
165
|
+
removeTextDecoration('overline');
|
|
166
|
+
break;
|
|
167
|
+
default: {
|
|
168
|
+
const color = ANSI_COLORS[code - 30] ?? ANSI_BRIGHT_COLORS[code - 90];
|
|
169
|
+
if (color !== undefined) {
|
|
170
|
+
currentStyle.set('color', color);
|
|
171
|
+
} else {
|
|
172
|
+
const background = ANSI_COLORS[code - 40] ?? ANSI_BRIGHT_COLORS[code - 100];
|
|
173
|
+
if (background !== undefined) {
|
|
174
|
+
currentStyle.set('background', background);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
break;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
142
180
|
}
|
|
181
|
+
const value = [...currentStyle.entries()].map(([key, val]) => `${key}:${val.trimStart()}`).join(';');
|
|
182
|
+
const type = 'style';
|
|
183
|
+
tokens.push({type, value});
|
|
184
|
+
substitution = '';
|
|
143
185
|
break;
|
|
144
186
|
}
|
|
145
187
|
}
|
|
@@ -375,6 +375,10 @@
|
|
|
375
375
|
flex-shrink: 0;
|
|
376
376
|
}
|
|
377
377
|
|
|
378
|
+
.console-message-text .object-value-node {
|
|
379
|
+
display: inline-block;
|
|
380
|
+
}
|
|
381
|
+
|
|
378
382
|
.console-message-text .object-value-string,
|
|
379
383
|
.console-message-text .object-value-regexp,
|
|
380
384
|
.console-message-text .object-value-symbol {
|
|
@@ -1334,7 +1334,7 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
1334
1334
|
}
|
|
1335
1335
|
|
|
1336
1336
|
/** Keep it in sync with elementsTreeOutline.css **/
|
|
1337
|
-
return 12 * (depth - 2) + (this.isExpandable() ? 1 : 12);
|
|
1337
|
+
return 12 * (depth - 2) + (this.isExpandable() && this.isCollapsible() ? 1 : 12);
|
|
1338
1338
|
}
|
|
1339
1339
|
|
|
1340
1340
|
updateDecorations(): void {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
.elements-disclosure li {
|
|
37
|
-
/** Keep margin-left & padding-left in sync with ElementsTreeElements.
|
|
37
|
+
/** Keep margin-left & padding-left in sync with ElementsTreeElements.updateDecorations **/
|
|
38
38
|
padding: 1px 0 0 14px;
|
|
39
39
|
margin-left: -2px;
|
|
40
40
|
word-break: normal;
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
min-width: 200px;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
.elements-disclosure li.parent {
|
|
48
|
-
/** Keep it in sync with ElementsTreeElements.
|
|
47
|
+
.elements-disclosure li.parent:not(.always-parent) {
|
|
48
|
+
/** Keep it in sync with ElementsTreeElements.updateDecorations **/
|
|
49
49
|
margin-left: -13px;
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
opacity: 60%;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
.elements-disclosure li.parent::before {
|
|
65
|
+
.elements-disclosure li.parent:not(.always-parent)::before {
|
|
66
66
|
box-sizing: border-box;
|
|
67
67
|
user-select: none;
|
|
68
68
|
-webkit-mask-image: var(--image-file-treeoutlineTriangles);
|
|
@@ -79,10 +79,6 @@
|
|
|
79
79
|
-webkit-mask-position: -16px 0;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
.elements-disclosure li.always-parent::before {
|
|
83
|
-
visibility: hidden;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
82
|
.elements-disclosure li .selection {
|
|
87
83
|
display: none;
|
|
88
84
|
z-index: -1;
|
|
@@ -126,7 +122,7 @@
|
|
|
126
122
|
|
|
127
123
|
.elements-disclosure ol {
|
|
128
124
|
list-style-type: none;
|
|
129
|
-
/** Keep it in sync with ElementsTreeElements.
|
|
125
|
+
/** Keep it in sync with ElementsTreeElements.updateDecorations **/
|
|
130
126
|
padding-inline-start: 12px;
|
|
131
127
|
margin: 0;
|
|
132
128
|
}
|
|
@@ -242,7 +242,7 @@ export class HeapTimelineOverview extends Common.ObjectWrapper.eventMixin<EventT
|
|
|
242
242
|
const maxIndex =
|
|
243
243
|
Platform.ArrayUtilities.upperBound(timestamps, timeRight, Platform.ArrayUtilities.DEFAULT_COMPARATOR);
|
|
244
244
|
let size = 0;
|
|
245
|
-
for (let i = minIndex; i
|
|
245
|
+
for (let i = minIndex; i < maxIndex; ++i) {
|
|
246
246
|
size += sizes[i];
|
|
247
247
|
}
|
|
248
248
|
const minId = minIndex > 0 ? ids[minIndex - 1] : 0;
|
|
@@ -293,7 +293,7 @@ export class SourcesPanel extends UI.Panel.Panel implements UI.ContextMenu.Provi
|
|
|
293
293
|
Extensions.ExtensionServer.ExtensionServer.instance().addEventListener(
|
|
294
294
|
Extensions.ExtensionServer.Events.SidebarPaneAdded, this.extensionSidebarPaneAdded, this);
|
|
295
295
|
SDK.TargetManager.TargetManager.instance().observeTargets(this);
|
|
296
|
-
this.lastModificationTime =
|
|
296
|
+
this.lastModificationTime = -Infinity;
|
|
297
297
|
}
|
|
298
298
|
|
|
299
299
|
static instance(opts: {
|
|
@@ -510,6 +510,10 @@ export class FilteredListWidget extends Common.ObjectWrapper.eventMixin<EventTyp
|
|
|
510
510
|
this.onEnter(keyboardEvent);
|
|
511
511
|
return;
|
|
512
512
|
case Platform.KeyboardUtilities.TAB_KEY:
|
|
513
|
+
if (keyboardEvent.shiftKey) {
|
|
514
|
+
handled = this.list.selectPreviousItem(true, false);
|
|
515
|
+
break;
|
|
516
|
+
}
|
|
513
517
|
handled = this.tabKeyPressed();
|
|
514
518
|
break;
|
|
515
519
|
case Platform.KeyboardUtilities.ArrowKey.UP:
|
|
@@ -12,7 +12,7 @@ const UIStrings = {
|
|
|
12
12
|
/**
|
|
13
13
|
* @description Text of the hint shows under Quick Open input box
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
typeToSeeAvailableCommands: 'Type \'?\' to see available commands',
|
|
16
16
|
};
|
|
17
17
|
const str_ = i18n.i18n.registerUIStrings('ui/legacy/components/quick_open/QuickOpen.ts', UIStrings);
|
|
18
18
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
@@ -43,7 +43,7 @@ export class QuickOpenImpl {
|
|
|
43
43
|
const quickOpen = new this();
|
|
44
44
|
const filteredListWidget = new FilteredListWidget(null, history, quickOpen.queryChanged.bind(quickOpen));
|
|
45
45
|
quickOpen.filteredListWidget = filteredListWidget;
|
|
46
|
-
filteredListWidget.setHintElement(i18nString(UIStrings.
|
|
46
|
+
filteredListWidget.setHintElement(i18nString(UIStrings.typeToSeeAvailableCommands));
|
|
47
47
|
filteredListWidget.showAsDialog();
|
|
48
48
|
filteredListWidget.setQuery(query);
|
|
49
49
|
}
|
package/package.json
CHANGED