chrome-devtools-frontend 1.0.945884 → 1.0.946351
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 -5
- package/config/gni/devtools_grd_files.gni +0 -33
- package/front_end/core/host/UserMetrics.ts +0 -1
- package/front_end/core/i18n/locales/en-US.json +3 -12
- package/front_end/core/i18n/locales/en-XL.json +3 -12
- package/front_end/core/root/Runtime.ts +0 -1
- package/front_end/core/sdk/CSSProperty.ts +16 -9
- package/front_end/devtools_compatibility.js +0 -7
- 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_app/node_app.js +3 -0
- package/front_end/entrypoints/node_app/node_app.json +1 -2
- 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/application/ApplicationPanelSidebar.ts +2 -4
- package/front_end/panels/elements/elementsTreeOutline.css +0 -13
- package/front_end/panels/network/NetworkConfigView.ts +10 -0
- package/front_end/panels/network/NetworkItemView.ts +3 -0
- package/front_end/panels/network/networkConfigView.css +5 -0
- 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 +6 -2
- package/front_end/panels/sources/sourcesView.css +0 -130
- package/front_end/third_party/codemirror/codemirror-tsconfig.json +1 -25
- package/front_end/ui/components/text_editor/config.ts +3 -3
- package/front_end/ui/components/text_editor/javascript.ts +21 -3
- package/front_end/ui/components/text_editor/theme.ts +1 -0
- 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/inspector_overlay/main.ts +12 -2
- package/package.json +1 -1
- package/scripts/check_gn.js +1 -1
- package/scripts/hosted_mode/server.js +17 -2
- 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
|
@@ -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;
|
|
@@ -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);
|
|
@@ -186,19 +186,6 @@
|
|
|
186
186
|
margin-right: 4px;
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
-
.CodeMirror {
|
|
190
|
-
background-color: var(--color-background);
|
|
191
|
-
height: 300px !important; /* stylelint-disable-line declaration-no-important */
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
.CodeMirror-lines {
|
|
195
|
-
padding: 0;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
.CodeMirror pre {
|
|
199
|
-
padding: 0;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
189
|
button,
|
|
203
190
|
input,
|
|
204
191
|
select {
|
|
@@ -50,6 +50,10 @@ const UIStrings = {
|
|
|
50
50
|
* a set of checkboxes to override the content encodings supported by the browser.
|
|
51
51
|
*/
|
|
52
52
|
acceptedEncoding: 'Accepted `Content-Encoding`s',
|
|
53
|
+
/**
|
|
54
|
+
* @description Status text for successful update of client hints.
|
|
55
|
+
*/
|
|
56
|
+
clientHintsStatusText: 'User agent updated.',
|
|
53
57
|
};
|
|
54
58
|
const str_ = i18n.i18n.registerUIStrings('panels/network/NetworkConfigView.ts', UIStrings);
|
|
55
59
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
@@ -246,10 +250,12 @@ export class NetworkConfigView extends UI.Widget.VBox {
|
|
|
246
250
|
showMobileCheckbox: true,
|
|
247
251
|
showSubmitButton: true,
|
|
248
252
|
};
|
|
253
|
+
userAgentUpdateButtonStatusText.textContent = '';
|
|
249
254
|
});
|
|
250
255
|
|
|
251
256
|
clientHints.addEventListener('clienthintschange', () => {
|
|
252
257
|
customSelectAndInput.select.value = 'custom';
|
|
258
|
+
userAgentUpdateButtonStatusText.textContent = '';
|
|
253
259
|
});
|
|
254
260
|
|
|
255
261
|
clientHints.addEventListener('clienthintssubmit', (event: Event) => {
|
|
@@ -257,8 +263,12 @@ export class NetworkConfigView extends UI.Widget.VBox {
|
|
|
257
263
|
const customUA = customUserAgentSetting.get();
|
|
258
264
|
userAgentMetadataSetting.set(metaData);
|
|
259
265
|
SDK.NetworkManager.MultitargetNetworkManager.instance().setCustomUserAgentOverride(customUA, metaData);
|
|
266
|
+
userAgentUpdateButtonStatusText.textContent = i18nString(UIStrings.clientHintsStatusText);
|
|
260
267
|
});
|
|
261
268
|
|
|
269
|
+
const userAgentUpdateButtonStatusText = section.createChild('span', 'status-text');
|
|
270
|
+
userAgentUpdateButtonStatusText.textContent = '';
|
|
271
|
+
|
|
262
272
|
userAgentSelectBoxChanged();
|
|
263
273
|
|
|
264
274
|
function userAgentSelectBoxChanged(): void {
|
|
@@ -250,6 +250,9 @@ export class NetworkItemView extends UI.TabbedPane.TabbedPane {
|
|
|
250
250
|
}
|
|
251
251
|
|
|
252
252
|
private async maybeAppendPayloadPanel(): Promise<void> {
|
|
253
|
+
if (this.hasTab('payload')) {
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
253
256
|
if (this.requestInternal.queryParameters || await this.requestInternal.requestFormData()) {
|
|
254
257
|
this.payloadView = new RequestPayloadView(this.requestInternal);
|
|
255
258
|
this.appendTab(
|
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import * as i18n from '../../../../core/i18n/i18n.js';
|
|
6
|
+
import * as Buttons from '../../../../ui/components/buttons/buttons.js';
|
|
6
7
|
import * as ComponentHelpers from '../../../../ui/components/helpers/helpers.js';
|
|
7
8
|
import * as LitHtml from '../../../../ui/lit-html/lit-html.js';
|
|
9
|
+
|
|
8
10
|
import userAgentClientHintsFormStyles from './userAgentClientHintsForm.css.js';
|
|
9
11
|
|
|
10
12
|
import type * as Protocol from '../../../../generated/protocol.js';
|
|
@@ -532,12 +534,12 @@ export class UserAgentClientHintsForm extends HTMLElement {
|
|
|
532
534
|
'architecture');
|
|
533
535
|
const deviceModelSection = this.renderDeviceModelSection();
|
|
534
536
|
const submitButton = this.showSubmitButton ? LitHtml.html`
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
537
|
+
<${Buttons.Button.Button.litTagName}
|
|
538
|
+
.variant=${Buttons.Button.Variant.SECONDARY}
|
|
539
|
+
.type=${'submit'}
|
|
538
540
|
>
|
|
539
541
|
${i18nString(UIStrings.update)}
|
|
540
|
-
|
|
542
|
+
</${Buttons.Button.Button.litTagName}>
|
|
541
543
|
` :
|
|
542
544
|
LitHtml.html``;
|
|
543
545
|
const output = LitHtml.html`
|
|
@@ -96,18 +96,6 @@
|
|
|
96
96
|
margin-left: 5px;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
.submit-button {
|
|
100
|
-
border: none;
|
|
101
|
-
border-radius: 2px;
|
|
102
|
-
font-weight: normal;
|
|
103
|
-
height: 24px;
|
|
104
|
-
font-size: 12px;
|
|
105
|
-
padding: 0 12px;
|
|
106
|
-
cursor: pointer;
|
|
107
|
-
background-color: var(--color-primary-variant);
|
|
108
|
-
color: var(--color-text-primary);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
99
|
.hide-container {
|
|
112
100
|
display: none;
|
|
113
101
|
}
|
|
@@ -589,8 +589,12 @@ export class DebuggerPlugin extends Plugin {
|
|
|
589
589
|
if (node.firstChild) {
|
|
590
590
|
return null;
|
|
591
591
|
}
|
|
592
|
-
while (
|
|
593
|
-
|
|
592
|
+
while (
|
|
593
|
+
node && node.name !== 'VariableDefinition' && node.name !== 'VariableName' &&
|
|
594
|
+
node.name !== 'MemberExpression' &&
|
|
595
|
+
!(node.name === 'PropertyName' && node.parent?.name === 'PatternProperty' &&
|
|
596
|
+
node.nextSibling?.name !== ':') &&
|
|
597
|
+
!(node.name === 'PropertyDefinition' && node.parent?.name === 'Property' && node.nextSibling?.name !== ':')) {
|
|
594
598
|
node = node.parent;
|
|
595
599
|
}
|
|
596
600
|
if (!node) {
|
|
@@ -58,133 +58,3 @@
|
|
|
58
58
|
.-theme-with-dark-background .source-frame-debugger-script {
|
|
59
59
|
--override-debugger-background-tint: rgb(61 61 0 / 50%);
|
|
60
60
|
}
|
|
61
|
-
|
|
62
|
-
@keyframes source-frame-value-update-highlight-animation {
|
|
63
|
-
from {
|
|
64
|
-
background-color: inherit;
|
|
65
|
-
color: inherit;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
10% {
|
|
69
|
-
background-color: var(--override-highlight-animation-10pc-background-color);
|
|
70
|
-
color: var(--override-highlight-animation-10pc-foreground-color);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
to {
|
|
74
|
-
background-color: inherit;
|
|
75
|
-
color: inherit;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.source-frame-value-update-highlight {
|
|
80
|
-
animation: source-frame-value-update-highlight-animation 0.8s 1 cubic-bezier(0, 0, 0.2, 1);
|
|
81
|
-
border-radius: 2px;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.diff-entry-insert {
|
|
85
|
-
--override-diff-line-number-background-color: hsl(144deg 55% 49% / 20%);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.-theme-with-dark-background .diff-entry-insert,
|
|
89
|
-
:host-context(.-theme-with-dark-background) .diff-entry-insert {
|
|
90
|
-
--override-diff-line-number-background-color: rgb(61 199 116 / 20%);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.diff-entry-insert .diff-marker {
|
|
94
|
-
border-left: 4px solid var(--color-accent-green);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.diff-entry-insert .CodeMirror-gutter-background {
|
|
98
|
-
background-color: var(--override-diff-line-number-background-color);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.diff-entry-modify {
|
|
102
|
-
--override-diff-line-number-background-color: rgb(186 104 200 / 20%);
|
|
103
|
-
--override-diff-line-number-border-color: #9c27b0;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.-theme-with-dark-background .diff-entry-modify,
|
|
107
|
-
:host-context(.-theme-with-dark-background) .diff-entry-modify {
|
|
108
|
-
--override-diff-line-number-background-color: rgb(137 55 151 / 20%);
|
|
109
|
-
--override-diff-line-number-border-color: rgb(196 79 216);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.diff-entry-modify .diff-marker {
|
|
113
|
-
border-left: 4px solid var(--override-diff-line-number-border-color);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.diff-entry-modify .CodeMirror-gutter-background {
|
|
117
|
-
background-color: var(--override-diff-line-number-background-color);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.diff-entry-delete {
|
|
121
|
-
--override-diff-deletion-color: #d32f2f;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.-theme-with-dark-background .diff-entry-delete,
|
|
125
|
-
:host-context(.-theme-with-dark-background) .diff-entry-delete {
|
|
126
|
-
--override-diff-deletion-color: rgb(208 44 44);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.diff-entry-delete .diff-marker {
|
|
130
|
-
width: 0;
|
|
131
|
-
height: 0;
|
|
132
|
-
border-top: 6px solid transparent;
|
|
133
|
-
border-bottom: 6px solid transparent;
|
|
134
|
-
border-left: 6px solid var(--override-diff-deletion-color);
|
|
135
|
-
position: relative;
|
|
136
|
-
top: 6px;
|
|
137
|
-
cursor: pointer;
|
|
138
|
-
left: 0;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.diff-entry-delete .CodeMirror-gutter-background {
|
|
142
|
-
border-bottom: 2px solid var(--override-diff-deletion-color);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.CodeMirror-gutter-diff {
|
|
146
|
-
width: 4px;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.highlight-line-modification {
|
|
150
|
-
--override-modification-background-fadeout-from: rgb(158 54 153 / 50%);
|
|
151
|
-
--override-modification-background-fadeout-90pc: rgb(158 54 153 / 0%);
|
|
152
|
-
--override-modification-foreground-fadeout-from: #fff;
|
|
153
|
-
|
|
154
|
-
animation: source-line-modification-background-fadeout 0.4s 0s;
|
|
155
|
-
animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
.highlight-line-modification span {
|
|
159
|
-
animation: source-line-modification-foreground-fadeout 0.4s 0s;
|
|
160
|
-
animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
@keyframes source-line-modification-background-fadeout {
|
|
164
|
-
from {
|
|
165
|
-
background-color: var(--override-modification-background-fadeout-from);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
50% {
|
|
169
|
-
/* Purposefully uses the `from` color to delay the animation from 0-50% */
|
|
170
|
-
background-color: var(--override-modification-background-fadeout-from);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
90% {
|
|
174
|
-
background-color: var(--override-modification-background-fadeout-90pc);
|
|
175
|
-
}
|
|
176
|
-
to { background-color: transparent; }
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
@keyframes source-line-modification-foreground-fadeout {
|
|
180
|
-
from {
|
|
181
|
-
color: var(--override-modification-foreground-fadeout-from);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
50% {
|
|
185
|
-
/* Purposefully uses the `from` color to delay the animation from 0-50% */
|
|
186
|
-
color: var(--override-modification-foreground-fadeout-from);
|
|
187
|
-
}
|
|
188
|
-
90% { color: initial; }
|
|
189
|
-
to { color: initial; }
|
|
190
|
-
}
|
|
@@ -3,33 +3,9 @@
|
|
|
3
3
|
"composite": true
|
|
4
4
|
},
|
|
5
5
|
"files": [
|
|
6
|
-
"package/addon/comment/comment.js",
|
|
7
|
-
"package/addon/edit/closebrackets.js",
|
|
8
|
-
"package/addon/edit/matchbrackets.js",
|
|
9
|
-
"package/addon/fold/brace-fold.js",
|
|
10
|
-
"package/addon/fold/foldcode.js",
|
|
11
|
-
"package/addon/fold/foldgutter.js",
|
|
12
|
-
"package/addon/mode/multiplex.js",
|
|
13
|
-
"package/addon/mode/overlay.js",
|
|
14
|
-
"package/addon/mode/simple.js",
|
|
15
6
|
"package/addon/runmode/runmode-standalone.js",
|
|
16
|
-
"package/addon/selection/active-line.js",
|
|
17
|
-
"package/addon/selection/mark-selection.js",
|
|
18
|
-
"package/lib/codemirror.js",
|
|
19
|
-
"package/mode/clike/clike.js",
|
|
20
|
-
"package/mode/clojure/clojure.js",
|
|
21
|
-
"package/mode/coffeescript/coffeescript.js",
|
|
22
7
|
"package/mode/css/css.js",
|
|
23
|
-
"package/mode/htmlembedded/htmlembedded.js",
|
|
24
|
-
"package/mode/htmlmixed/htmlmixed.js",
|
|
25
8
|
"package/mode/javascript/javascript.js",
|
|
26
|
-
"package/mode/jsx/jsx.js",
|
|
27
|
-
"package/mode/livescript/livescript.js",
|
|
28
|
-
"package/mode/markdown/markdown.js",
|
|
29
|
-
"package/mode/php/php.js",
|
|
30
|
-
"package/mode/python/python.js",
|
|
31
|
-
"package/mode/shell/shell.js",
|
|
32
|
-
"package/mode/wast/wast.js",
|
|
33
9
|
"package/mode/xml/xml.js"
|
|
34
10
|
]
|
|
35
|
-
}
|
|
11
|
+
}
|
|
@@ -63,7 +63,7 @@ export class DynamicSetting<T> {
|
|
|
63
63
|
static none: readonly DynamicSetting<unknown>[] = [];
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
export const tabMovesFocus = DynamicSetting.bool('textEditorTabMovesFocus', CM.keymap.of([{
|
|
66
|
+
export const tabMovesFocus = DynamicSetting.bool('textEditorTabMovesFocus', [], CM.keymap.of([{
|
|
67
67
|
key: 'Tab',
|
|
68
68
|
run: (view: CM.EditorView): boolean => view.state.doc.length ? CM.indentMore(view) : false,
|
|
69
69
|
shift: (view: CM.EditorView): boolean => view.state.doc.length ? CM.indentLess(view) : false,
|
|
@@ -85,7 +85,7 @@ export function guessIndent(doc: CM.Text): string {
|
|
|
85
85
|
let scanned = 0;
|
|
86
86
|
for (let cur = doc.iterLines(1, Math.min(doc.lines + 1, LINES_TO_SCAN_FOR_INDENTATION_GUESSING)); !cur.next().done;) {
|
|
87
87
|
let space = (/^\s*/.exec(cur.value) as string[])[0];
|
|
88
|
-
if (space.length === cur.value.length || !space.length) {
|
|
88
|
+
if (space.length === cur.value.length || !space.length || cur.value[space.length] === '*') {
|
|
89
89
|
continue;
|
|
90
90
|
}
|
|
91
91
|
if (space[0] === '\t') {
|
|
@@ -324,7 +324,7 @@ export const showCompletionHint = CM.ViewPlugin.fromClass(class {
|
|
|
324
324
|
if (pos !== lineBefore.to) {
|
|
325
325
|
return null;
|
|
326
326
|
}
|
|
327
|
-
const wordBefore =
|
|
327
|
+
const wordBefore = /#?[\w$]+$/.exec(lineBefore.text);
|
|
328
328
|
if (wordBefore && !label.startsWith(wordBefore[0])) {
|
|
329
329
|
return null;
|
|
330
330
|
}
|
|
@@ -15,6 +15,23 @@ export function completion(): CodeMirror.Extension {
|
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
export async function completeInContext(
|
|
19
|
+
textBefore: string, query: string, force: boolean = false): Promise<UI.SuggestBox.Suggestions> {
|
|
20
|
+
const state = CodeMirror.EditorState.create({
|
|
21
|
+
doc: textBefore,
|
|
22
|
+
selection: {anchor: textBefore.length},
|
|
23
|
+
extensions: CodeMirror.javascript.javascriptLanguage,
|
|
24
|
+
});
|
|
25
|
+
const result = await javascriptCompletionSource(new CodeMirror.CompletionContext(state, textBefore.length, force));
|
|
26
|
+
return result ?
|
|
27
|
+
result.options.filter((o): boolean => o.label.startsWith(query)).map((o): UI.SuggestBox.Suggestion => ({
|
|
28
|
+
text: o.label,
|
|
29
|
+
priority: 100 + (o.boost || 0),
|
|
30
|
+
isSecondary: o.type === 'secondary',
|
|
31
|
+
})) :
|
|
32
|
+
[];
|
|
33
|
+
}
|
|
34
|
+
|
|
18
35
|
class CompletionSet {
|
|
19
36
|
constructor(
|
|
20
37
|
readonly completions: CodeMirror.Completion[] = [],
|
|
@@ -101,7 +118,7 @@ export function getQueryType(tree: CodeMirror.Tree, pos: number, doc: CodeMirror
|
|
|
101
118
|
return null;
|
|
102
119
|
}
|
|
103
120
|
|
|
104
|
-
if (node.name === 'PropertyName') {
|
|
121
|
+
if (node.name === 'PropertyName' || node.name === 'PrivatePropertyName') {
|
|
105
122
|
return parent?.name !== 'MemberExpression' ? null :
|
|
106
123
|
{type: QueryType.PropertyName, from: node.from, relatedNode: parent};
|
|
107
124
|
}
|
|
@@ -172,7 +189,7 @@ export async function javascriptCompletionSource(cx: CodeMirror.CompletionContex
|
|
|
172
189
|
return {
|
|
173
190
|
from: query.from ?? cx.pos,
|
|
174
191
|
options: result.completions,
|
|
175
|
-
span:
|
|
192
|
+
span: /^#?[\w\P{ASCII}]*/u,
|
|
176
193
|
};
|
|
177
194
|
}
|
|
178
195
|
|
|
@@ -312,7 +329,8 @@ async function completePropertiesInner(
|
|
|
312
329
|
const properties = await object.getAllProperties(false, false);
|
|
313
330
|
const isFunction = object.type === 'function';
|
|
314
331
|
for (const prop of properties.properties || []) {
|
|
315
|
-
if (!prop.symbol && !(isFunction && (prop.name === 'arguments' || prop.name === 'caller'))
|
|
332
|
+
if (!prop.symbol && !(isFunction && (prop.name === 'arguments' || prop.name === 'caller')) &&
|
|
333
|
+
(!prop.private || expression === 'this')) {
|
|
316
334
|
const label = quoted ? quoted + prop.name + quoted : prop.name;
|
|
317
335
|
const completion: CodeMirror.Completion = {
|
|
318
336
|
label,
|
|
@@ -37,10 +37,10 @@ import * as Platform from '../../../../core/platform/platform.js';
|
|
|
37
37
|
import * as SDK from '../../../../core/sdk/sdk.js';
|
|
38
38
|
import * as TextUtils from '../../../../models/text_utils/text_utils.js';
|
|
39
39
|
import * as IconButton from '../../../components/icon_button/icon_button.js';
|
|
40
|
+
import * as TextEditor from '../../../components/text_editor/text_editor.js';
|
|
40
41
|
import * as UI from '../../legacy.js';
|
|
41
42
|
|
|
42
43
|
import {CustomPreviewComponent} from './CustomPreviewComponent.js';
|
|
43
|
-
import {JavaScriptAutocomplete} from './JavaScriptAutocomplete.js';
|
|
44
44
|
import {JavaScriptREPL} from './JavaScriptREPL.js';
|
|
45
45
|
import {createSpansForNodeTitle, RemoteObjectPreviewFormatter} from './RemoteObjectPreviewFormatter.js';
|
|
46
46
|
import objectValueStyles from './objectValue.css.js';
|
|
@@ -1513,8 +1513,7 @@ export class ArrayGroupingTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
1513
1513
|
export class ObjectPropertyPrompt extends UI.TextPrompt.TextPrompt {
|
|
1514
1514
|
constructor() {
|
|
1515
1515
|
super();
|
|
1516
|
-
|
|
1517
|
-
this.initialize(javaScriptAutocomplete.completionsForTextInCurrentContext.bind(javaScriptAutocomplete));
|
|
1516
|
+
this.initialize(TextEditor.JavaScript.completeInContext);
|
|
1518
1517
|
}
|
|
1519
1518
|
}
|
|
1520
1519
|
|
|
@@ -12,14 +12,6 @@ ObjectUI = ObjectUI || {};
|
|
|
12
12
|
/** @constructor */
|
|
13
13
|
ObjectUI.CustomPreviewComponent = ObjectUIModule.CustomPreviewComponent.CustomPreviewComponent;
|
|
14
14
|
|
|
15
|
-
/** @constructor */
|
|
16
|
-
ObjectUI.JavaScriptAutocomplete = ObjectUIModule.JavaScriptAutocomplete.JavaScriptAutocomplete;
|
|
17
|
-
|
|
18
|
-
/** @constructor */
|
|
19
|
-
ObjectUI.JavaScriptAutocompleteConfig = ObjectUIModule.JavaScriptAutocomplete.JavaScriptAutocompleteConfig;
|
|
20
|
-
|
|
21
|
-
ObjectUI.javaScriptAutocomplete = ObjectUIModule.javaScriptAutocomplete;
|
|
22
|
-
|
|
23
15
|
/** @constructor */
|
|
24
16
|
ObjectUI.JavaScriptREPL = ObjectUIModule.JavaScriptREPL.JavaScriptREPL;
|
|
25
17
|
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
5
|
import * as CustomPreviewComponent from './CustomPreviewComponent.js';
|
|
6
|
-
import * as JavaScriptAutocomplete from './JavaScriptAutocomplete.js';
|
|
7
6
|
import * as JavaScriptREPL from './JavaScriptREPL.js';
|
|
8
7
|
import * as ObjectPopoverHelper from './ObjectPopoverHelper.js';
|
|
9
8
|
import * as ObjectPropertiesSection from './ObjectPropertiesSection.js';
|
|
@@ -11,11 +10,8 @@ import * as RemoteObjectPreviewFormatter from './RemoteObjectPreviewFormatter.js
|
|
|
11
10
|
|
|
12
11
|
export {
|
|
13
12
|
CustomPreviewComponent,
|
|
14
|
-
JavaScriptAutocomplete,
|
|
15
13
|
JavaScriptREPL,
|
|
16
14
|
ObjectPopoverHelper,
|
|
17
15
|
ObjectPropertiesSection,
|
|
18
16
|
RemoteObjectPreviewFormatter,
|
|
19
17
|
};
|
|
20
|
-
|
|
21
|
-
export const javaScriptAutocomplete = JavaScriptAutocomplete.JavaScriptAutocomplete.instance();
|
|
@@ -229,6 +229,9 @@ export class SourceFrameImpl extends Common.ObjectWrapper.eventMixin<EventTypes,
|
|
|
229
229
|
},
|
|
230
230
|
},
|
|
231
231
|
},
|
|
232
|
+
':host-context(.pretty-printed) & .cm-lineNumbers .cm-gutterElement': {
|
|
233
|
+
color: 'var(--legacy-accent-color)',
|
|
234
|
+
},
|
|
232
235
|
}),
|
|
233
236
|
CodeMirror.EditorView.domEventHandlers({
|
|
234
237
|
focus: () => this.onFocus(),
|