devtools-tracing 1.0.1 → 1.1.0
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/generate.ts +32 -26
- package/index.ts +2 -1
- package/lib/extension-api/ExtensionAPI.d.ts +357 -0
- package/lib/front_end/models/bindings/CSSWorkspaceBinding.ts +318 -0
- package/lib/front_end/models/bindings/CompilerScriptMapping.ts +536 -0
- package/lib/front_end/models/bindings/ContentProviderBasedProject.ts +187 -0
- package/lib/front_end/models/bindings/DebuggerLanguagePlugins.ts +1197 -0
- package/lib/front_end/models/bindings/DebuggerWorkspaceBinding.ts +733 -0
- package/lib/front_end/models/bindings/DefaultScriptMapping.ts +141 -0
- package/lib/front_end/models/bindings/FileUtils.ts +228 -0
- package/lib/front_end/models/bindings/LiveLocation.ts +81 -0
- package/lib/front_end/models/bindings/NetworkProject.ts +157 -0
- package/lib/front_end/models/bindings/PresentationConsoleMessageHelper.ts +312 -0
- package/lib/front_end/models/bindings/ResourceMapping.ts +539 -0
- package/lib/front_end/models/bindings/ResourceScriptMapping.ts +491 -0
- package/lib/front_end/models/bindings/ResourceUtils.ts +103 -0
- package/lib/front_end/models/bindings/SASSSourceMapping.ts +222 -0
- package/lib/front_end/models/bindings/StylesSourceMapping.ts +316 -0
- package/lib/front_end/models/bindings/TempFile.ts +67 -0
- package/lib/front_end/models/bindings/bindings.ts +39 -0
- package/lib/front_end/models/source_map_scopes/NamesResolver.ts +765 -0
- package/lib/front_end/models/source_map_scopes/ScopeChainModel.ts +84 -0
- package/lib/front_end/models/source_map_scopes/source_map_scopes.ts +11 -0
- package/lib/front_end/models/stack_trace/StackTrace.ts +53 -0
- package/lib/front_end/models/stack_trace/StackTraceImpl.ts +85 -0
- package/lib/front_end/models/stack_trace/StackTraceModel.ts +128 -0
- package/lib/front_end/models/stack_trace/Trie.ts +163 -0
- package/lib/front_end/models/stack_trace/stack_trace.ts +9 -0
- package/lib/front_end/models/stack_trace/stack_trace_impl.ts +13 -0
- package/lib/front_end/models/trace_source_maps_resolver/SourceMapsResolver.ts +240 -0
- package/lib/front_end/models/trace_source_maps_resolver/trace_source_maps_resolver.ts +5 -0
- package/lib/front_end/models/workspace/FileManager.ts +97 -0
- package/lib/front_end/models/workspace/IgnoreListManager.ts +628 -0
- package/lib/front_end/models/workspace/SearchConfig.ts +149 -0
- package/lib/front_end/models/workspace/UISourceCode.ts +698 -0
- package/lib/front_end/models/workspace/WorkspaceImpl.ts +339 -0
- package/lib/front_end/models/workspace/workspace.ts +17 -0
- package/lib/front_end/panels/timeline/TimelineUIUtils.ts +1029 -0
- package/lib/front_end/panels/timeline/extensions/ExtensionUI.ts +49 -0
- package/lib/front_end/panels/timeline/extensions/extensions.ts +9 -0
- package/lib/front_end/third_party/codemirror.next/LICENSE +21 -0
- package/lib/front_end/third_party/codemirror.next/README.chromium +30 -0
- package/lib/front_end/third_party/codemirror.next/bundle-tsconfig.json +24 -0
- package/lib/front_end/third_party/codemirror.next/bundle.ts +135 -0
- package/lib/front_end/third_party/codemirror.next/chunk/angular.js +2 -0
- package/lib/front_end/third_party/codemirror.next/chunk/angular.js.map +1 -0
- package/lib/front_end/third_party/codemirror.next/chunk/codemirror.js +2 -0
- package/lib/front_end/third_party/codemirror.next/chunk/codemirror.js.map +1 -0
- package/lib/front_end/third_party/codemirror.next/chunk/cpp.js +2 -0
- package/lib/front_end/third_party/codemirror.next/chunk/cpp.js.map +1 -0
- package/lib/front_end/third_party/codemirror.next/chunk/css.js +2 -0
- package/lib/front_end/third_party/codemirror.next/chunk/html.js +4 -0
- package/lib/front_end/third_party/codemirror.next/chunk/java.js +2 -0
- package/lib/front_end/third_party/codemirror.next/chunk/java.js.map +1 -0
- package/lib/front_end/third_party/codemirror.next/chunk/javascript.js +2 -0
- package/lib/front_end/third_party/codemirror.next/chunk/legacy.js +2 -0
- package/lib/front_end/third_party/codemirror.next/chunk/legacy.js.map +1 -0
- package/lib/front_end/third_party/codemirror.next/chunk/less.js +2 -0
- package/lib/front_end/third_party/codemirror.next/chunk/less.js.map +1 -0
- package/lib/front_end/third_party/codemirror.next/chunk/markdown.js +2 -0
- package/lib/front_end/third_party/codemirror.next/chunk/markdown.js.map +1 -0
- package/lib/front_end/third_party/codemirror.next/chunk/php.js +2 -0
- package/lib/front_end/third_party/codemirror.next/chunk/php.js.map +1 -0
- package/lib/front_end/third_party/codemirror.next/chunk/python.js +2 -0
- package/lib/front_end/third_party/codemirror.next/chunk/python.js.map +1 -0
- package/lib/front_end/third_party/codemirror.next/chunk/sass.js +2 -0
- package/lib/front_end/third_party/codemirror.next/chunk/sass.js.map +1 -0
- package/lib/front_end/third_party/codemirror.next/chunk/svelte.js +2 -0
- package/lib/front_end/third_party/codemirror.next/chunk/svelte.js.map +1 -0
- package/lib/front_end/third_party/codemirror.next/chunk/vue.js +2 -0
- package/lib/front_end/third_party/codemirror.next/chunk/vue.js.map +1 -0
- package/lib/front_end/third_party/codemirror.next/chunk/wast.js +2 -0
- package/lib/front_end/third_party/codemirror.next/chunk/wast.js.map +1 -0
- package/lib/front_end/third_party/codemirror.next/chunk/xml.js +2 -0
- package/lib/front_end/third_party/codemirror.next/chunk/xml.js.map +1 -0
- package/lib/front_end/third_party/codemirror.next/codemirror.next.d.ts +8057 -0
- package/lib/front_end/third_party/codemirror.next/codemirror.next.js +2 -0
- package/lib/front_end/third_party/codemirror.next/codemirror.next.js.map +1 -0
- package/lib/front_end/third_party/codemirror.next/package.json +43 -0
- package/lib/front_end/third_party/codemirror.next/rebuild.sh +6 -0
- package/lib/front_end/third_party/codemirror.next/rollup.config.mjs +49 -0
- package/lib/front_end/third_party/source-map-scopes-codec/LICENSE +26 -0
- package/lib/front_end/third_party/source-map-scopes-codec/README.chromium +31 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/CONTRIBUTING.md +33 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/LICENSE +26 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/README.md +64 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/builder.d.ts +62 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/builder.d.ts.map +1 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/safe_builder.d.ts +37 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/safe_builder.d.ts.map +1 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/decode/decode.d.ts +29 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/decode/decode.d.ts.map +1 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/encode/encode.d.ts +8 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/encode/encode.d.ts.map +1 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/mod.d.ts +6 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/_dist/src/mod.d.ts.map +1 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/deno.json +21 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/package.json +14 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.js +196 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.js.map +1 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.ts +262 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.js +235 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.js.map +1 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.ts +359 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/codec.js +39 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/codec.js.map +1 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/codec.ts +53 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js +438 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js.map +1 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.ts +539 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.js +23 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.js.map +1 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.ts +35 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.js +257 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.js.map +1 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.ts +348 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/mod.js +8 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/mod.js.map +1 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/mod.ts +20 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/scopes-tsconfig.json +8 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/scopes.d.ts +184 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/util.js +9 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/util.js.map +1 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/util.ts +12 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/vlq.js +82 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/vlq.js.map +1 -0
- package/lib/front_end/third_party/source-map-scopes-codec/package/src/vlq.ts +99 -0
- package/lib/front_end/third_party/source-map-scopes-codec/source-map-scopes-codec.ts +5 -0
- package/lib/front_end/ui/legacy/theme_support/ThemeSupport.ts +222 -0
- package/lib/front_end/ui/legacy/theme_support/theme_support.ts +5 -0
- package/package.json +4 -3
- package/patches/chrome-devtools-frontend+1.0.1533544.patch +1549 -20
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
// Copyright 2023 The Chromium Authors
|
|
2
|
+
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
+
// found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
import * as Platform from '../../core/platform/platform.js';
|
|
6
|
+
|
|
7
|
+
export class SearchConfig {
|
|
8
|
+
readonly #query: string;
|
|
9
|
+
readonly #ignoreCase: boolean;
|
|
10
|
+
readonly #isRegex: boolean;
|
|
11
|
+
readonly #queries: string[];
|
|
12
|
+
readonly #fileRegexQueries: RegexQuery[];
|
|
13
|
+
|
|
14
|
+
constructor(query: string, ignoreCase: boolean, isRegex: boolean) {
|
|
15
|
+
this.#query = query;
|
|
16
|
+
this.#ignoreCase = ignoreCase;
|
|
17
|
+
this.#isRegex = isRegex;
|
|
18
|
+
|
|
19
|
+
const {queries, fileRegexQueries} = SearchConfig.#parse(query, ignoreCase, isRegex);
|
|
20
|
+
this.#queries = queries;
|
|
21
|
+
this.#fileRegexQueries = fileRegexQueries;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
static fromPlainObject(object: {
|
|
25
|
+
query: string,
|
|
26
|
+
ignoreCase: boolean,
|
|
27
|
+
isRegex: boolean,
|
|
28
|
+
}): SearchConfig {
|
|
29
|
+
return new SearchConfig(object.query, object.ignoreCase, object.isRegex);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
filePathMatchesFileQuery(
|
|
33
|
+
filePath: Platform.DevToolsPath.RawPathString|Platform.DevToolsPath.EncodedPathString|
|
|
34
|
+
Platform.DevToolsPath.UrlString): boolean {
|
|
35
|
+
return this.#fileRegexQueries.every(({regex, shouldMatch}) => (Boolean(filePath.match(regex)) === shouldMatch));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
queries(): string[] {
|
|
39
|
+
return this.#queries;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
query(): string {
|
|
43
|
+
return this.#query;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
ignoreCase(): boolean {
|
|
47
|
+
return this.#ignoreCase;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
isRegex(): boolean {
|
|
51
|
+
return this.#isRegex;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
toPlainObject(): {
|
|
55
|
+
query: string,
|
|
56
|
+
ignoreCase: boolean,
|
|
57
|
+
isRegex: boolean,
|
|
58
|
+
} {
|
|
59
|
+
return {query: this.query(), ignoreCase: this.ignoreCase(), isRegex: this.isRegex()};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
static #parse(query: string, ignoreCase: boolean, isRegex: boolean):
|
|
63
|
+
{queries: string[], fileRegexQueries: RegexQuery[]} {
|
|
64
|
+
// Inside double quotes: any symbol except double quote and backslash or any symbol escaped with a backslash.
|
|
65
|
+
const quotedPattern = /"([^\\"]|\\.)+"/;
|
|
66
|
+
// A word is a sequence of any symbols except space and backslash or any symbols escaped with a backslash, that does not start with file:.
|
|
67
|
+
const unquotedWordPattern = /(\s*(?!-?f(ile)?:)[^\\ ]|\\.)+/;
|
|
68
|
+
const unquotedPattern = unquotedWordPattern.source + '(\\s+' + unquotedWordPattern.source + ')*';
|
|
69
|
+
|
|
70
|
+
const pattern = [
|
|
71
|
+
'(\\s*' + FilePatternRegex.source + '\\s*)',
|
|
72
|
+
'(' + quotedPattern.source + ')',
|
|
73
|
+
'(' + unquotedPattern + ')',
|
|
74
|
+
].join('|');
|
|
75
|
+
const regexp = new RegExp(pattern, 'g');
|
|
76
|
+
const queryParts = query.match(regexp) || [];
|
|
77
|
+
|
|
78
|
+
const queries: string[] = [];
|
|
79
|
+
const fileRegexQueries: RegexQuery[] = [];
|
|
80
|
+
|
|
81
|
+
for (const queryPart of queryParts) {
|
|
82
|
+
if (!queryPart) {
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
const fileQuery = SearchConfig.#parseFileQuery(queryPart);
|
|
86
|
+
if (fileQuery) {
|
|
87
|
+
const regex = new RegExp(fileQuery.text, ignoreCase ? 'i' : '');
|
|
88
|
+
fileRegexQueries.push({regex, shouldMatch: fileQuery.shouldMatch});
|
|
89
|
+
} else if (isRegex) {
|
|
90
|
+
queries.push(queryPart);
|
|
91
|
+
} else if (queryPart.startsWith('"') && queryPart.endsWith('"')) {
|
|
92
|
+
queries.push(SearchConfig.#parseQuotedQuery(queryPart));
|
|
93
|
+
} else {
|
|
94
|
+
queries.push(SearchConfig.#parseUnquotedQuery(queryPart));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return {queries, fileRegexQueries};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
static #parseUnquotedQuery(query: string): string {
|
|
102
|
+
return query.replace(/\\(.)/g, '$1');
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
static #parseQuotedQuery(query: string): string {
|
|
106
|
+
return query.substring(1, query.length - 1).replace(/\\(.)/g, '$1');
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
static #parseFileQuery(query: string): QueryTerm|null {
|
|
110
|
+
const match = query.match(FilePatternRegex);
|
|
111
|
+
if (!match) {
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
query = match[3];
|
|
115
|
+
let result = '';
|
|
116
|
+
for (let i = 0; i < query.length; ++i) {
|
|
117
|
+
const char = query[i];
|
|
118
|
+
if (char === '*') {
|
|
119
|
+
result += '.*';
|
|
120
|
+
} else if (char === '\\') {
|
|
121
|
+
++i;
|
|
122
|
+
const nextChar = query[i];
|
|
123
|
+
if (nextChar === ' ') {
|
|
124
|
+
result += ' ';
|
|
125
|
+
}
|
|
126
|
+
} else {
|
|
127
|
+
if (Platform.StringUtilities.regexSpecialCharacters().indexOf(query.charAt(i)) !== -1) {
|
|
128
|
+
result += '\\';
|
|
129
|
+
}
|
|
130
|
+
result += query.charAt(i);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
const shouldMatch = !Boolean(match[1]);
|
|
134
|
+
return {text: result, shouldMatch};
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// After file: prefix: any symbol except space and backslash or any symbol escaped with a backslash.
|
|
139
|
+
const FilePatternRegex = /(-)?f(ile)?:((?:[^\\ ]|\\.)+)/;
|
|
140
|
+
|
|
141
|
+
interface QueryTerm {
|
|
142
|
+
text: string;
|
|
143
|
+
shouldMatch: boolean;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
interface RegexQuery {
|
|
147
|
+
regex: RegExp;
|
|
148
|
+
shouldMatch: boolean;
|
|
149
|
+
}
|