chrome-devtools-frontend 1.0.976703 → 1.0.978040

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 (102) hide show
  1. package/config/gni/devtools_grd_files.gni +1 -1
  2. package/front_end/core/host/UserMetrics.ts +23 -1
  3. package/front_end/core/i18n/locales/af.json +5 -5
  4. package/front_end/core/i18n/locales/am.json +5 -5
  5. package/front_end/core/i18n/locales/ar.json +5 -5
  6. package/front_end/core/i18n/locales/as.json +5 -5
  7. package/front_end/core/i18n/locales/az.json +5 -5
  8. package/front_end/core/i18n/locales/be.json +5 -5
  9. package/front_end/core/i18n/locales/bg.json +5 -5
  10. package/front_end/core/i18n/locales/bn.json +5 -5
  11. package/front_end/core/i18n/locales/bs.json +5 -5
  12. package/front_end/core/i18n/locales/ca.json +5 -5
  13. package/front_end/core/i18n/locales/cs.json +5 -5
  14. package/front_end/core/i18n/locales/cy.json +5 -5
  15. package/front_end/core/i18n/locales/da.json +5 -5
  16. package/front_end/core/i18n/locales/de.json +5 -5
  17. package/front_end/core/i18n/locales/el.json +5 -5
  18. package/front_end/core/i18n/locales/en-GB.json +5 -5
  19. package/front_end/core/i18n/locales/en-US.json +18 -15
  20. package/front_end/core/i18n/locales/en-XL.json +18 -15
  21. package/front_end/core/i18n/locales/es-419.json +5 -5
  22. package/front_end/core/i18n/locales/es.json +5 -5
  23. package/front_end/core/i18n/locales/et.json +5 -5
  24. package/front_end/core/i18n/locales/eu.json +5 -5
  25. package/front_end/core/i18n/locales/fa.json +5 -5
  26. package/front_end/core/i18n/locales/fi.json +5 -5
  27. package/front_end/core/i18n/locales/fil.json +5 -5
  28. package/front_end/core/i18n/locales/fr-CA.json +5 -5
  29. package/front_end/core/i18n/locales/fr.json +5 -5
  30. package/front_end/core/i18n/locales/gl.json +5 -5
  31. package/front_end/core/i18n/locales/gu.json +5 -5
  32. package/front_end/core/i18n/locales/he.json +5 -5
  33. package/front_end/core/i18n/locales/hi.json +5 -5
  34. package/front_end/core/i18n/locales/hr.json +5 -5
  35. package/front_end/core/i18n/locales/hu.json +5 -5
  36. package/front_end/core/i18n/locales/hy.json +5 -5
  37. package/front_end/core/i18n/locales/id.json +5 -5
  38. package/front_end/core/i18n/locales/is.json +5 -5
  39. package/front_end/core/i18n/locales/it.json +5 -5
  40. package/front_end/core/i18n/locales/ja.json +5 -5
  41. package/front_end/core/i18n/locales/ka.json +5 -5
  42. package/front_end/core/i18n/locales/kk.json +5 -5
  43. package/front_end/core/i18n/locales/km.json +5 -5
  44. package/front_end/core/i18n/locales/kn.json +5 -5
  45. package/front_end/core/i18n/locales/ko.json +5 -5
  46. package/front_end/core/i18n/locales/ky.json +5 -5
  47. package/front_end/core/i18n/locales/lo.json +5 -5
  48. package/front_end/core/i18n/locales/lt.json +5 -5
  49. package/front_end/core/i18n/locales/lv.json +5 -5
  50. package/front_end/core/i18n/locales/mk.json +5 -5
  51. package/front_end/core/i18n/locales/ml.json +5 -5
  52. package/front_end/core/i18n/locales/mn.json +5 -5
  53. package/front_end/core/i18n/locales/mr.json +5 -5
  54. package/front_end/core/i18n/locales/ms.json +5 -5
  55. package/front_end/core/i18n/locales/my.json +5 -5
  56. package/front_end/core/i18n/locales/ne.json +5 -5
  57. package/front_end/core/i18n/locales/nl.json +5 -5
  58. package/front_end/core/i18n/locales/no.json +5 -5
  59. package/front_end/core/i18n/locales/or.json +5 -5
  60. package/front_end/core/i18n/locales/pa.json +5 -5
  61. package/front_end/core/i18n/locales/pl.json +5 -5
  62. package/front_end/core/i18n/locales/pt-PT.json +5 -5
  63. package/front_end/core/i18n/locales/pt.json +5 -5
  64. package/front_end/core/i18n/locales/ro.json +5 -5
  65. package/front_end/core/i18n/locales/ru.json +5 -5
  66. package/front_end/core/i18n/locales/si.json +5 -5
  67. package/front_end/core/i18n/locales/sk.json +5 -5
  68. package/front_end/core/i18n/locales/sl.json +5 -5
  69. package/front_end/core/i18n/locales/sq.json +5 -5
  70. package/front_end/core/i18n/locales/sr-Latn.json +5 -5
  71. package/front_end/core/i18n/locales/sr.json +5 -5
  72. package/front_end/core/i18n/locales/sv.json +5 -5
  73. package/front_end/core/i18n/locales/sw.json +5 -5
  74. package/front_end/core/i18n/locales/ta.json +5 -5
  75. package/front_end/core/i18n/locales/te.json +5 -5
  76. package/front_end/core/i18n/locales/th.json +5 -5
  77. package/front_end/core/i18n/locales/tr.json +5 -5
  78. package/front_end/core/i18n/locales/uk.json +5 -5
  79. package/front_end/core/i18n/locales/ur.json +5 -5
  80. package/front_end/core/i18n/locales/uz.json +5 -5
  81. package/front_end/core/i18n/locales/vi.json +5 -5
  82. package/front_end/core/i18n/locales/zh-HK.json +5 -5
  83. package/front_end/core/i18n/locales/zh-TW.json +5 -5
  84. package/front_end/core/i18n/locales/zh.json +5 -5
  85. package/front_end/core/i18n/locales/zu.json +5 -5
  86. package/front_end/models/issues_manager/{SameSiteCookieIssue.ts → CookieIssue.ts} +1 -1
  87. package/front_end/models/issues_manager/IssuesManager.ts +1 -1
  88. package/front_end/models/issues_manager/NavigatorUserAgentIssue.ts +1 -1
  89. package/front_end/models/issues_manager/issues_manager.ts +1 -1
  90. package/front_end/models/persistence/NetworkPersistenceManager.ts +3 -3
  91. package/front_end/panels/application/ApplicationPanelCacheSection.ts +3 -0
  92. package/front_end/panels/application/ApplicationPanelSidebar.ts +15 -0
  93. package/front_end/panels/application/InterestGroupTreeElement.ts +2 -0
  94. package/front_end/panels/application/ReportingApiTreeElement.ts +2 -0
  95. package/front_end/panels/application/TrustTokensTreeElement.ts +2 -0
  96. package/front_end/panels/application/components/BackForwardCacheView.ts +23 -1
  97. package/front_end/panels/sources/components/HeadersView.css +52 -0
  98. package/front_end/panels/sources/components/HeadersView.ts +220 -9
  99. package/front_end/panels/timeline/TimelineController.ts +17 -5
  100. package/front_end/ui/components/expandable_list/expandableList.css +10 -0
  101. package/front_end/ui/components/text_editor/javascript.ts +46 -1
  102. package/package.json +1 -1
@@ -101,11 +101,11 @@ const dontCompleteIn = new Set([
101
101
  'TypeName',
102
102
  ]);
103
103
 
104
- // FIXME Implement Map property completion?
105
104
  export const enum QueryType {
106
105
  Expression = 0,
107
106
  PropertyName = 1,
108
107
  PropertyExpression = 2,
108
+ PotentiallyRetrievingFromMap = 3,
109
109
  }
110
110
 
111
111
  export function getQueryType(tree: CodeMirror.Tree, pos: number, doc: CodeMirror.Text): {
@@ -149,6 +149,22 @@ export function getQueryType(tree: CodeMirror.Tree, pos: number, doc: CodeMirror
149
149
  return {type: QueryType.PropertyName, relatedNode: node};
150
150
  }
151
151
  }
152
+ if (node.name === '(') {
153
+ // map.get(<auto-complete>
154
+ if (parent.name === 'ArgList' && parent.parent.name === 'CallExpression') {
155
+ // map.get
156
+ const callReceiver = parent.parent.firstChild;
157
+ if (callReceiver.name === 'MemberExpression') {
158
+ // get
159
+ const propertyExpression = callReceiver.lastChild;
160
+ if (doc.sliceString(propertyExpression.from, propertyExpression.to) === 'get') {
161
+ // map
162
+ const potentiallyMapObject = callReceiver.firstChild;
163
+ return {type: QueryType.PotentiallyRetrievingFromMap, relatedNode: potentiallyMapObject};
164
+ }
165
+ }
166
+ }
167
+ }
152
168
  return {type: QueryType.Expression};
153
169
  }
154
170
 
@@ -184,6 +200,12 @@ export async function javascriptCompletionSource(cx: CodeMirror.CompletionContex
184
200
  }
185
201
  result = await completeProperties(
186
202
  cx.state.sliceDoc(objectExpr.from, objectExpr.to), quote, cx.state.sliceDoc(cx.pos, cx.pos + 1) === ']');
203
+ } else if (query.type === QueryType.PotentiallyRetrievingFromMap) {
204
+ const potentialMapObject = query.relatedNode;
205
+ if (!potentialMapObject) {
206
+ return null;
207
+ }
208
+ result = await maybeCompleteKeysFromMap(cx.state.sliceDoc(potentialMapObject.from, potentialMapObject.to));
187
209
  } else {
188
210
  return null;
189
211
  }
@@ -272,6 +294,29 @@ class PropertyCache {
272
294
  }
273
295
  }
274
296
 
297
+ async function maybeCompleteKeysFromMap(objectVariable: string): Promise<CompletionSet> {
298
+ const result = new CompletionSet();
299
+ const context = getExecutionContext();
300
+ if (!context) {
301
+ return result;
302
+ }
303
+ const maybeRetrieveKeys =
304
+ await evaluateExpression(context, `[...Map.prototype.keys.call(${objectVariable})]`, 'completion');
305
+ if (!maybeRetrieveKeys) {
306
+ return result;
307
+ }
308
+ const properties = SDK.RemoteObject.RemoteArray.objectAsArray(maybeRetrieveKeys);
309
+ const numProperties = properties.length();
310
+ for (let i = 0; i < numProperties; i++) {
311
+ result.add({
312
+ label: `"${(await properties.at(i)).value}")`,
313
+ type: 'constant',
314
+ boost: i * -1,
315
+ });
316
+ }
317
+ return result;
318
+ }
319
+
275
320
  async function completeProperties(
276
321
  expression: string,
277
322
  quoted?: string,
package/package.json CHANGED
@@ -54,5 +54,5 @@
54
54
  "unittest": "scripts/test/run_unittests.py --no-text-coverage",
55
55
  "watch": "third_party/node/node.py --output scripts/watch_build.js"
56
56
  },
57
- "version": "1.0.976703"
57
+ "version": "1.0.978040"
58
58
  }