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.
Files changed (71) hide show
  1. package/config/gni/all_devtools_files.gni +0 -5
  2. package/config/gni/devtools_grd_files.gni +0 -33
  3. package/front_end/core/host/UserMetrics.ts +0 -1
  4. package/front_end/core/i18n/locales/en-US.json +3 -12
  5. package/front_end/core/i18n/locales/en-XL.json +3 -12
  6. package/front_end/core/root/Runtime.ts +0 -1
  7. package/front_end/core/sdk/CSSProperty.ts +16 -9
  8. package/front_end/devtools_compatibility.js +0 -7
  9. package/front_end/entrypoints/devtools_app/devtools_app.js +3 -0
  10. package/front_end/entrypoints/devtools_app/devtools_app.json +1 -2
  11. package/front_end/entrypoints/formatter_worker/CSSFormatter.ts +1 -3
  12. package/front_end/entrypoints/formatter_worker/FormatterActions.ts +0 -2
  13. package/front_end/entrypoints/formatter_worker/FormatterWorker.ts +0 -120
  14. package/front_end/entrypoints/formatter_worker/formatter_worker-entrypoint.ts +1 -11
  15. package/front_end/entrypoints/formatter_worker/formatter_worker.ts +5 -0
  16. package/front_end/entrypoints/js_app/js_app.js +3 -0
  17. package/front_end/entrypoints/js_app/js_app.json +1 -2
  18. package/front_end/entrypoints/main/MainImpl.ts +0 -6
  19. package/front_end/entrypoints/ndb_app/ndb_app.js +3 -0
  20. package/front_end/entrypoints/ndb_app/ndb_app.json +1 -2
  21. package/front_end/entrypoints/node_app/node_app.js +3 -0
  22. package/front_end/entrypoints/node_app/node_app.json +1 -2
  23. package/front_end/entrypoints/shell/shell.js +18 -1
  24. package/front_end/entrypoints/worker_app/worker_app.js +3 -0
  25. package/front_end/entrypoints/worker_app/worker_app.json +1 -2
  26. package/front_end/legacy_test_runner/sources_test_runner/sources_test_runner.js +0 -1
  27. package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +1 -1
  28. package/front_end/models/bindings/ResourceMapping.ts +1 -1
  29. package/front_end/models/formatter/FormatterWorkerPool.ts +0 -18
  30. package/front_end/models/text_utils/CodeMirrorUtils.ts +6 -51
  31. package/front_end/models/text_utils/TextUtils.ts +1 -2
  32. package/front_end/models/text_utils/text_utils-legacy.ts +0 -5
  33. package/front_end/panels/application/ApplicationPanelSidebar.ts +2 -4
  34. package/front_end/panels/elements/elementsTreeOutline.css +0 -13
  35. package/front_end/panels/network/NetworkConfigView.ts +10 -0
  36. package/front_end/panels/network/NetworkItemView.ts +3 -0
  37. package/front_end/panels/network/networkConfigView.css +5 -0
  38. package/front_end/panels/profiler/profilesPanel.css +1 -1
  39. package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +6 -4
  40. package/front_end/panels/settings/emulation/components/userAgentClientHintsForm.css +0 -12
  41. package/front_end/panels/sources/DebuggerPlugin.ts +6 -2
  42. package/front_end/panels/sources/sourcesView.css +0 -130
  43. package/front_end/third_party/codemirror/codemirror-tsconfig.json +1 -25
  44. package/front_end/ui/components/text_editor/config.ts +3 -3
  45. package/front_end/ui/components/text_editor/javascript.ts +21 -3
  46. package/front_end/ui/components/text_editor/theme.ts +1 -0
  47. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +2 -3
  48. package/front_end/ui/legacy/components/object_ui/objectPropertiesSection.css +0 -1
  49. package/front_end/ui/legacy/components/object_ui/object_ui-legacy.ts +0 -8
  50. package/front_end/ui/legacy/components/object_ui/object_ui.ts +0 -4
  51. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +3 -0
  52. package/front_end/ui/legacy/inspectorSyntaxHighlight.css +0 -211
  53. package/front_end/ui/legacy/legacy-legacy.ts +0 -6
  54. package/front_end/ui/legacy/legacy.ts +0 -2
  55. package/front_end/ui/legacy/tabbedPane.css +1 -1
  56. package/inspector_overlay/main.ts +12 -2
  57. package/package.json +1 -1
  58. package/scripts/check_gn.js +1 -1
  59. package/scripts/hosted_mode/server.js +17 -2
  60. package/front_end/entrypoints/shell/shell-meta-files.ts +0 -22
  61. package/front_end/entrypoints/shell/shell.json +0 -5
  62. package/front_end/ui/legacy/TextEditor.ts +0 -82
  63. package/front_end/ui/legacy/components/object_ui/JavaScriptAutocomplete.ts +0 -836
  64. package/front_end/ui/legacy/components/text_editor/CodeMirrorTextEditor.ts +0 -1676
  65. package/front_end/ui/legacy/components/text_editor/TextEditorAutocompleteController.ts +0 -586
  66. package/front_end/ui/legacy/components/text_editor/autocompleteTooltip.css +0 -20
  67. package/front_end/ui/legacy/components/text_editor/cm_modes.ts +0 -23
  68. package/front_end/ui/legacy/components/text_editor/cmdevtools.css +0 -995
  69. package/front_end/ui/legacy/components/text_editor/module.json +0 -7
  70. package/front_end/ui/legacy/components/text_editor/text_editor-legacy.ts +0 -33
  71. package/front_end/ui/legacy/components/text_editor/text_editor.ts +0 -13
@@ -25,121 +25,11 @@
25
25
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26
26
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
27
  */
28
- .cm-js-keyword {
29
- color: hsl(310deg 86% 36%); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
30
- }
31
-
32
- .cm-js-number {
33
- color: hsl(248deg 100% 41%); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
34
- }
35
-
36
- .cm-js-comment {
37
- color: hsl(120deg 100% 23%); /* stylelint-disable-line plugin/use_theme_colors */
38
- /* See: crbug.com/1152736 for color variable migration. */
39
- font-style: italic;
40
- }
41
-
42
- .cm-js-string {
43
- color: hsl(1deg 80% 43%); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
44
- }
45
-
46
- .cm-js-string-2 {
47
- color: hsl(1deg 99% 39%); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
48
- }
49
-
50
- .cm-js-atom {
51
- color: hsl(310deg 86% 36%); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
52
- }
53
-
54
- .cm-js-def {
55
- color: hsl(240deg 73% 38%); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
56
- }
57
-
58
- .cm-js-operator {
59
- color: hsl(27deg 100% 30%); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
60
- }
61
-
62
- .cm-js-meta {
63
- color: hsl(27deg 100% 30%); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
64
- }
65
-
66
- .cm-js-variable-2 {
67
- color: hsl(240deg 73% 38%); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
68
- }
69
-
70
- .cm-css-keyword {
71
- color: rgb(7 144 154); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
72
- }
73
-
74
- .cm-css-number {
75
- color: rgb(50 0 255); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
76
- }
77
-
78
- .cm-css-comment {
79
- color: rgb(0 116 0); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
80
- }
81
28
 
82
- .cm-css-def {
83
- color: rgb(200 0 0); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
84
- }
85
-
86
- .cm-css-meta {
87
- color: rgb(200 0 0); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
88
- }
89
-
90
- .cm-css-atom {
91
- color: rgb(7 144 154); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
92
- }
93
-
94
- .cm-css-string {
95
- color: rgb(7 144 154); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
96
- }
97
-
98
- .cm-css-string-2 {
99
- color: rgb(7 144 154); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
100
- }
101
-
102
- .cm-css-link {
103
- color: rgb(7 144 154); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
104
- }
105
-
106
- .cm-css-variable {
107
- color: rgb(200 0 0); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
108
- }
109
-
110
- .cm-css-variable-2 {
111
- color: rgb(0 0 128); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
112
- }
113
-
114
- .cm-css-property,
115
29
  .webkit-css-property {
116
30
  color: var(--webkit-css-property-color, rgb(200 0 0)); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
117
31
  }
118
32
 
119
- .cm-xml-meta {
120
- color: rgb(192 192 192); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
121
- }
122
-
123
- .cm-xml-comment {
124
- color: rgb(35 110 37); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
125
- }
126
-
127
- .cm-xml-string {
128
- color: rgb(26 26 166); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
129
- }
130
-
131
- .cm-xml-tag {
132
- color: var(--color-token-tag);
133
- }
134
-
135
- .cm-xml-attribute {
136
- color: rgb(153 69 0); /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
137
- }
138
-
139
- .cm-xml-link {
140
- color: #00e; /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
141
- }
142
-
143
33
  .webkit-html-comment {
144
34
  /* Keep this in sync with view-source.css (.webkit-html-comment) */
145
35
  color: rgb(35 110 37); /* stylelint-disable-line plugin/use_theme_colors */
@@ -228,107 +118,6 @@
228
118
  .devtools-link:not(.devtools-link-prevent-click) {
229
119
  cursor: pointer;
230
120
  }
231
- /* Default CodeMirror Theme */
232
- .cm-negative {
233
- color: #d44; /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
234
- }
235
-
236
- .cm-positive {
237
- color: #292; /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
238
- }
239
-
240
- .cm-header,
241
- .cm-strong { font-weight: bold; }
242
- .cm-em { font-style: italic; }
243
-
244
- .cm-link {
245
- text-decoration: underline;
246
- color: #00c; /* stylelint-disable-line plugin/use_theme_colors */
247
- /* See: crbug.com/1152736 for color variable migration. */
248
- }
249
-
250
- .cm-strikethrough { text-decoration: line-through; }
251
-
252
- .cm-invalidchar {
253
- color: #f00; /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
254
- }
255
-
256
- .cm-header {
257
- color: #00f; /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
258
- }
259
-
260
- .cm-quote {
261
- color: #090; /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
262
- }
263
-
264
- .cm-keyword {
265
- color: #708; /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
266
- }
267
-
268
- .cm-atom {
269
- color: #219; /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
270
- }
271
-
272
- .cm-number {
273
- color: #164; /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
274
- }
275
-
276
- .cm-def {
277
- color: #00f; /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
278
- }
279
-
280
- .cm-variable-2 {
281
- color: #05a; /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
282
- }
283
-
284
- .cm-variable-3,
285
- .cm-type {
286
- color: #085; /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
287
- }
288
-
289
- .cm-comment {
290
- color: #a50; /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
291
- }
292
-
293
- .cm-string {
294
- color: #a11; /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
295
- }
296
-
297
- .cm-string-2 {
298
- color: #f50; /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
299
- }
300
-
301
- .cm-meta {
302
- color: #555; /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
303
- }
304
-
305
- .cm-qualifier {
306
- color: #555; /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
307
- }
308
-
309
- .cm-builtin {
310
- color: #30a; /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
311
- }
312
-
313
- .cm-bracket {
314
- color: #997; /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
315
- }
316
-
317
- .cm-tag {
318
- color: #170; /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
319
- }
320
-
321
- .cm-attribute {
322
- color: #00c; /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
323
- }
324
-
325
- .cm-hr {
326
- color: #999; /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
327
- }
328
-
329
- .cm-error {
330
- color: #f00; /* stylelint-disable-line plugin/use_theme_colors */ /* See: crbug.com/1152736 for color variable migration. */
331
- }
332
121
 
333
122
  @media (forced-colors: active) {
334
123
  .devtools-link:not(.devtools-link-prevent-click) {
@@ -166,12 +166,6 @@ UI.TabbedPane = UIModule.TabbedPane.TabbedPane;
166
166
  /** @enum {symbol} */
167
167
  UI.TabbedPane.Events = UIModule.TabbedPane.Events;
168
168
 
169
- /** @interface */
170
- UI.TextEditor = UIModule.TextEditor.TextEditor;
171
-
172
- /** @interface */
173
- UI.TextEditorFactory = UIModule.TextEditor.TextEditorFactory;
174
-
175
169
  /** @constructor */
176
170
  UI.TextPrompt = UIModule.TextPrompt.TextPrompt;
177
171
 
@@ -43,7 +43,6 @@ import * as SplitWidget from './SplitWidget.js';
43
43
  import * as SuggestBox from './SuggestBox.js';
44
44
  import * as TabbedPane from './TabbedPane.js';
45
45
  import * as TargetCrashedScreen from './TargetCrashedScreen.js';
46
- import * as TextEditor from './TextEditor.js';
47
46
  import * as TextPrompt from './TextPrompt.js';
48
47
  import * as ThrottledWidget from './ThrottledWidget.js';
49
48
  import * as Toolbar from './Toolbar.js';
@@ -101,7 +100,6 @@ export {
101
100
  SuggestBox,
102
101
  TabbedPane,
103
102
  TargetCrashedScreen,
104
- TextEditor,
105
103
  TextPrompt,
106
104
  ThrottledWidget,
107
105
  Toolbar,
@@ -134,7 +134,7 @@
134
134
  .tabbed-pane-header-tab:hover,
135
135
  .tabbed-pane-shadow .tabbed-pane-header-tab:focus-visible {
136
136
  color: var(--color-text-primary);
137
- background-color: var(--color-background-elevation-1);
137
+ background-color: var(--color-background-elevation-2);
138
138
  }
139
139
 
140
140
  .tabbed-pane-header-tab-title {
@@ -80,6 +80,9 @@ type MessageLookup = {
80
80
  drawingFinished: '',
81
81
  };
82
82
 
83
+ let queue: unknown[][] = [];
84
+ let prevQueue: string = '';
85
+
83
86
  const dispatch = <K extends keyof MessageLookup>(message: [a: K, b: MessageLookup[K]]) => {
84
87
  const functionName = message[0];
85
88
  if (functionName === 'setOverlay') {
@@ -97,9 +100,16 @@ const dispatch = <K extends keyof MessageLookup>(message: [a: K, b: MessageLooku
97
100
  } else if (functionName === 'setPlatform') {
98
101
  platformName = message[1];
99
102
  } else if (functionName === 'drawingFinished') {
100
- // TODO The logic needs to be added here once the backend starts sending this event.
103
+ const currentQueue = JSON.stringify(queue);
104
+ if (currentQueue !== prevQueue) {
105
+ for (const message of queue) {
106
+ currentOverlay.dispatch(message);
107
+ }
108
+ }
109
+ prevQueue = currentQueue;
110
+ queue = [];
101
111
  } else {
102
- currentOverlay.dispatch(message);
112
+ queue.push(message);
103
113
  }
104
114
  };
105
115
 
package/package.json CHANGED
@@ -55,5 +55,5 @@
55
55
  "unittest": "scripts/test/run_unittests.py --no-text-coverage",
56
56
  "watch": "third_party/node/node.py --output scripts/watch_build.js"
57
57
  },
58
- "version": "1.0.945884"
58
+ "version": "1.0.946351"
59
59
  }
@@ -9,7 +9,7 @@ const path = require('path');
9
9
  const FRONTEND_PATH = path.resolve(__dirname, '..', 'front_end');
10
10
 
11
11
  const manifestModules = [];
12
- for (const config of ['inspector', 'devtools_app', 'js_app', 'node_app', 'shell', 'worker_app']) {
12
+ for (const config of ['inspector', 'devtools_app', 'js_app', 'node_app', 'worker_app']) {
13
13
  manifestModules.push(...require(path.resolve(FRONTEND_PATH, 'entrypoints', config, `${config}.json`)).modules);
14
14
  }
15
15
 
@@ -66,10 +66,19 @@ wss.on('connection', ws => {
66
66
  });
67
67
  });
68
68
 
69
+ let delayResolve = null;
70
+
69
71
  server.listen(requestedPort);
70
72
 
71
73
  async function requestHandler(request, response) {
72
- const filePath = unescape(parseURL(request.url).pathname);
74
+ const url = parseURL(request.url);
75
+ const filePath = unescape(url.pathname);
76
+
77
+ if (url.search === '?send_delayed' && delayResolve) {
78
+ delayResolve();
79
+ delayResolve = null;
80
+ }
81
+
73
82
  if (filePath === '/') {
74
83
  const landingURL = `http://localhost:${remoteDebuggingPort}#custom=true`;
75
84
  sendResponse(200, `<html>Please go to <a href="${landingURL}">${landingURL}</a></html>`, 'utf8');
@@ -147,7 +156,13 @@ async function requestHandler(request, response) {
147
156
  return null;
148
157
  }
149
158
 
150
- function sendResponse(statusCode, data, encoding, headers) {
159
+ async function sendResponse(statusCode, data, encoding, headers) {
160
+ if (url.search === '?delay') {
161
+ delayPromise = new Promise(resolve => {
162
+ delayResolve = resolve;
163
+ });
164
+ await delayPromise;
165
+ }
151
166
  if (!headers) {
152
167
  headers = new Map();
153
168
  }
@@ -1,22 +0,0 @@
1
- // Copyright 2021 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
-
5
- import '../../panels/sources/sources-meta.js';
6
- import '../../panels/profiler/profiler-meta.js';
7
- import '../../panels/console/console-meta.js';
8
- import '../../panels/coverage/coverage-meta.js';
9
- import '../../panels/changes/changes-meta.js';
10
- import '../../panels/input/input-meta.js';
11
- import '../../ui/components/linear_memory_inspector/linear_memory_inspector-meta.js';
12
- import '../../panels/settings/settings-meta.js';
13
- import '../../panels/protocol_monitor/protocol_monitor-meta.js';
14
- import '../../models/persistence/persistence-meta.js';
15
- import '../../models/logs/logs-meta.js';
16
- import '../main/main-meta.js';
17
- import '../../ui/legacy/components/perf_ui/perf_ui-meta.js';
18
- import '../../ui/legacy/components/quick_open/quick_open-meta.js';
19
- import '../../core/sdk/sdk-meta.js';
20
- import '../../ui/legacy/components/source_frame/source_frame-meta.js';
21
- import '../../panels/console_counters/console_counters-meta.js';
22
- import '../../ui/legacy/components/object_ui/object_ui-meta.js';
@@ -1,5 +0,0 @@
1
- {
2
- "modules": [
3
- { "name": "ui/legacy/components/text_editor", "type": "autostart" }
4
- ]
5
- }
@@ -1,82 +0,0 @@
1
- // Copyright 2016 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
-
5
- import type * as Common from '../../core/common/common.js';
6
- import type * as TextUtils from '../../models/text_utils/text_utils.js';
7
-
8
- import type {AnchorBehavior} from './GlassPane.js';
9
- import type {Suggestion} from './SuggestBox.js';
10
- import type {Widget} from './Widget.js';
11
-
12
- export interface TextEditorFactory {
13
- createEditor(options: Options): TextEditor;
14
- }
15
-
16
- export interface TextEditor extends Common.EventTarget.EventTarget<EventTypes> {
17
- widget(): Widget;
18
- fullRange(): TextUtils.TextRange.TextRange;
19
- selection(): TextUtils.TextRange.TextRange;
20
- setSelection(selection: TextUtils.TextRange.TextRange): void;
21
- text(textRange?: TextUtils.TextRange.TextRange): string;
22
- textWithCurrentSuggestion(): string;
23
- setText(text: string): void;
24
- line(lineNumber: number): string;
25
- newlineAndIndent(): void;
26
- addKeyDownHandler(handler: (arg0: KeyboardEvent) => void): void;
27
- configureAutocomplete(config: AutocompleteConfig|null): void;
28
- clearAutocomplete(): void;
29
- visualCoordinates(lineNumber: number, columnNumber: number): {
30
- x: number,
31
- y: number,
32
- };
33
- tokenAtTextPosition(lineNumber: number, columnNumber: number): {
34
- startColumn: number,
35
- endColumn: number,
36
- type: string,
37
- }|null;
38
- setPlaceholder(placeholder: string): void;
39
- }
40
-
41
- // TODO(crbug.com/1167717): Make this a const enum again
42
- // eslint-disable-next-line rulesdir/const_enum
43
- export enum Events {
44
- CursorChanged = 'CursorChanged',
45
- TextChanged = 'TextChanged',
46
- SuggestionChanged = 'SuggestionChanged',
47
- }
48
-
49
- export interface TextChangedEvent {
50
- newRange: TextUtils.TextRange.TextRange;
51
- oldRange: TextUtils.TextRange.TextRange;
52
- }
53
-
54
- export type EventTypes = {
55
- [Events.CursorChanged]: void,
56
- [Events.TextChanged]: TextChangedEvent,
57
- [Events.SuggestionChanged]: void,
58
- };
59
-
60
- export interface Options {
61
- bracketMatchingSetting?: Common.Settings.Setting<boolean>;
62
- devtoolsAccessibleName?: string;
63
- lineNumbers: boolean;
64
- lineWrapping: boolean;
65
- mimeType?: string;
66
- autoHeight?: boolean;
67
- padBottom?: boolean;
68
- maxHighlightLength?: number;
69
- placeholder?: string;
70
- lineWiseCopyCut?: boolean;
71
- inputStyle?: string;
72
- }
73
-
74
- export interface AutocompleteConfig {
75
- substituteRangeCallback?: ((arg0: number, arg1: number) => TextUtils.TextRange.TextRange | null);
76
- tooltipCallback?: ((arg0: number, arg1: number) => Promise<Element|null>);
77
- suggestionsCallback?:
78
- ((arg0: TextUtils.TextRange.TextRange, arg1: TextUtils.TextRange.TextRange,
79
- arg2?: boolean|undefined) => Promise<Suggestion[]>| null);
80
- isWordChar?: ((arg0: string) => boolean);
81
- anchorBehavior?: AnchorBehavior;
82
- }