chrome-devtools-frontend 1.0.945579 → 1.0.946920
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/config/gni/all_devtools_files.gni +0 -7
- package/config/gni/devtools_grd_files.gni +3 -39
- package/front_end/core/host/InspectorFrontendHostAPI.ts +0 -1
- package/front_end/core/host/UserMetrics.ts +0 -22
- package/front_end/core/i18n/locales/en-US.json +33 -27
- package/front_end/core/i18n/locales/en-XL.json +33 -27
- package/front_end/core/root/Runtime.ts +0 -1
- package/front_end/core/sdk/CSSProperty.ts +16 -9
- package/front_end/core/sdk/sdk-meta.ts +20 -8
- package/front_end/devtools_compatibility.js +1 -8
- package/front_end/entrypoints/devtools_app/devtools_app.js +3 -0
- package/front_end/entrypoints/devtools_app/devtools_app.json +1 -2
- package/front_end/entrypoints/formatter_worker/CSSFormatter.ts +1 -3
- package/front_end/entrypoints/formatter_worker/FormatterActions.ts +0 -2
- package/front_end/entrypoints/formatter_worker/FormatterWorker.ts +0 -120
- package/front_end/entrypoints/formatter_worker/formatter_worker-entrypoint.ts +1 -11
- package/front_end/entrypoints/formatter_worker/formatter_worker.ts +5 -0
- package/front_end/entrypoints/js_app/js_app.js +3 -0
- package/front_end/entrypoints/js_app/js_app.json +1 -2
- package/front_end/entrypoints/main/MainImpl.ts +0 -6
- package/front_end/entrypoints/ndb_app/ndb_app.js +3 -0
- package/front_end/entrypoints/ndb_app/ndb_app.json +1 -2
- package/front_end/entrypoints/{node_main → node_app}/NodeConnectionsPanel.ts +1 -1
- package/front_end/entrypoints/{node_main → node_app}/NodeMain.ts +2 -4
- package/front_end/entrypoints/{node_main → node_app}/nodeConnectionsPanel.css +0 -0
- package/front_end/entrypoints/node_app/node_app.ts +81 -0
- package/front_end/entrypoints/shell/shell.js +18 -1
- package/front_end/entrypoints/worker_app/worker_app.js +3 -0
- package/front_end/entrypoints/worker_app/worker_app.json +1 -2
- package/front_end/legacy_test_runner/sources_test_runner/sources_test_runner.js +0 -1
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +1 -1
- package/front_end/models/bindings/ResourceMapping.ts +1 -1
- package/front_end/models/formatter/FormatterWorkerPool.ts +0 -18
- package/front_end/models/text_utils/CodeMirrorUtils.ts +6 -51
- package/front_end/models/text_utils/TextUtils.ts +1 -2
- package/front_end/models/text_utils/text_utils-legacy.ts +0 -5
- package/front_end/panels/animation/AnimationTimeline.ts +1 -1
- package/front_end/panels/application/ApplicationPanelSidebar.ts +2 -4
- package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +0 -11
- package/front_end/panels/elements/StylesSidebarPane.ts +0 -1
- package/front_end/panels/elements/elementsTreeOutline.css +0 -13
- package/front_end/panels/emulation/DeviceModeToolbar.ts +0 -16
- package/front_end/panels/network/NetworkConfigView.ts +10 -0
- package/front_end/panels/network/NetworkItemView.ts +10 -1
- package/front_end/panels/network/networkConfigView.css +5 -0
- package/front_end/panels/profiler/heapProfiler.css +2 -5
- package/front_end/panels/profiler/profilesPanel.css +1 -1
- package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +6 -4
- package/front_end/panels/settings/emulation/components/userAgentClientHintsForm.css +0 -12
- package/front_end/panels/sources/DebuggerPlugin.ts +7 -3
- package/front_end/panels/sources/sourcesView.css +0 -130
- package/front_end/panels/timeline/TimelineTreeView.ts +1 -0
- package/front_end/panels/webauthn/WebauthnPane.ts +31 -32
- package/front_end/third_party/codemirror/codemirror-tsconfig.json +1 -25
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/codemirror.next.d.ts +1486 -1423
- package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
- package/front_end/third_party/codemirror.next/package.json +9 -9
- package/front_end/ui/components/buttons/Button.ts +17 -0
- package/front_end/ui/components/buttons/button.css +31 -0
- package/front_end/ui/components/data_grid/DataGrid.ts +9 -0
- package/front_end/ui/components/docs/button/basic.ts +42 -0
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryValueInterpreter.ts +0 -8
- package/front_end/ui/components/text_editor/TextEditor.ts +5 -2
- package/front_end/ui/components/text_editor/config.ts +3 -3
- package/front_end/ui/components/text_editor/javascript.ts +28 -10
- package/front_end/ui/components/text_editor/theme.ts +1 -0
- package/front_end/ui/legacy/InspectorView.ts +10 -0
- package/front_end/ui/legacy/ListWidget.ts +2 -2
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +2 -3
- package/front_end/ui/legacy/components/object_ui/objectPropertiesSection.css +0 -1
- package/front_end/ui/legacy/components/object_ui/object_ui-legacy.ts +0 -8
- package/front_end/ui/legacy/components/object_ui/object_ui.ts +0 -4
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +3 -0
- package/front_end/ui/legacy/inspectorSyntaxHighlight.css +0 -211
- package/front_end/ui/legacy/legacy-legacy.ts +0 -6
- package/front_end/ui/legacy/legacy.ts +0 -2
- package/front_end/ui/legacy/tabbedPane.css +1 -1
- package/package.json +1 -1
- package/scripts/check_gn.js +1 -1
- package/scripts/eslint_rules/lib/l10n_filename_matches.js +17 -4
- package/scripts/eslint_rules/tests/l10n_filename_matches_test.js +21 -0
- package/scripts/hosted_mode/server.js +17 -2
- package/front_end/entrypoints/node_app/node_app-meta.ts +0 -43
- package/front_end/entrypoints/node_app/node_app.js +0 -13
- package/front_end/entrypoints/node_app/node_app.json +0 -4
- package/front_end/entrypoints/node_main/node_main-meta.ts +0 -48
- package/front_end/entrypoints/node_main/node_main.ts +0 -11
- package/front_end/entrypoints/shell/shell-meta-files.ts +0 -22
- package/front_end/entrypoints/shell/shell.json +0 -5
- package/front_end/ui/legacy/TextEditor.ts +0 -82
- package/front_end/ui/legacy/components/object_ui/JavaScriptAutocomplete.ts +0 -836
- package/front_end/ui/legacy/components/text_editor/CodeMirrorTextEditor.ts +0 -1676
- package/front_end/ui/legacy/components/text_editor/TextEditorAutocompleteController.ts +0 -586
- package/front_end/ui/legacy/components/text_editor/autocompleteTooltip.css +0 -20
- package/front_end/ui/legacy/components/text_editor/cm_modes.ts +0 -23
- package/front_end/ui/legacy/components/text_editor/cmdevtools.css +0 -995
- package/front_end/ui/legacy/components/text_editor/module.json +0 -7
- package/front_end/ui/legacy/components/text_editor/text_editor-legacy.ts +0 -33
- package/front_end/ui/legacy/components/text_editor/text_editor.ts +0 -13
|
@@ -86,9 +86,7 @@ export class CSSFormatter {
|
|
|
86
86
|
if (startLine !== this.lastLine) {
|
|
87
87
|
this.state.eatWhitespace = true;
|
|
88
88
|
}
|
|
89
|
-
|
|
90
|
-
// in CodeMirrorTextEditor.js. In a worker context, we don't use the prefix.
|
|
91
|
-
if (type && (/^(css-)?property/.test(type) || /^(css-)?variable-2/.test(type)) && !this.state.inPropertyValue) {
|
|
89
|
+
if (type && (/^property/.test(type) || /^variable-2/.test(type)) && !this.state.inPropertyValue) {
|
|
92
90
|
this.state.seenProperty = true;
|
|
93
91
|
}
|
|
94
92
|
this.lastLine = startLine;
|
|
@@ -9,7 +9,5 @@ export const enum FormatterActions {
|
|
|
9
9
|
JAVASCRIPT_OUTLINE = 'javaScriptOutline',
|
|
10
10
|
JAVASCRIPT_IDENTIFIERS = 'javaScriptIdentifiers',
|
|
11
11
|
EVALUATE_JAVASCRIPT_SUBSTRING = 'evaluatableJavaScriptSubstring',
|
|
12
|
-
FIND_LAST_EXPRESSION = 'findLastExpression',
|
|
13
|
-
FIND_LAST_FUNCTION_CALL = 'findLastFunctionCall',
|
|
14
12
|
ARGUMENTS_LIST = 'argumentsList',
|
|
15
13
|
}
|
|
@@ -230,55 +230,6 @@ export function format(
|
|
|
230
230
|
return result;
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
-
export function findLastFunctionCall(content: string): {
|
|
234
|
-
baseExpression: string,
|
|
235
|
-
receiver: string,
|
|
236
|
-
argumentIndex: number,
|
|
237
|
-
functionName: string,
|
|
238
|
-
}|null {
|
|
239
|
-
if (content.length > 10000) {
|
|
240
|
-
return null;
|
|
241
|
-
}
|
|
242
|
-
try {
|
|
243
|
-
const tokenizer = Acorn.tokenizer(content, {ecmaVersion: ECMA_VERSION});
|
|
244
|
-
while (tokenizer.getToken().type !== Acorn.tokTypes.eof) {
|
|
245
|
-
}
|
|
246
|
-
} catch (e) {
|
|
247
|
-
return null;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
const suffix = '000)';
|
|
251
|
-
const base = _lastCompleteExpression(content, suffix, new Set(['CallExpression', 'NewExpression']));
|
|
252
|
-
if (!base) {
|
|
253
|
-
return null;
|
|
254
|
-
}
|
|
255
|
-
if (base.baseNode.type !== 'CallExpression' && base.baseNode.type !== 'NewExpression') {
|
|
256
|
-
return null;
|
|
257
|
-
}
|
|
258
|
-
const callee = base.baseNode['callee'];
|
|
259
|
-
|
|
260
|
-
let functionName = '';
|
|
261
|
-
const functionProperty = callee.type === 'Identifier' ? callee : (callee as Acorn.ESTree.MemberExpression).property;
|
|
262
|
-
if (functionProperty) {
|
|
263
|
-
if (functionProperty.type === 'Identifier') {
|
|
264
|
-
functionName = functionProperty.name;
|
|
265
|
-
} else if (functionProperty.type === 'Literal') {
|
|
266
|
-
functionName = (functionProperty.value as string);
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
const argumentIndex = base.baseNode['arguments'].length - 1;
|
|
271
|
-
const baseExpression =
|
|
272
|
-
`(${base.baseExpression.substring(callee.start - base.baseNode.start, callee.end - base.baseNode.start)})`;
|
|
273
|
-
let receiver = '(function(){return this})()';
|
|
274
|
-
if (callee.type === 'MemberExpression') {
|
|
275
|
-
const receiverBase = callee['object'];
|
|
276
|
-
receiver =
|
|
277
|
-
base.baseExpression.substring(receiverBase.start - base.baseNode.start, receiverBase.end - base.baseNode.start);
|
|
278
|
-
}
|
|
279
|
-
return {baseExpression, receiver, argumentIndex, functionName};
|
|
280
|
-
}
|
|
281
|
-
|
|
282
233
|
export function argumentsList(content: string): string[] {
|
|
283
234
|
if (content.length > 10000) {
|
|
284
235
|
return [];
|
|
@@ -349,77 +300,6 @@ export function argumentsList(content: string): string[] {
|
|
|
349
300
|
}
|
|
350
301
|
}
|
|
351
302
|
|
|
352
|
-
export function findLastExpression(content: string): string|null {
|
|
353
|
-
if (content.length > 10000) {
|
|
354
|
-
return null;
|
|
355
|
-
}
|
|
356
|
-
try {
|
|
357
|
-
const tokenizer = Acorn.tokenizer(content, {ecmaVersion: ECMA_VERSION});
|
|
358
|
-
while (tokenizer.getToken().type !== Acorn.tokTypes.eof) {
|
|
359
|
-
}
|
|
360
|
-
} catch (e) {
|
|
361
|
-
return null;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
const suffix = '.DEVTOOLS';
|
|
365
|
-
try {
|
|
366
|
-
Acorn.parse(content + suffix, {ecmaVersion: ECMA_VERSION});
|
|
367
|
-
} catch (parseError) {
|
|
368
|
-
// If this is an invalid location for a '.', don't attempt to give autocomplete
|
|
369
|
-
if (parseError.message.startsWith('Unexpected token') && parseError.pos === content.length) {
|
|
370
|
-
return null;
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
const base = _lastCompleteExpression(content, suffix, new Set(['MemberExpression', 'Identifier']));
|
|
374
|
-
if (base) {
|
|
375
|
-
return base.baseExpression;
|
|
376
|
-
}
|
|
377
|
-
return null;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
|
|
381
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
382
|
-
export function _lastCompleteExpression(content: string, suffix: string, types: Set<string>): {
|
|
383
|
-
baseNode: Acorn.ESTree.Node,
|
|
384
|
-
baseExpression: string,
|
|
385
|
-
}|null {
|
|
386
|
-
let ast: Acorn.ESTree.Node|null = null;
|
|
387
|
-
let parsedContent = '';
|
|
388
|
-
for (let i = 0; i < content.length; i++) {
|
|
389
|
-
try {
|
|
390
|
-
// Wrap content in paren to successfully parse object literals
|
|
391
|
-
parsedContent = content[i] === '{' ? `(${content.substring(i)})${suffix}` : `${content.substring(i)}${suffix}`;
|
|
392
|
-
ast = (Acorn.parse(parsedContent, {ecmaVersion: ECMA_VERSION}) as Acorn.ESTree.Node);
|
|
393
|
-
break;
|
|
394
|
-
} catch (e) {
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
if (!ast) {
|
|
398
|
-
return null;
|
|
399
|
-
}
|
|
400
|
-
const astEnd = ast.end;
|
|
401
|
-
let baseNode: Acorn.ESTree.Node|null = null;
|
|
402
|
-
const walker = new ESTreeWalker(node => {
|
|
403
|
-
if (baseNode || node.end < astEnd) {
|
|
404
|
-
return ESTreeWalker.SkipSubtree;
|
|
405
|
-
}
|
|
406
|
-
if (types.has(node.type)) {
|
|
407
|
-
baseNode = node;
|
|
408
|
-
}
|
|
409
|
-
return;
|
|
410
|
-
});
|
|
411
|
-
walker.walk(ast);
|
|
412
|
-
if (!baseNode) {
|
|
413
|
-
return null;
|
|
414
|
-
}
|
|
415
|
-
let baseExpression =
|
|
416
|
-
parsedContent.substring((baseNode as Acorn.ESTree.Node).start, parsedContent.length - suffix.length);
|
|
417
|
-
if (baseExpression.startsWith('{')) {
|
|
418
|
-
baseExpression = `(${baseExpression})`;
|
|
419
|
-
}
|
|
420
|
-
return {baseNode, baseExpression};
|
|
421
|
-
}
|
|
422
|
-
|
|
423
303
|
(function disableLoggingForTest(): void {
|
|
424
304
|
if (Root.Runtime.Runtime.queryParam('test')) {
|
|
425
305
|
console.error = (): undefined => undefined;
|
|
@@ -2,12 +2,8 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
-
import '../../third_party/codemirror/package/addon/runmode/runmode-standalone.js';
|
|
6
|
-
import '../../third_party/codemirror/package/mode/css/css.js';
|
|
7
|
-
import '../../third_party/codemirror/package/mode/xml/xml.js';
|
|
8
|
-
import '../../third_party/codemirror/package/mode/javascript/javascript.js';
|
|
9
|
-
|
|
10
5
|
import * as Platform from '../../core/platform/platform.js';
|
|
6
|
+
|
|
11
7
|
import * as FormatterWorker from './formatter_worker.js';
|
|
12
8
|
|
|
13
9
|
import {FormatterActions} from './FormatterActions.js';
|
|
@@ -38,12 +34,6 @@ self.onmessage = function(event: MessageEvent): void {
|
|
|
38
34
|
case FormatterActions.EVALUATE_JAVASCRIPT_SUBSTRING:
|
|
39
35
|
self.postMessage(FormatterWorker.FormatterWorker.evaluatableJavaScriptSubstring(params.content));
|
|
40
36
|
break;
|
|
41
|
-
case FormatterActions.FIND_LAST_EXPRESSION:
|
|
42
|
-
self.postMessage(FormatterWorker.FormatterWorker.findLastExpression(params.content));
|
|
43
|
-
break;
|
|
44
|
-
case FormatterActions.FIND_LAST_FUNCTION_CALL:
|
|
45
|
-
self.postMessage(FormatterWorker.FormatterWorker.findLastFunctionCall(params.content));
|
|
46
|
-
break;
|
|
47
37
|
case FormatterActions.ARGUMENTS_LIST:
|
|
48
38
|
self.postMessage(FormatterWorker.FormatterWorker.argumentsList(params.content));
|
|
49
39
|
break;
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
+
import '../../third_party/codemirror/package/addon/runmode/runmode-standalone.js';
|
|
6
|
+
import '../../third_party/codemirror/package/mode/css/css.js';
|
|
7
|
+
import '../../third_party/codemirror/package/mode/xml/xml.js';
|
|
8
|
+
import '../../third_party/codemirror/package/mode/javascript/javascript.js';
|
|
9
|
+
|
|
5
10
|
import * as CSSFormatter from './CSSFormatter.js';
|
|
6
11
|
import * as CSSRuleParser from './CSSRuleParser.js';
|
|
7
12
|
import * as FormattedContentBuilder from './FormattedContentBuilder.js';
|
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
import '../shell/shell.js';
|
|
5
5
|
import '../../panels/js_profiler/js_profiler-meta.js';
|
|
6
6
|
import './JsMain.js';
|
|
7
|
+
|
|
8
|
+
import * as Main from '../main/main.js';
|
|
7
9
|
import * as Startup from '../startup/startup.js';
|
|
8
10
|
|
|
11
|
+
new Main.MainImpl.MainImpl();
|
|
9
12
|
Startup.RuntimeInstantiator.startApplication('js_app');
|
|
@@ -299,9 +299,6 @@ export class MainImpl {
|
|
|
299
299
|
'keyboardShortcutEditor', 'Enable keyboard shortcut editor', true,
|
|
300
300
|
'https://developer.chrome.com/blog/new-in-devtools-88/#keyboard-shortcuts');
|
|
301
301
|
|
|
302
|
-
// Back/forward cache
|
|
303
|
-
Root.Runtime.experiments.register('bfcacheDebugging', 'Enable back/forward cache debugging support');
|
|
304
|
-
|
|
305
302
|
// Timeline
|
|
306
303
|
Root.Runtime.experiments.register('timelineEventInitiators', 'Timeline: event initiators');
|
|
307
304
|
Root.Runtime.experiments.register('timelineInvalidationTracking', 'Timeline: invalidation tracking', true);
|
|
@@ -371,7 +368,6 @@ export class MainImpl {
|
|
|
371
368
|
Root.Runtime.experiments.enableExperimentsByDefault([
|
|
372
369
|
'sourceOrderViewer',
|
|
373
370
|
'hideIssuesFeature',
|
|
374
|
-
'bfcacheDebugging',
|
|
375
371
|
'cssTypeComponentLength',
|
|
376
372
|
'preciseChanges',
|
|
377
373
|
Root.Runtime.ExperimentName.SYNC_SETTINGS,
|
|
@@ -1011,5 +1007,3 @@ export class ReloadActionDelegate implements UI.ActionRegistration.ActionDelegat
|
|
|
1011
1007
|
return false;
|
|
1012
1008
|
}
|
|
1013
1009
|
}
|
|
1014
|
-
|
|
1015
|
-
new MainImpl();
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
import '../shell/shell.js';
|
|
5
|
+
|
|
6
|
+
import * as Main from '../main/main.js';
|
|
5
7
|
import * as Startup from '../startup/startup.js';
|
|
6
8
|
|
|
9
|
+
new Main.MainImpl.MainImpl();
|
|
7
10
|
Startup.RuntimeInstantiator.startApplication('ndb_app');
|
|
@@ -32,7 +32,7 @@ const UIStrings = {
|
|
|
32
32
|
*/
|
|
33
33
|
networkAddressEgLocalhost: 'Network address (e.g. localhost:9229)',
|
|
34
34
|
};
|
|
35
|
-
const str_ = i18n.i18n.registerUIStrings('entrypoints/
|
|
35
|
+
const str_ = i18n.i18n.registerUIStrings('entrypoints/node_app/NodeConnectionsPanel.ts', UIStrings);
|
|
36
36
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
37
37
|
|
|
38
38
|
let nodeConnectionsPanelInstance: NodeConnectionsPanel;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
-
import * as Common from '../../core/common/common.js';
|
|
5
|
+
import type * as Common from '../../core/common/common.js';
|
|
6
6
|
import * as Host from '../../core/host/host.js';
|
|
7
7
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
8
8
|
import * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
@@ -23,7 +23,7 @@ const UIStrings = {
|
|
|
23
23
|
*/
|
|
24
24
|
nodejsS: 'Node.js: {PH1}',
|
|
25
25
|
};
|
|
26
|
-
const str_ = i18n.i18n.registerUIStrings('entrypoints/
|
|
26
|
+
const str_ = i18n.i18n.registerUIStrings('entrypoints/node_app/NodeMain.ts', UIStrings);
|
|
27
27
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
28
28
|
let nodeMainImplInstance: NodeMainImpl;
|
|
29
29
|
|
|
@@ -45,8 +45,6 @@ export class NodeMainImpl implements Common.Runnable.Runnable {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
Common.Runnable.registerEarlyInitializationRunnable(NodeMainImpl.instance);
|
|
49
|
-
|
|
50
48
|
export class NodeChildTargetManager extends SDK.SDKModel.SDKModel<void> implements ProtocolProxyApi.TargetDispatcher {
|
|
51
49
|
private readonly targetManager: SDK.TargetManager.TargetManager;
|
|
52
50
|
private readonly parentTarget: SDK.Target.Target;
|
|
File without changes
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// Copyright 2018 The Chromium Authors. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
import '../shell/shell.js';
|
|
5
|
+
import '../../panels/js_profiler/js_profiler-meta.js';
|
|
6
|
+
import type * as Sources from '../../panels/sources/sources.js';
|
|
7
|
+
import * as i18n from '../../core/i18n/i18n.js';
|
|
8
|
+
import * as UI from '../../ui/legacy/legacy.js';
|
|
9
|
+
import * as Common from '../../core/common/common.js';
|
|
10
|
+
import * as Root from '../../core/root/root.js';
|
|
11
|
+
import * as Main from '../main/main.js';
|
|
12
|
+
|
|
13
|
+
import {NodeMainImpl} from './NodeMain.js'; // eslint-disable-line rulesdir/es_modules_import
|
|
14
|
+
import {NodeConnectionsPanel} from './NodeConnectionsPanel.js'; // eslint-disable-line rulesdir/es_modules_import
|
|
15
|
+
|
|
16
|
+
const UIStrings = {
|
|
17
|
+
/**
|
|
18
|
+
*@description Text that refers to the network connection
|
|
19
|
+
*/
|
|
20
|
+
connection: 'Connection',
|
|
21
|
+
/**
|
|
22
|
+
*@description A tag of Node.js Connection Panel that can be searched in the command menu
|
|
23
|
+
*/
|
|
24
|
+
node: 'node',
|
|
25
|
+
/**
|
|
26
|
+
*@description Command for showing the Connection tool
|
|
27
|
+
*/
|
|
28
|
+
showConnection: 'Show Connection',
|
|
29
|
+
/**
|
|
30
|
+
*@description Title of the 'Node' tool in the Network Navigator View, which is part of the Sources tool
|
|
31
|
+
*/
|
|
32
|
+
networkTitle: 'Node',
|
|
33
|
+
/**
|
|
34
|
+
*@description Command for showing the 'Node' tool in the Network Navigator View, which is part of the Sources tool
|
|
35
|
+
*/
|
|
36
|
+
showNode: 'Node',
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const str_ = i18n.i18n.registerUIStrings('entrypoints/node_app/node_app.ts', UIStrings);
|
|
40
|
+
const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
|
|
41
|
+
|
|
42
|
+
let loadedSourcesModule: (typeof Sources|undefined);
|
|
43
|
+
|
|
44
|
+
async function loadSourcesModule(): Promise<typeof Sources> {
|
|
45
|
+
if (!loadedSourcesModule) {
|
|
46
|
+
loadedSourcesModule = await import('../../panels/sources/sources.js');
|
|
47
|
+
}
|
|
48
|
+
return loadedSourcesModule;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
UI.ViewManager.registerViewExtension({
|
|
52
|
+
location: UI.ViewManager.ViewLocationValues.PANEL,
|
|
53
|
+
id: 'node-connection',
|
|
54
|
+
title: i18nLazyString(UIStrings.connection),
|
|
55
|
+
commandPrompt: i18nLazyString(UIStrings.showConnection),
|
|
56
|
+
order: 0,
|
|
57
|
+
async loadView() {
|
|
58
|
+
return NodeConnectionsPanel.instance();
|
|
59
|
+
},
|
|
60
|
+
tags: [i18nLazyString(UIStrings.node)],
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
UI.ViewManager.registerViewExtension({
|
|
64
|
+
location: UI.ViewManager.ViewLocationValues.NAVIGATOR_VIEW,
|
|
65
|
+
id: 'navigator-network',
|
|
66
|
+
title: i18nLazyString(UIStrings.networkTitle),
|
|
67
|
+
commandPrompt: i18nLazyString(UIStrings.showNode),
|
|
68
|
+
order: 2,
|
|
69
|
+
persistence: UI.ViewManager.ViewPersistence.PERMANENT,
|
|
70
|
+
async loadView() {
|
|
71
|
+
const Sources = await loadSourcesModule();
|
|
72
|
+
return Sources.SourcesNavigator.NetworkNavigatorView.instance();
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
const runtimeInstance = Root.Runtime.Runtime.instance({forceNew: true, moduleDescriptors: []});
|
|
77
|
+
// @ts-ignore Exposed for legacy layout tests
|
|
78
|
+
self.runtime = runtimeInstance;
|
|
79
|
+
Common.Runnable.registerEarlyInitializationRunnable(NodeMainImpl.instance);
|
|
80
|
+
new Main.MainImpl.MainImpl();
|
|
81
|
+
Root.Runtime.appStartedPromiseCallback();
|
|
@@ -8,6 +8,23 @@ import '../../core/root/root-legacy.js';
|
|
|
8
8
|
import '../../core/platform/platform.js';
|
|
9
9
|
import '../../core/dom_extension/dom_extension.js';
|
|
10
10
|
|
|
11
|
-
import '
|
|
11
|
+
import '../../panels/sources/sources-meta.js';
|
|
12
|
+
import '../../panels/profiler/profiler-meta.js';
|
|
13
|
+
import '../../panels/console/console-meta.js';
|
|
14
|
+
import '../../panels/coverage/coverage-meta.js';
|
|
15
|
+
import '../../panels/changes/changes-meta.js';
|
|
16
|
+
import '../../panels/input/input-meta.js';
|
|
17
|
+
import '../../ui/components/linear_memory_inspector/linear_memory_inspector-meta.js';
|
|
18
|
+
import '../../panels/settings/settings-meta.js';
|
|
19
|
+
import '../../panels/protocol_monitor/protocol_monitor-meta.js';
|
|
20
|
+
import '../../models/persistence/persistence-meta.js';
|
|
21
|
+
import '../../models/logs/logs-meta.js';
|
|
22
|
+
import '../main/main-meta.js';
|
|
23
|
+
import '../../ui/legacy/components/perf_ui/perf_ui-meta.js';
|
|
24
|
+
import '../../ui/legacy/components/quick_open/quick_open-meta.js';
|
|
25
|
+
import '../../core/sdk/sdk-meta.js';
|
|
26
|
+
import '../../ui/legacy/components/source_frame/source_frame-meta.js';
|
|
27
|
+
import '../../panels/console_counters/console_counters-meta.js';
|
|
28
|
+
import '../../ui/legacy/components/object_ui/object_ui-meta.js';
|
|
12
29
|
import '../main/main.js';
|
|
13
30
|
// We generate the descriptors in this file, which depend on the runtime.
|
|
@@ -13,6 +13,9 @@ import '../../panels/network/network-meta.js';
|
|
|
13
13
|
import '../../panels/application/application-meta.js';
|
|
14
14
|
import '../../panels/timeline/timeline-meta.js';
|
|
15
15
|
import './WorkerMain.js';
|
|
16
|
+
|
|
17
|
+
import * as Main from '../main/main.js';
|
|
16
18
|
import * as Startup from '../startup/startup.js';
|
|
17
19
|
|
|
20
|
+
new Main.MainImpl.MainImpl();
|
|
18
21
|
Startup.RuntimeInstantiator.startApplication('worker_app');
|
|
@@ -8,7 +8,6 @@ import '../../models/workspace/workspace-legacy.js';
|
|
|
8
8
|
import '../../ui/legacy/components/source_frame/source_frame-legacy.js';
|
|
9
9
|
import '../../models/text_utils/text_utils-legacy.js';
|
|
10
10
|
import '../../ui/legacy/components/object_ui/object_ui-legacy.js';
|
|
11
|
-
import '../../ui/legacy/components/text_editor/text_editor-legacy.js';
|
|
12
11
|
import '../../panels/browser_debugger/browser_debugger-legacy.js';
|
|
13
12
|
|
|
14
13
|
import './SourcesTestRunner.js';
|
|
@@ -341,7 +341,7 @@ export class DebuggerWorkspaceBinding implements SDK.TargetManager.SDKModelObser
|
|
|
341
341
|
modelData.callFrameLocations.clear();
|
|
342
342
|
}
|
|
343
343
|
|
|
344
|
-
|
|
344
|
+
resetForTest(target: SDK.Target.Target): void {
|
|
345
345
|
const debuggerModel = (target.model(SDK.DebuggerModel.DebuggerModel) as SDK.DebuggerModel.DebuggerModel);
|
|
346
346
|
const modelData = this.#debuggerModelToData.get(debuggerModel);
|
|
347
347
|
if (modelData) {
|
|
@@ -149,7 +149,7 @@ export class ResourceMapping implements SDK.TargetManager.SDKModelObserver<SDK.R
|
|
|
149
149
|
uiLocation.uiSourceCode.url(), uiLocation.lineNumber, uiLocation.columnNumber);
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
|
|
152
|
+
resetForTest(target: SDK.Target.Target): void {
|
|
153
153
|
const resourceTreeModel = target.model(SDK.ResourceTreeModel.ResourceTreeModel);
|
|
154
154
|
const info = resourceTreeModel ? this.#modelToInfo.get(resourceTreeModel) : null;
|
|
155
155
|
if (info) {
|
|
@@ -171,24 +171,6 @@ export class FormatterWorkerPool {
|
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
findLastExpression(content: string): Promise<string|null> {
|
|
175
|
-
return this.runTask(FormatterActions.FormatterActions.FIND_LAST_EXPRESSION, {content}) as Promise<string|null>;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
findLastFunctionCall(content: string): Promise<{
|
|
179
|
-
baseExpression: string,
|
|
180
|
-
receiver: string,
|
|
181
|
-
argumentIndex: number,
|
|
182
|
-
functionName: string,
|
|
183
|
-
}|null> {
|
|
184
|
-
return this.runTask(FormatterActions.FormatterActions.FIND_LAST_FUNCTION_CALL, {content}) as Promise<{
|
|
185
|
-
baseExpression: string,
|
|
186
|
-
receiver: string,
|
|
187
|
-
argumentIndex: number,
|
|
188
|
-
functionName: string,
|
|
189
|
-
}|null>;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
174
|
argumentsList(content: string): Promise<string[]> {
|
|
193
175
|
return this.runTask(FormatterActions.FormatterActions.ARGUMENTS_LIST, {content}) as Promise<string[]>;
|
|
194
176
|
}
|
|
@@ -31,57 +31,11 @@
|
|
|
31
31
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
32
32
|
|
|
33
33
|
import type * as CodeMirrorModule from '../../third_party/codemirror/codemirror-legacy.js'; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
34
|
+
import '../../third_party/codemirror/package/addon/runmode/runmode-standalone.js';
|
|
35
|
+
import '../../third_party/codemirror/package/mode/css/css.js';
|
|
34
36
|
|
|
35
|
-
import * as TextRange from './TextRange.js';
|
|
36
37
|
import type * as TextUtils from './TextUtils.js';
|
|
37
38
|
|
|
38
|
-
export function toPos(range: TextRange.TextRange): {
|
|
39
|
-
start: any,
|
|
40
|
-
end: any,
|
|
41
|
-
} {
|
|
42
|
-
return {
|
|
43
|
-
start: new CodeMirror.Pos(range.startLine, range.startColumn),
|
|
44
|
-
end: new CodeMirror.Pos(range.endLine, range.endColumn),
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export function toRange(start: any, end: any): TextRange.TextRange {
|
|
49
|
-
return new TextRange.TextRange(start.line, start.ch, end.line, end.ch);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export function changeObjectToEditOperation(changeObject: any): {
|
|
53
|
-
oldRange: TextRange.TextRange,
|
|
54
|
-
newRange: TextRange.TextRange,
|
|
55
|
-
} {
|
|
56
|
-
const oldRange = toRange(changeObject.from, changeObject.to);
|
|
57
|
-
const newRange = oldRange.clone();
|
|
58
|
-
const linesAdded = changeObject.text.length;
|
|
59
|
-
if (linesAdded === 0) {
|
|
60
|
-
newRange.endLine = newRange.startLine;
|
|
61
|
-
newRange.endColumn = newRange.startColumn;
|
|
62
|
-
} else if (linesAdded === 1) {
|
|
63
|
-
newRange.endLine = newRange.startLine;
|
|
64
|
-
newRange.endColumn = newRange.startColumn + changeObject.text[0].length;
|
|
65
|
-
} else {
|
|
66
|
-
newRange.endLine = newRange.startLine + linesAdded - 1;
|
|
67
|
-
newRange.endColumn = changeObject.text[linesAdded - 1].length;
|
|
68
|
-
}
|
|
69
|
-
return {oldRange: oldRange, newRange: newRange};
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export function pullLines(codeMirror: typeof CodeMirror, linesCount: number): string[] {
|
|
73
|
-
const lines: string[] = [];
|
|
74
|
-
// @ts-expect-error CodeMirror types do not specify eachLine.
|
|
75
|
-
codeMirror.eachLine(0, linesCount, onLineHandle);
|
|
76
|
-
return lines;
|
|
77
|
-
|
|
78
|
-
function onLineHandle(lineHandle: {
|
|
79
|
-
text: string,
|
|
80
|
-
}): void {
|
|
81
|
-
lines.push(lineHandle.text);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
39
|
let tokenizerFactoryInstance: TokenizerFactory;
|
|
86
40
|
|
|
87
41
|
export type Tokenizer =
|
|
@@ -103,15 +57,16 @@ export class TokenizerFactory implements TextUtils.TokenizerFactory {
|
|
|
103
57
|
}
|
|
104
58
|
|
|
105
59
|
// https://crbug.com/1151919 * = CodeMirror.Mode
|
|
106
|
-
createTokenizer(mimeType: string
|
|
107
|
-
const cmMode =
|
|
60
|
+
createTokenizer(mimeType: string): Tokenizer {
|
|
61
|
+
const cmMode = CodeMirror.getMode({indentUnit: 2}, mimeType);
|
|
108
62
|
const state = CodeMirror.startState(cmMode);
|
|
109
63
|
|
|
110
64
|
function tokenize(
|
|
111
65
|
line: string, callback: (value: string, style: string|null, start: number, end: number) => void): void {
|
|
112
66
|
const stream = new CodeMirror.StringStream(line);
|
|
113
67
|
while (!stream.eol()) {
|
|
114
|
-
const style =
|
|
68
|
+
const style =
|
|
69
|
+
(cmMode.token as (stream: CodeMirror.StringStream, state: unknown) => string | null)(stream, state);
|
|
115
70
|
const value = stream.current();
|
|
116
71
|
callback(value, style, stream.start, stream.start + value.length);
|
|
117
72
|
stream.start = stream.pos;
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
31
|
import * as Platform from '../../core/platform/platform.js';
|
|
32
|
-
import type * as CodeMirrorModule from '../../third_party/codemirror/codemirror-legacy.js'; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
33
32
|
|
|
34
33
|
import {SearchMatch} from './ContentProvider.js';
|
|
35
34
|
import {Text} from './Text.js';
|
|
@@ -330,7 +329,7 @@ export class BalancedJSONTokenizer {
|
|
|
330
329
|
export interface TokenizerFactory {
|
|
331
330
|
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
|
|
332
331
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
333
|
-
createTokenizer(mimeType: string
|
|
332
|
+
createTokenizer(mimeType: string):
|
|
334
333
|
(arg0: string, arg1: (arg0: string, arg1: string|null, arg2: number, arg3: number) => void) => void;
|
|
335
334
|
}
|
|
336
335
|
|
|
@@ -48,10 +48,5 @@ TextUtils.isMinified = TextUtilsModule.TextUtils.isMinified;
|
|
|
48
48
|
|
|
49
49
|
TextUtils.CodeMirrorUtils = {};
|
|
50
50
|
|
|
51
|
-
TextUtils.CodeMirrorUtils.toPos = TextUtilsModule.CodeMirrorUtils.toPos;
|
|
52
|
-
TextUtils.CodeMirrorUtils.toRange = TextUtilsModule.CodeMirrorUtils.toRange;
|
|
53
|
-
TextUtils.CodeMirrorUtils.changeObjectToEditOperation = TextUtilsModule.CodeMirrorUtils.changeObjectToEditOperation;
|
|
54
|
-
TextUtils.CodeMirrorUtils.pullLines = TextUtilsModule.CodeMirrorUtils.pullLines;
|
|
55
|
-
|
|
56
51
|
/** @constructor */
|
|
57
52
|
TextUtils.CodeMirrorUtils.TokenizerFactory = TextUtilsModule.CodeMirrorUtils.TokenizerFactory;
|
|
@@ -332,7 +332,7 @@ export class AnimationTimeline extends UI.Widget.VBox implements SDK.TargetManag
|
|
|
332
332
|
show: (popover: UI.GlassPane.GlassPane): Promise<boolean> => {
|
|
333
333
|
let animGroup;
|
|
334
334
|
for (const [group, previewUI] of this.#previewMap) {
|
|
335
|
-
if (previewUI.element === element.parentElement) {
|
|
335
|
+
if (previewUI.element === element || previewUI.element === element.parentElement) {
|
|
336
336
|
animGroup = group;
|
|
337
337
|
}
|
|
338
338
|
}
|
|
@@ -281,10 +281,8 @@ export class ApplicationPanelSidebar extends UI.Widget.VBox implements SDK.Targe
|
|
|
281
281
|
this.cacheStorageListTreeElement = new ServiceWorkerCacheTreeElement(panel);
|
|
282
282
|
cacheTreeElement.appendChild(this.cacheStorageListTreeElement);
|
|
283
283
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
cacheTreeElement.appendChild(this.backForwardCacheListTreeElement);
|
|
287
|
-
}
|
|
284
|
+
this.backForwardCacheListTreeElement = new BackForwardCacheTreeElement(panel);
|
|
285
|
+
cacheTreeElement.appendChild(this.backForwardCacheListTreeElement);
|
|
288
286
|
|
|
289
287
|
if (Root.Runtime.experiments.isEnabled('backgroundServices')) {
|
|
290
288
|
const backgroundServiceSectionTitle = i18nString(UIStrings.backgroundServices);
|
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import * as Common from '../../core/common/common.js';
|
|
6
|
-
import * as Host from '../../core/host/host.js';
|
|
7
6
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
8
|
-
import * as Root from '../../core/root/root.js';
|
|
9
7
|
import * as Bindings from '../../models/bindings/bindings.js';
|
|
10
8
|
import * as ColorPicker from '../../ui/legacy/components/color_picker/color_picker.js';
|
|
11
9
|
import * as InlineEditor from '../../ui/legacy/components/inline_editor/inline_editor.js';
|
|
@@ -55,9 +53,6 @@ export class BezierPopoverIcon {
|
|
|
55
53
|
}
|
|
56
54
|
|
|
57
55
|
private iconClick(event: Event): void {
|
|
58
|
-
if (Root.Runtime.experiments.isEnabled('fontEditor')) {
|
|
59
|
-
Host.userMetrics.cssEditorOpened('bezierEditor');
|
|
60
|
-
}
|
|
61
56
|
event.consume(true);
|
|
62
57
|
if (this.swatchPopoverHelper.isShowing()) {
|
|
63
58
|
this.swatchPopoverHelper.hide(true);
|
|
@@ -163,9 +158,6 @@ export class ColorSwatchPopoverIcon {
|
|
|
163
158
|
}
|
|
164
159
|
|
|
165
160
|
private iconClick(event: Event): void {
|
|
166
|
-
if (Root.Runtime.experiments.isEnabled('fontEditor')) {
|
|
167
|
-
Host.userMetrics.cssEditorOpened('colorPicker');
|
|
168
|
-
}
|
|
169
161
|
event.consume(true);
|
|
170
162
|
this.showPopover();
|
|
171
163
|
}
|
|
@@ -278,9 +270,6 @@ export class ShadowSwatchPopoverHelper {
|
|
|
278
270
|
}
|
|
279
271
|
|
|
280
272
|
private iconClick(event: Event): void {
|
|
281
|
-
if (Root.Runtime.experiments.isEnabled('fontEditor')) {
|
|
282
|
-
Host.userMetrics.cssEditorOpened('shadowEditor');
|
|
283
|
-
}
|
|
284
273
|
event.consume(true);
|
|
285
274
|
this.showPopover();
|
|
286
275
|
}
|