@theia/memory-inspector 1.34.1 → 1.34.3

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 (103) hide show
  1. package/LICENSE +641 -641
  2. package/README.md +71 -71
  3. package/lib/browser/diff-widget/memory-diff-options-widget.d.ts +36 -36
  4. package/lib/browser/diff-widget/memory-diff-options-widget.js +129 -129
  5. package/lib/browser/diff-widget/memory-diff-select-widget.d.ts +50 -50
  6. package/lib/browser/diff-widget/memory-diff-select-widget.js +137 -137
  7. package/lib/browser/diff-widget/memory-diff-table-widget.d.ts +77 -77
  8. package/lib/browser/diff-widget/memory-diff-table-widget.js +314 -314
  9. package/lib/browser/diff-widget/memory-diff-widget-types.d.ts +41 -41
  10. package/lib/browser/diff-widget/memory-diff-widget-types.js +23 -23
  11. package/lib/browser/editable-widget/memory-editable-table-widget.d.ts +64 -64
  12. package/lib/browser/editable-widget/memory-editable-table-widget.js +329 -329
  13. package/lib/browser/memory-inspector-frontend-contribution.d.ts +46 -46
  14. package/lib/browser/memory-inspector-frontend-contribution.js +291 -291
  15. package/lib/browser/memory-inspector-frontend-module.d.ts +21 -21
  16. package/lib/browser/memory-inspector-frontend-module.js +87 -87
  17. package/lib/browser/memory-provider/cdt-gdb-memory-provider.d.ts +35 -35
  18. package/lib/browser/memory-provider/cdt-gdb-memory-provider.js +136 -136
  19. package/lib/browser/memory-provider/memory-provider-service.d.ts +36 -36
  20. package/lib/browser/memory-provider/memory-provider-service.js +101 -101
  21. package/lib/browser/memory-provider/memory-provider.d.ts +65 -65
  22. package/lib/browser/memory-provider/memory-provider.js +96 -96
  23. package/lib/browser/memory-provider/memory-provider.spec.d.ts +16 -16
  24. package/lib/browser/memory-provider/memory-provider.spec.js +23 -23
  25. package/lib/browser/memory-widget/memory-options-widget.d.ts +136 -136
  26. package/lib/browser/memory-widget/memory-options-widget.js +561 -561
  27. package/lib/browser/memory-widget/memory-table-widget.d.ts +145 -145
  28. package/lib/browser/memory-widget/memory-table-widget.js +484 -484
  29. package/lib/browser/memory-widget/memory-widget.d.ts +32 -32
  30. package/lib/browser/memory-widget/memory-widget.js +109 -109
  31. package/lib/browser/register-widget/register-filter-service.d.ts +42 -42
  32. package/lib/browser/register-widget/register-filter-service.js +82 -82
  33. package/lib/browser/register-widget/register-options-widget.d.ts +81 -81
  34. package/lib/browser/register-widget/register-options-widget.js +343 -343
  35. package/lib/browser/register-widget/register-table-widget.d.ts +77 -77
  36. package/lib/browser/register-widget/register-table-widget.js +236 -236
  37. package/lib/browser/register-widget/register-widget-types.d.ts +29 -29
  38. package/lib/browser/register-widget/register-widget-types.js +35 -35
  39. package/lib/browser/utils/memory-commands.d.ts +27 -27
  40. package/lib/browser/utils/memory-commands.js +67 -67
  41. package/lib/browser/utils/memory-hover-renderer.d.ts +33 -33
  42. package/lib/browser/utils/memory-hover-renderer.js +111 -111
  43. package/lib/browser/utils/memory-recents.d.ts +27 -27
  44. package/lib/browser/utils/memory-recents.js +52 -52
  45. package/lib/browser/utils/memory-widget-components.d.ts +58 -58
  46. package/lib/browser/utils/memory-widget-components.js +69 -69
  47. package/lib/browser/utils/memory-widget-manager.d.ts +50 -50
  48. package/lib/browser/utils/memory-widget-manager.js +182 -182
  49. package/lib/browser/utils/memory-widget-utils.d.ts +113 -113
  50. package/lib/browser/utils/memory-widget-utils.js +42 -42
  51. package/lib/browser/utils/memory-widget-variable-utils.d.ts +57 -57
  52. package/lib/browser/utils/memory-widget-variable-utils.js +143 -143
  53. package/lib/browser/utils/multi-select-bar.d.ts +31 -31
  54. package/lib/browser/utils/multi-select-bar.js +34 -34
  55. package/lib/browser/wrapper-widgets/memory-dock-panel.d.ts +24 -24
  56. package/lib/browser/wrapper-widgets/memory-dock-panel.js +48 -48
  57. package/lib/browser/wrapper-widgets/memory-dockpanel-placeholder-widget.d.ts +23 -23
  58. package/lib/browser/wrapper-widgets/memory-dockpanel-placeholder-widget.js +57 -57
  59. package/lib/browser/wrapper-widgets/memory-layout-widget.d.ts +50 -50
  60. package/lib/browser/wrapper-widgets/memory-layout-widget.js +188 -188
  61. package/lib/common/util.d.ts +21 -21
  62. package/lib/common/util.js +30 -30
  63. package/lib/common/utils.spec.d.ts +16 -16
  64. package/lib/common/utils.spec.js +45 -45
  65. package/package.json +4 -4
  66. package/src/browser/diff-widget/memory-diff-options-widget.tsx +152 -152
  67. package/src/browser/diff-widget/memory-diff-select-widget.tsx +163 -163
  68. package/src/browser/diff-widget/memory-diff-table-widget.tsx +366 -366
  69. package/src/browser/diff-widget/memory-diff-widget-types.ts +45 -45
  70. package/src/browser/editable-widget/memory-editable-table-widget.tsx +360 -360
  71. package/src/browser/memory-inspector-frontend-contribution.ts +301 -301
  72. package/src/browser/memory-inspector-frontend-module.ts +118 -118
  73. package/src/browser/memory-provider/cdt-gdb-memory-provider.ts +132 -132
  74. package/src/browser/memory-provider/memory-provider-service.ts +86 -86
  75. package/src/browser/memory-provider/memory-provider.spec.ts +23 -23
  76. package/src/browser/memory-provider/memory-provider.ts +119 -119
  77. package/src/browser/memory-widget/memory-options-widget.tsx +738 -738
  78. package/src/browser/memory-widget/memory-table-widget.tsx +621 -621
  79. package/src/browser/memory-widget/memory-widget.ts +110 -110
  80. package/src/browser/register-widget/register-filter-service.ts +77 -77
  81. package/src/browser/register-widget/register-options-widget.tsx +393 -393
  82. package/src/browser/register-widget/register-table-widget.tsx +277 -277
  83. package/src/browser/register-widget/register-widget-types.ts +45 -45
  84. package/src/browser/register-widget/register-widget.css +34 -34
  85. package/src/browser/style/index.css +750 -750
  86. package/src/browser/style/memory-lock.svg +21 -21
  87. package/src/browser/style/memory-view.svg +20 -20
  88. package/src/browser/style/register-lock.svg +29 -29
  89. package/src/browser/style/register-view.svg +28 -28
  90. package/src/browser/utils/memory-commands.ts +76 -76
  91. package/src/browser/utils/memory-hover-renderer.ts +113 -113
  92. package/src/browser/utils/memory-recents.ts +58 -58
  93. package/src/browser/utils/memory-widget-components.tsx +193 -193
  94. package/src/browser/utils/memory-widget-manager.ts +179 -179
  95. package/src/browser/utils/memory-widget-utils.tsx +132 -132
  96. package/src/browser/utils/memory-widget-variable-utils.ts +170 -170
  97. package/src/browser/utils/multi-select-bar.css +62 -62
  98. package/src/browser/utils/multi-select-bar.tsx +75 -75
  99. package/src/browser/wrapper-widgets/memory-dock-panel.ts +51 -51
  100. package/src/browser/wrapper-widgets/memory-dockpanel-placeholder-widget.tsx +38 -38
  101. package/src/browser/wrapper-widgets/memory-layout-widget.tsx +163 -163
  102. package/src/common/util.ts +28 -28
  103. package/src/common/utils.spec.ts +52 -52
@@ -1,562 +1,562 @@
1
- "use strict";
2
- /********************************************************************************
3
- * Copyright (C) 2021 Ericsson and others.
4
- *
5
- * This program and the accompanying materials are made available under the
6
- * terms of the Eclipse Public License v. 2.0 which is available at
7
- * http://www.eclipse.org/legal/epl-2.0.
8
- *
9
- * This Source Code may also be made available under the following Secondary
10
- * Licenses when the conditions for such availability set forth in the Eclipse
11
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- * with the GNU Classpath Exception which is available at
13
- * https://www.gnu.org/software/classpath/license.html.
14
- *
15
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
- ********************************************************************************/
17
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
- return c > 3 && r && Object.defineProperty(target, key, r), r;
22
- };
23
- var __metadata = (this && this.__metadata) || function (k, v) {
24
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
- };
26
- var MemoryOptionsWidget_1;
27
- Object.defineProperty(exports, "__esModule", { value: true });
28
- exports.MemoryOptionsWidget = exports.AUTO_UPDATE_TOGGLE_ID = exports.ASCII_TOGGLE_ID = exports.ENDIAN_SELECT_ID = exports.BYTES_PER_GROUP_FIELD_ID = exports.BYTES_PER_ROW_FIELD_ID = exports.LOCATION_OFFSET_FIELD_ID = exports.LENGTH_FIELD_ID = exports.LOCATION_FIELD_ID = exports.EMPTY_MEMORY = void 0;
29
- const core_1 = require("@theia/core");
30
- const browser_1 = require("@theia/core/lib/browser");
31
- const promise_util_1 = require("@theia/core/lib/common/promise-util");
32
- const inversify_1 = require("@theia/core/shared/inversify");
33
- const React = require("@theia/core/shared/react");
34
- const debug_session_1 = require("@theia/debug/lib/browser/debug-session");
35
- const debug_session_manager_1 = require("@theia/debug/lib/browser/debug-session-manager");
36
- const Long = require("long");
37
- const memory_provider_service_1 = require("../memory-provider/memory-provider-service");
38
- const memory_recents_1 = require("../utils/memory-recents");
39
- const memory_widget_components_1 = require("../utils/memory-widget-components");
40
- const memory_widget_utils_1 = require("../utils/memory-widget-utils");
41
- const multi_select_bar_1 = require("../utils/multi-select-bar");
42
- const debounce = require("@theia/core/shared/lodash.debounce");
43
- exports.EMPTY_MEMORY = (0, core_1.deepFreeze)({
44
- bytes: new Uint8Array(),
45
- address: new Long(0, 0, true),
46
- });
47
- exports.LOCATION_FIELD_ID = 't-mv-location';
48
- exports.LENGTH_FIELD_ID = 't-mv-length';
49
- exports.LOCATION_OFFSET_FIELD_ID = 't-mv-location-offset';
50
- exports.BYTES_PER_ROW_FIELD_ID = 't-mv-bytesrow';
51
- exports.BYTES_PER_GROUP_FIELD_ID = 't-mv-bytesgroup';
52
- exports.ENDIAN_SELECT_ID = 't-mv-endiannesss';
53
- exports.ASCII_TOGGLE_ID = 't-mv-ascii-toggle';
54
- exports.AUTO_UPDATE_TOGGLE_ID = 't-mv-auto-update-toggle';
55
- let MemoryOptionsWidget = MemoryOptionsWidget_1 = class MemoryOptionsWidget extends browser_1.ReactWidget {
56
- constructor() {
57
- super(...arguments);
58
- this.iconClass = 'memory-view-icon';
59
- this.lockIconClass = 'memory-lock-icon';
60
- this.additionalColumnSelectLabel = core_1.nls.localize('theia/memory-inspector/extraColumn', 'Extra Column');
61
- this.sessionListeners = new core_1.DisposableCollection();
62
- this.onOptionsChangedEmitter = new core_1.Emitter();
63
- this.onOptionsChanged = this.onOptionsChangedEmitter.event;
64
- this.onMemoryChangedEmitter = new core_1.Emitter();
65
- this.onMemoryChanged = this.onMemoryChangedEmitter.event;
66
- this.memoryReadResult = exports.EMPTY_MEMORY;
67
- this.columnsDisplayed = {
68
- address: {
69
- label: core_1.nls.localizeByDefault('Address'),
70
- doRender: true
71
- },
72
- data: {
73
- label: core_1.nls.localize('theia/memory-inspector/data', 'Data'),
74
- doRender: true
75
- },
76
- variables: {
77
- label: core_1.nls.localizeByDefault('Variables'),
78
- doRender: true
79
- },
80
- ascii: {
81
- label: core_1.nls.localize('theia/memory-inspector/ascii', 'ASCII'),
82
- doRender: false
83
- },
84
- };
85
- this.byteSize = 8;
86
- this.bytesPerGroup = 1;
87
- this.groupsPerRow = 4;
88
- this.variables = [];
89
- this.endianness = memory_widget_utils_1.Interfaces.Endianness.Little;
90
- this.memoryReadError = core_1.nls.localize('theia/memory-inspector/memory/readError/noContents', 'No memory contents currently available.');
91
- this.address = 0;
92
- this.offset = 0;
93
- this.readLength = 256;
94
- this.doDisplaySettings = false;
95
- this.doUpdateAutomatically = true;
96
- this.showMemoryError = false;
97
- this.errorTimeout = undefined;
98
- this.recentLocations = new memory_recents_1.Recents();
99
- this.showTitleEditIcon = false;
100
- this.isTitleEditable = false;
101
- this.handleColumnSelectionChange = (columnLabel, doShow) => this.doHandleColumnSelectionChange(columnLabel, doShow);
102
- this.toggleAutoUpdate = (e) => {
103
- var _a;
104
- if (e.nativeEvent.type === 'click') {
105
- e.currentTarget.blur();
106
- }
107
- if ('key' in e && ((_a = browser_1.KeyCode.createKeyCode(e.nativeEvent).key) === null || _a === void 0 ? void 0 : _a.keyCode) === browser_1.Key.TAB.keyCode) {
108
- return;
109
- }
110
- this.doUpdateAutomatically = !this.doUpdateAutomatically;
111
- if (this.doUpdateAutomatically) {
112
- this.title.iconClass = this.iconClass;
113
- }
114
- else {
115
- this.title.iconClass = this.lockIconClass;
116
- }
117
- this.fireDidChangeOptions();
118
- };
119
- this.onByteSizeChange = (event) => {
120
- this.byteSize = parseInt(event.target.value);
121
- this.fireDidChangeOptions(event.target.id);
122
- };
123
- this.toggleDoShowSettings = (e) => {
124
- var _a;
125
- if (!('key' in e) || ((_a = browser_1.KeyCode.createKeyCode(e.nativeEvent).key) === null || _a === void 0 ? void 0 : _a.keyCode) === browser_1.Key.TAB.keyCode) {
126
- this.doDisplaySettings = !this.doDisplaySettings;
127
- this.update();
128
- }
129
- };
130
- this.assignLocationRef = location => {
131
- this.addressField = location !== null && location !== void 0 ? location : undefined;
132
- };
133
- this.assignReadLengthRef = readLength => {
134
- this.readLengthField = readLength !== null && readLength !== void 0 ? readLength : undefined;
135
- };
136
- this.assignOffsetRef = offset => {
137
- this.offsetField = offset !== null && offset !== void 0 ? offset : undefined;
138
- };
139
- this.setAddressFromSelect = (e) => {
140
- if (this.addressField) {
141
- this.addressField.value = e.target.value;
142
- }
143
- };
144
- this.activateHeaderInputField = (e) => {
145
- var _a, _b;
146
- if (!this.isTitleEditable) {
147
- const isMouseDown = !('key' in e);
148
- const isActivationKey = 'key' in e && (((_a = browser_1.KeyCode.createKeyCode(e.nativeEvent).key) === null || _a === void 0 ? void 0 : _a.keyCode) === browser_1.Key.SPACE.keyCode
149
- || ((_b = browser_1.KeyCode.createKeyCode(e.nativeEvent).key) === null || _b === void 0 ? void 0 : _b.keyCode) === browser_1.Key.ENTER.keyCode);
150
- if (isMouseDown || isActivationKey) {
151
- if (isMouseDown) {
152
- e.currentTarget.blur();
153
- }
154
- this.isTitleEditable = true;
155
- this.update();
156
- }
157
- }
158
- };
159
- this.saveHeaderInputValue = (e) => {
160
- const isMouseDown = !('key' in e);
161
- const isSaveKey = 'key' in e && e.key === 'Enter';
162
- const isCancelKey = 'key' in e && e.key === 'Escape';
163
- e.stopPropagation();
164
- if (isMouseDown || isSaveKey || isCancelKey) {
165
- this.updateHeader(isCancelKey);
166
- }
167
- };
168
- this.assignHeaderInputRef = (element) => {
169
- if (element) {
170
- this.headerInputField = element;
171
- element.focus();
172
- }
173
- };
174
- this.doShowMemoryErrors = (doClearError = false) => {
175
- if (this.errorTimeout !== undefined) {
176
- clearTimeout(this.errorTimeout);
177
- }
178
- if (doClearError) {
179
- this.showMemoryError = false;
180
- this.update();
181
- this.errorTimeout = undefined;
182
- return;
183
- }
184
- this.showMemoryError = true;
185
- this.update();
186
- this.errorTimeout = setTimeout(() => {
187
- this.showMemoryError = false;
188
- this.update();
189
- this.errorTimeout = undefined;
190
- }, memory_widget_utils_1.Constants.ERROR_TIMEOUT);
191
- };
192
- this.doRefresh = (event) => {
193
- if ('key' in event && event.key !== 'Enter') {
194
- return;
195
- }
196
- this.updateMemoryView();
197
- };
198
- this.updateMemoryView = debounce(this.doUpdateMemoryView.bind(this), memory_widget_utils_1.Constants.DEBOUNCE_TIME, { trailing: true });
199
- // Callbacks for when the various view parameters change.
200
- /**
201
- * Handle bytes per row changed event.
202
- */
203
- this.onGroupsPerRowChange = (event) => {
204
- const { value, id } = event.target;
205
- this.groupsPerRow = parseInt(value);
206
- this.fireDidChangeOptions(id);
207
- };
208
- /**
209
- * Handle bytes per group changed event.
210
- */
211
- this.onBytesPerGroupChange = (event) => {
212
- const { value, id } = event.target;
213
- this.bytesPerGroup = parseInt(value);
214
- this.fireDidChangeOptions(id);
215
- };
216
- /**
217
- * Handle endianness changed event.
218
- */
219
- this.onEndiannessChange = (event) => {
220
- const { value, id } = event.target;
221
- if (value !== memory_widget_utils_1.Interfaces.Endianness.Big && value !== memory_widget_utils_1.Interfaces.Endianness.Little) {
222
- return;
223
- }
224
- this.endianness = value;
225
- this.fireDidChangeOptions(id);
226
- };
227
- }
228
- get memory() {
229
- return Object.assign(Object.assign({}, this.memoryReadResult), { variables: this.variables });
230
- }
231
- get options() {
232
- return this.storeState();
233
- }
234
- init() {
235
- this.addClass(MemoryOptionsWidget_1.ID);
236
- this.title.label = core_1.nls.localize('theia/memory-inspector/memory', 'Memory ({0})', this.memoryWidgetOptions.displayId);
237
- this.title.caption = core_1.nls.localize('theia/memory-inspector/memory', 'Memory ({0})', this.memoryWidgetOptions.displayId);
238
- this.title.iconClass = this.iconClass;
239
- this.title.closable = true;
240
- if (this.memoryWidgetOptions.dynamic !== false) {
241
- this.toDispose.push(this.sessionManager.onDidChangeActiveDebugSession(({ current }) => {
242
- this.setUpListeners(current);
243
- }));
244
- this.toDispose.push(this.sessionManager.onDidCreateDebugSession(current => {
245
- this.setUpListeners(current);
246
- }));
247
- this.setUpListeners(this.sessionManager.currentSession);
248
- }
249
- this.toDispose.push(this.onOptionsChanged(() => this.update()));
250
- this.update();
251
- }
252
- async setAddressAndGo(newAddress, newOffset, newLength, direction) {
253
- let doUpdate = false;
254
- const originalValues = {
255
- offset: '',
256
- length: '',
257
- };
258
- if (this.addressField) {
259
- this.addressField.value = newAddress;
260
- doUpdate = true;
261
- }
262
- if (this.offsetField && newOffset !== undefined) {
263
- originalValues.offset = this.offsetField.value;
264
- this.offsetField.value = newOffset.toString();
265
- doUpdate = true;
266
- }
267
- if (this.readLengthField && newLength !== undefined) {
268
- originalValues.length = this.readLengthField.value;
269
- this.readLengthField.value = newLength.toString();
270
- doUpdate = true;
271
- }
272
- if (doUpdate && this.readLengthField && this.offsetField) {
273
- this.pinnedMemoryReadResult = new promise_util_1.Deferred();
274
- this.updateMemoryView();
275
- const result = await this.pinnedMemoryReadResult.promise;
276
- if (result === false) {
277
- // Memory request errored
278
- this.readLengthField.value = originalValues.length;
279
- this.offsetField.value = originalValues.offset;
280
- }
281
- if (result) {
282
- // Memory request returned some memory
283
- const resultLength = result.bytes.length * 8 / this.byteSize;
284
- const lengthFieldValue = parseInt(this.readLengthField.value);
285
- if (lengthFieldValue !== resultLength) {
286
- this.memoryReadError = core_1.nls.localize('theia/memory-inspector/memory/readError/bounds', 'Memory bounds exceeded, result will be truncated.');
287
- this.doShowMemoryErrors();
288
- this.readLengthField.value = resultLength.toString();
289
- if (direction === 'above') {
290
- this.offsetField.value = `${parseInt(originalValues.offset) - (resultLength - parseInt(originalValues.length))}`;
291
- }
292
- this.update();
293
- }
294
- }
295
- }
296
- return undefined;
297
- }
298
- setUpListeners(session) {
299
- this.sessionListeners.dispose();
300
- this.sessionListeners = new core_1.DisposableCollection(core_1.Disposable.create(() => this.handleActiveSessionChange()));
301
- if (session) {
302
- this.sessionListeners.push(session.onDidChange(() => this.handleSessionChange()));
303
- }
304
- }
305
- handleActiveSessionChange() {
306
- const isDynamic = this.memoryWidgetOptions.dynamic !== false;
307
- if (isDynamic && this.doUpdateAutomatically) {
308
- this.memoryReadResult = exports.EMPTY_MEMORY;
309
- this.fireDidChangeMemory();
310
- }
311
- }
312
- handleSessionChange() {
313
- var _a, _b;
314
- const isStopped = ((_a = this.sessionManager.currentSession) === null || _a === void 0 ? void 0 : _a.state) === debug_session_1.DebugState.Stopped;
315
- const isReadyForQuery = !!((_b = this.sessionManager.currentSession) === null || _b === void 0 ? void 0 : _b.currentFrame);
316
- const isDynamic = this.memoryWidgetOptions.dynamic !== false;
317
- if (isStopped && isReadyForQuery && isDynamic && this.doUpdateAutomatically && this.memoryReadResult !== exports.EMPTY_MEMORY) {
318
- this.updateMemoryView();
319
- }
320
- }
321
- onActivateRequest(msg) {
322
- super.onActivateRequest(msg);
323
- this.acceptFocus();
324
- }
325
- acceptFocus() {
326
- if (this.doUpdateAutomatically) {
327
- if (this.addressField) {
328
- this.addressField.focus();
329
- this.addressField.select();
330
- }
331
- }
332
- else {
333
- const settingsCog = this.node.querySelector('.toggle-settings-click-zone');
334
- settingsCog === null || settingsCog === void 0 ? void 0 : settingsCog.focus();
335
- }
336
- }
337
- doHandleColumnSelectionChange(columnLabel, doShow) {
338
- if (columnLabel in this.columnsDisplayed) {
339
- this.columnsDisplayed[columnLabel].doRender = doShow;
340
- this.fireDidChangeOptions(exports.ASCII_TOGGLE_ID);
341
- }
342
- }
343
- onAfterAttach(msg) {
344
- super.onAfterAttach(msg);
345
- if (this.memoryWidgetOptions.dynamic !== false) {
346
- if (this.addressField) {
347
- this.addressField.value = this.address.toString();
348
- }
349
- }
350
- }
351
- render() {
352
- return (React.createElement("div", { className: 't-mv-container' }, this.renderInputContainer()));
353
- }
354
- renderInputContainer() {
355
- return (React.createElement("div", { className: 't-mv-settings-container' },
356
- React.createElement("div", { className: 't-mv-wrapper' },
357
- this.renderToolbar(),
358
- this.renderMemoryLocationGroup(),
359
- this.doDisplaySettings && (React.createElement("div", { className: 't-mv-toggle-settings-wrapper' }, this.renderByteDisplayGroup())))));
360
- }
361
- renderByteDisplayGroup() {
362
- return (React.createElement("div", { className: 't-mv-group settings-group' },
363
- React.createElement(memory_widget_components_1.MWSelect, { id: 'byte-size-select', label: core_1.nls.localize('theia/memory-inspector/byteSize', 'Byte Size'), value: this.byteSize.toString(), onChange: this.onByteSizeChange, options: ['8', '16', '32', '64'] }),
364
- React.createElement(memory_widget_components_1.MWSelect, { id: exports.BYTES_PER_GROUP_FIELD_ID, label: core_1.nls.localize('theia/memory-inspector/bytesPerGroup', 'Bytes Per Group'), value: this.bytesPerGroup.toString(), onChange: this.onBytesPerGroupChange, options: ['1', '2', '4', '8', '16'] }),
365
- React.createElement(memory_widget_components_1.MWSelect, { id: exports.BYTES_PER_ROW_FIELD_ID, label: core_1.nls.localize('theia/memory-inspector/groupsPerRow', 'Groups Per Row'), value: this.groupsPerRow.toString(), onChange: this.onGroupsPerRowChange, options: ['1', '2', '4', '8', '16', '32'] }),
366
- React.createElement(memory_widget_components_1.MWSelect, { id: exports.ENDIAN_SELECT_ID, label: core_1.nls.localize('theia/memory-inspector/endianness', 'Endianness'), value: this.endianness, onChange: this.onEndiannessChange, options: [memory_widget_utils_1.Interfaces.Endianness.Little, memory_widget_utils_1.Interfaces.Endianness.Big] }),
367
- React.createElement(multi_select_bar_1.MWMultiSelect, { id: exports.ASCII_TOGGLE_ID, label: core_1.nls.localize('theia/memory-inspector/columns', 'Columns'), items: this.getOptionalColumns(), onSelectionChanged: this.handleColumnSelectionChange })));
368
- }
369
- getObligatoryColumnIds() {
370
- return ['address', 'data'];
371
- }
372
- getOptionalColumns() {
373
- const obligatoryColumns = new Set(this.getObligatoryColumnIds());
374
- return Object.entries(this.columnsDisplayed)
375
- .reduce((accumulated, [id, { doRender, label }]) => {
376
- if (!obligatoryColumns.has(id)) {
377
- accumulated.push({ id, label, defaultChecked: doRender });
378
- }
379
- return accumulated;
380
- }, []);
381
- }
382
- renderMemoryLocationGroup() {
383
- return (React.createElement(React.Fragment, null,
384
- React.createElement("div", { className: 't-mv-group view-group' },
385
- React.createElement(memory_widget_components_1.MWInputWithSelect, { id: exports.LOCATION_FIELD_ID, label: core_1.nls.localizeByDefault('Address'), title: core_1.nls.localize('theia/memory-inspector/addressTooltip', 'Memory location to display, an address or expression evaluating to an address'), defaultValue: `${this.address}`, onSelectChange: this.setAddressFromSelect, passRef: this.assignLocationRef, onKeyDown: this.doRefresh, options: [...this.recentLocations.values], disabled: !this.doUpdateAutomatically }),
386
- React.createElement(memory_widget_components_1.MWInput, { id: exports.LOCATION_OFFSET_FIELD_ID, label: core_1.nls.localize('theia/memory-inspector/offset', 'Offset'), title: core_1.nls.localize('theia/memory-inspector/offsetTooltip', 'Offset to be added to the current memory location, when navigating'), defaultValue: '0', passRef: this.assignOffsetRef, onKeyDown: this.doRefresh, disabled: !this.doUpdateAutomatically }),
387
- React.createElement(memory_widget_components_1.MWInput, { id: exports.LENGTH_FIELD_ID, label: core_1.nls.localize('theia/memory-inspector/length', 'Length'), title: core_1.nls.localize('theia/memory-inspector/lengthTooltip', 'Number of bytes to fetch, in decimal or hexadecimal'), defaultValue: this.readLength.toString(), passRef: this.assignReadLengthRef, onChange: memory_widget_utils_1.Utils.validateNumericalInputs, onKeyDown: this.doRefresh, disabled: !this.doUpdateAutomatically }),
388
- React.createElement("button", { type: 'button', className: 'theia-button main view-group-go-button', onClick: this.doRefresh, disabled: !this.doUpdateAutomatically, title: core_1.nls.localizeByDefault('Go') }, core_1.nls.localizeByDefault('Go'))),
389
- React.createElement("div", { className: `t-mv-memory-fetch-error${this.showMemoryError ? ' show' : ' hide'}` }, this.memoryReadError)));
390
- }
391
- updateHeader(isCancelKey) {
392
- if (!isCancelKey && this.headerInputField) {
393
- this.title.label = this.headerInputField.value;
394
- this.title.caption = this.headerInputField.value;
395
- }
396
- this.isTitleEditable = false;
397
- this.update();
398
- }
399
- renderToolbar() {
400
- return (React.createElement("div", { className: 'memory-widget-toolbar' },
401
- this.renderLockIcon(),
402
- this.renderEditableTitleField(),
403
- this.renderSettingsContainer()));
404
- }
405
- renderSettingsContainer() {
406
- return React.createElement("div", { className: 'toggle-settings-container' },
407
- React.createElement("div", { className: 'toggle-settings-click-zone no-select', tabIndex: 0, "aria-label": this.doDisplaySettings ?
408
- core_1.nls.localize('theia/memory-inspector/memory/hideSettings', 'Hide Settings Panel') :
409
- core_1.nls.localize('theia/memory-inspector/memory/showSettings', 'Show Settings Panel'), role: 'button', onClick: this.toggleDoShowSettings, onKeyDown: this.toggleDoShowSettings, title: this.doDisplaySettings ?
410
- core_1.nls.localize('theia/memory-inspector/memory/hideSettings', 'Hide Settings Panel') :
411
- core_1.nls.localize('theia/memory-inspector/memory/showSettings', 'Show Settings Panel') },
412
- React.createElement("i", { className: 'codicon codicon-settings-gear' }),
413
- React.createElement("span", null, this.doDisplaySettings ?
414
- core_1.nls.localize('theia/memory-inspector/closeSettings', 'Close Settings') :
415
- core_1.nls.localizeByDefault('Settings'))));
416
- }
417
- renderLockIcon() {
418
- return this.memoryWidgetOptions.dynamic !== false && (React.createElement("div", { className: 'memory-widget-auto-updates-container' },
419
- React.createElement("div", { className: `fa fa-${this.doUpdateAutomatically ? 'unlock' : 'lock'}`, id: exports.AUTO_UPDATE_TOGGLE_ID, title: this.doUpdateAutomatically ?
420
- core_1.nls.localize('theia/memory-inspector/memory/freeze', 'Freeze Memory View') :
421
- core_1.nls.localize('theia/memory-inspector/memory/unfreeze', 'Unfreeze Memory View'), onClick: this.toggleAutoUpdate, onKeyDown: this.toggleAutoUpdate, role: 'button', tabIndex: 0 })));
422
- }
423
- renderEditableTitleField() {
424
- return (React.createElement("div", { className: 'memory-widget-header-click-zone', tabIndex: 0, onClick: this.activateHeaderInputField, onKeyDown: this.activateHeaderInputField, role: 'button' },
425
- !this.isTitleEditable
426
- ? (React.createElement("h2", { className: `${MemoryOptionsWidget_1.WIDGET_H2_CLASS}${!this.doUpdateAutomatically ? ' disabled' : ''} no-select` }, this.title.label))
427
- : React.createElement("input", { className: 'theia-input', type: 'text', defaultValue: this.title.label, onKeyDown: this.saveHeaderInputValue, spellCheck: false, ref: this.assignHeaderInputRef }),
428
- !this.isTitleEditable && (React.createElement("div", { className: `fa fa-pencil${this.showTitleEditIcon ? ' show' : ' hide'}` })),
429
- this.isTitleEditable && (React.createElement("div", { className: 'fa fa-save', onClick: this.saveHeaderInputValue, onKeyDown: this.saveHeaderInputValue, role: 'button', tabIndex: 0, title: core_1.nls.localizeByDefault('Save') }))));
430
- }
431
- storeState() {
432
- var _a, _b, _c, _d, _e, _f;
433
- return {
434
- address: (_b = (_a = this.addressField) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : this.address,
435
- offset: (_d = parseInt(`${(_c = this.offsetField) === null || _c === void 0 ? void 0 : _c.value}`)) !== null && _d !== void 0 ? _d : this.offset,
436
- length: (_f = parseInt(`${(_e = this.readLengthField) === null || _e === void 0 ? void 0 : _e.value}`)) !== null && _f !== void 0 ? _f : this.readLength,
437
- byteSize: this.byteSize,
438
- bytesPerGroup: this.bytesPerGroup,
439
- groupsPerRow: this.groupsPerRow,
440
- endianness: this.endianness,
441
- doDisplaySettings: this.doDisplaySettings,
442
- columnsDisplayed: this.columnsDisplayed,
443
- recentLocationsArray: this.recentLocations.values,
444
- isFrozen: !this.doUpdateAutomatically,
445
- doUpdateAutomatically: this.doUpdateAutomatically,
446
- };
447
- }
448
- restoreState(oldState) {
449
- var _a, _b, _c, _d, _e, _f, _g, _h;
450
- this.address = (_a = oldState.address) !== null && _a !== void 0 ? _a : this.address;
451
- this.offset = (_b = oldState.offset) !== null && _b !== void 0 ? _b : this.offset;
452
- this.readLength = (_c = oldState.length) !== null && _c !== void 0 ? _c : this.readLength;
453
- this.byteSize = (_d = oldState.byteSize) !== null && _d !== void 0 ? _d : this.byteSize;
454
- this.bytesPerGroup = (_e = oldState.bytesPerGroup) !== null && _e !== void 0 ? _e : this.bytesPerGroup;
455
- this.groupsPerRow = (_f = oldState.groupsPerRow) !== null && _f !== void 0 ? _f : this.groupsPerRow;
456
- this.endianness = (_g = oldState.endianness) !== null && _g !== void 0 ? _g : this.endianness;
457
- this.recentLocations = (_h = new memory_recents_1.Recents(oldState.recentLocationsArray)) !== null && _h !== void 0 ? _h : this.recentLocations;
458
- this.doDisplaySettings = !!oldState.doDisplaySettings;
459
- if (oldState.columnsDisplayed) {
460
- this.columnsDisplayed = oldState.columnsDisplayed;
461
- }
462
- }
463
- fetchNewMemory() {
464
- this.updateMemoryView();
465
- }
466
- async doUpdateMemoryView() {
467
- var _a, _b;
468
- if (!(this.addressField && this.readLengthField)) {
469
- return;
470
- }
471
- if (((_a = this.addressField) === null || _a === void 0 ? void 0 : _a.value.trim().length) === 0) {
472
- this.memoryReadError = core_1.nls.localize('theia/memory-inspector/memory/addressField/memoryReadError', 'Enter an address or expression in the Location field.');
473
- this.doShowMemoryErrors();
474
- return;
475
- }
476
- if (this.readLengthField.value.trim().length === 0) {
477
- this.memoryReadError = core_1.nls.localize('theia/memory-inspector/memory/readLength/memoryReadError', 'Enter a length (decimal or hexadecimal number) in the Length field.');
478
- this.doShowMemoryErrors();
479
- return;
480
- }
481
- const startAddress = this.addressField.value;
482
- const locationOffset = parseInt(`${(_b = this.offsetField) === null || _b === void 0 ? void 0 : _b.value}`) || 0;
483
- const readLength = parseInt(this.readLengthField.value);
484
- try {
485
- this.memoryReadResult = await this.getMemory(startAddress, readLength, locationOffset);
486
- this.fireDidChangeMemory();
487
- if (this.pinnedMemoryReadResult) {
488
- this.pinnedMemoryReadResult.resolve(this.memoryReadResult);
489
- }
490
- this.doShowMemoryErrors(true);
491
- }
492
- catch (err) {
493
- this.memoryReadError = this.getUserError(err);
494
- console.error('Failed to read memory', err);
495
- this.doShowMemoryErrors();
496
- if (this.pinnedMemoryReadResult) {
497
- this.pinnedMemoryReadResult.resolve(this.memoryReadResult);
498
- }
499
- }
500
- finally {
501
- this.pinnedMemoryReadResult = undefined;
502
- this.update();
503
- }
504
- }
505
- getUserError(err) {
506
- return err instanceof Error ? err.message : core_1.nls.localize('theia/memory-inspector/memory/userError', 'There was an error fetching memory.');
507
- }
508
- async getMemory(memoryReference, count, offset) {
509
- const result = await this.retrieveMemory(memoryReference, count, offset);
510
- try {
511
- this.variables = await this.memoryProvider.getLocals();
512
- }
513
- catch (_a) {
514
- this.variables = [];
515
- }
516
- this.recentLocations.add(memoryReference);
517
- this.updateDefaults(memoryReference, count, offset);
518
- return result;
519
- }
520
- async retrieveMemory(memoryReference, count, offset) {
521
- return this.memoryProvider.readMemory({ memoryReference, count, offset });
522
- }
523
- // TODO: This may not be necessary if we change how state is stored (currently in the text fields themselves.)
524
- updateDefaults(address, readLength, offset) {
525
- this.address = address;
526
- this.readLength = readLength;
527
- this.offset = offset;
528
- }
529
- fireDidChangeOptions(targetId) {
530
- this.onOptionsChangedEmitter.fire(targetId);
531
- }
532
- fireDidChangeMemory() {
533
- this.onMemoryChangedEmitter.fire(this.memoryReadResult);
534
- }
535
- };
536
- MemoryOptionsWidget.ID = 'memory-view-options-widget';
537
- MemoryOptionsWidget.LABEL = core_1.nls.localize('theia/memory-inspector/memoryTitle', 'Memory');
538
- MemoryOptionsWidget.WIDGET_H2_CLASS = 'memory-widget-header';
539
- MemoryOptionsWidget.WIDGET_HEADER_INPUT_CLASS = 'memory-widget-header-input';
540
- __decorate([
541
- (0, inversify_1.inject)(memory_provider_service_1.MemoryProviderService),
542
- __metadata("design:type", memory_provider_service_1.MemoryProviderService)
543
- ], MemoryOptionsWidget.prototype, "memoryProvider", void 0);
544
- __decorate([
545
- (0, inversify_1.inject)(debug_session_manager_1.DebugSessionManager),
546
- __metadata("design:type", debug_session_manager_1.DebugSessionManager)
547
- ], MemoryOptionsWidget.prototype, "sessionManager", void 0);
548
- __decorate([
549
- (0, inversify_1.inject)(memory_widget_utils_1.MemoryWidgetOptions),
550
- __metadata("design:type", Object)
551
- ], MemoryOptionsWidget.prototype, "memoryWidgetOptions", void 0);
552
- __decorate([
553
- (0, inversify_1.postConstruct)(),
554
- __metadata("design:type", Function),
555
- __metadata("design:paramtypes", []),
556
- __metadata("design:returntype", void 0)
557
- ], MemoryOptionsWidget.prototype, "init", null);
558
- MemoryOptionsWidget = MemoryOptionsWidget_1 = __decorate([
559
- (0, inversify_1.injectable)()
560
- ], MemoryOptionsWidget);
561
- exports.MemoryOptionsWidget = MemoryOptionsWidget;
1
+ "use strict";
2
+ /********************************************************************************
3
+ * Copyright (C) 2021 Ericsson and others.
4
+ *
5
+ * This program and the accompanying materials are made available under the
6
+ * terms of the Eclipse Public License v. 2.0 which is available at
7
+ * http://www.eclipse.org/legal/epl-2.0.
8
+ *
9
+ * This Source Code may also be made available under the following Secondary
10
+ * Licenses when the conditions for such availability set forth in the Eclipse
11
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ * with the GNU Classpath Exception which is available at
13
+ * https://www.gnu.org/software/classpath/license.html.
14
+ *
15
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
+ ********************************************************************************/
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ var __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ var MemoryOptionsWidget_1;
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ exports.MemoryOptionsWidget = exports.AUTO_UPDATE_TOGGLE_ID = exports.ASCII_TOGGLE_ID = exports.ENDIAN_SELECT_ID = exports.BYTES_PER_GROUP_FIELD_ID = exports.BYTES_PER_ROW_FIELD_ID = exports.LOCATION_OFFSET_FIELD_ID = exports.LENGTH_FIELD_ID = exports.LOCATION_FIELD_ID = exports.EMPTY_MEMORY = void 0;
29
+ const core_1 = require("@theia/core");
30
+ const browser_1 = require("@theia/core/lib/browser");
31
+ const promise_util_1 = require("@theia/core/lib/common/promise-util");
32
+ const inversify_1 = require("@theia/core/shared/inversify");
33
+ const React = require("@theia/core/shared/react");
34
+ const debug_session_1 = require("@theia/debug/lib/browser/debug-session");
35
+ const debug_session_manager_1 = require("@theia/debug/lib/browser/debug-session-manager");
36
+ const Long = require("long");
37
+ const memory_provider_service_1 = require("../memory-provider/memory-provider-service");
38
+ const memory_recents_1 = require("../utils/memory-recents");
39
+ const memory_widget_components_1 = require("../utils/memory-widget-components");
40
+ const memory_widget_utils_1 = require("../utils/memory-widget-utils");
41
+ const multi_select_bar_1 = require("../utils/multi-select-bar");
42
+ const debounce = require("@theia/core/shared/lodash.debounce");
43
+ exports.EMPTY_MEMORY = (0, core_1.deepFreeze)({
44
+ bytes: new Uint8Array(),
45
+ address: new Long(0, 0, true),
46
+ });
47
+ exports.LOCATION_FIELD_ID = 't-mv-location';
48
+ exports.LENGTH_FIELD_ID = 't-mv-length';
49
+ exports.LOCATION_OFFSET_FIELD_ID = 't-mv-location-offset';
50
+ exports.BYTES_PER_ROW_FIELD_ID = 't-mv-bytesrow';
51
+ exports.BYTES_PER_GROUP_FIELD_ID = 't-mv-bytesgroup';
52
+ exports.ENDIAN_SELECT_ID = 't-mv-endiannesss';
53
+ exports.ASCII_TOGGLE_ID = 't-mv-ascii-toggle';
54
+ exports.AUTO_UPDATE_TOGGLE_ID = 't-mv-auto-update-toggle';
55
+ let MemoryOptionsWidget = MemoryOptionsWidget_1 = class MemoryOptionsWidget extends browser_1.ReactWidget {
56
+ constructor() {
57
+ super(...arguments);
58
+ this.iconClass = 'memory-view-icon';
59
+ this.lockIconClass = 'memory-lock-icon';
60
+ this.additionalColumnSelectLabel = core_1.nls.localize('theia/memory-inspector/extraColumn', 'Extra Column');
61
+ this.sessionListeners = new core_1.DisposableCollection();
62
+ this.onOptionsChangedEmitter = new core_1.Emitter();
63
+ this.onOptionsChanged = this.onOptionsChangedEmitter.event;
64
+ this.onMemoryChangedEmitter = new core_1.Emitter();
65
+ this.onMemoryChanged = this.onMemoryChangedEmitter.event;
66
+ this.memoryReadResult = exports.EMPTY_MEMORY;
67
+ this.columnsDisplayed = {
68
+ address: {
69
+ label: core_1.nls.localizeByDefault('Address'),
70
+ doRender: true
71
+ },
72
+ data: {
73
+ label: core_1.nls.localize('theia/memory-inspector/data', 'Data'),
74
+ doRender: true
75
+ },
76
+ variables: {
77
+ label: core_1.nls.localizeByDefault('Variables'),
78
+ doRender: true
79
+ },
80
+ ascii: {
81
+ label: core_1.nls.localize('theia/memory-inspector/ascii', 'ASCII'),
82
+ doRender: false
83
+ },
84
+ };
85
+ this.byteSize = 8;
86
+ this.bytesPerGroup = 1;
87
+ this.groupsPerRow = 4;
88
+ this.variables = [];
89
+ this.endianness = memory_widget_utils_1.Interfaces.Endianness.Little;
90
+ this.memoryReadError = core_1.nls.localize('theia/memory-inspector/memory/readError/noContents', 'No memory contents currently available.');
91
+ this.address = 0;
92
+ this.offset = 0;
93
+ this.readLength = 256;
94
+ this.doDisplaySettings = false;
95
+ this.doUpdateAutomatically = true;
96
+ this.showMemoryError = false;
97
+ this.errorTimeout = undefined;
98
+ this.recentLocations = new memory_recents_1.Recents();
99
+ this.showTitleEditIcon = false;
100
+ this.isTitleEditable = false;
101
+ this.handleColumnSelectionChange = (columnLabel, doShow) => this.doHandleColumnSelectionChange(columnLabel, doShow);
102
+ this.toggleAutoUpdate = (e) => {
103
+ var _a;
104
+ if (e.nativeEvent.type === 'click') {
105
+ e.currentTarget.blur();
106
+ }
107
+ if ('key' in e && ((_a = browser_1.KeyCode.createKeyCode(e.nativeEvent).key) === null || _a === void 0 ? void 0 : _a.keyCode) === browser_1.Key.TAB.keyCode) {
108
+ return;
109
+ }
110
+ this.doUpdateAutomatically = !this.doUpdateAutomatically;
111
+ if (this.doUpdateAutomatically) {
112
+ this.title.iconClass = this.iconClass;
113
+ }
114
+ else {
115
+ this.title.iconClass = this.lockIconClass;
116
+ }
117
+ this.fireDidChangeOptions();
118
+ };
119
+ this.onByteSizeChange = (event) => {
120
+ this.byteSize = parseInt(event.target.value);
121
+ this.fireDidChangeOptions(event.target.id);
122
+ };
123
+ this.toggleDoShowSettings = (e) => {
124
+ var _a;
125
+ if (!('key' in e) || ((_a = browser_1.KeyCode.createKeyCode(e.nativeEvent).key) === null || _a === void 0 ? void 0 : _a.keyCode) === browser_1.Key.TAB.keyCode) {
126
+ this.doDisplaySettings = !this.doDisplaySettings;
127
+ this.update();
128
+ }
129
+ };
130
+ this.assignLocationRef = location => {
131
+ this.addressField = location !== null && location !== void 0 ? location : undefined;
132
+ };
133
+ this.assignReadLengthRef = readLength => {
134
+ this.readLengthField = readLength !== null && readLength !== void 0 ? readLength : undefined;
135
+ };
136
+ this.assignOffsetRef = offset => {
137
+ this.offsetField = offset !== null && offset !== void 0 ? offset : undefined;
138
+ };
139
+ this.setAddressFromSelect = (e) => {
140
+ if (this.addressField) {
141
+ this.addressField.value = e.target.value;
142
+ }
143
+ };
144
+ this.activateHeaderInputField = (e) => {
145
+ var _a, _b;
146
+ if (!this.isTitleEditable) {
147
+ const isMouseDown = !('key' in e);
148
+ const isActivationKey = 'key' in e && (((_a = browser_1.KeyCode.createKeyCode(e.nativeEvent).key) === null || _a === void 0 ? void 0 : _a.keyCode) === browser_1.Key.SPACE.keyCode
149
+ || ((_b = browser_1.KeyCode.createKeyCode(e.nativeEvent).key) === null || _b === void 0 ? void 0 : _b.keyCode) === browser_1.Key.ENTER.keyCode);
150
+ if (isMouseDown || isActivationKey) {
151
+ if (isMouseDown) {
152
+ e.currentTarget.blur();
153
+ }
154
+ this.isTitleEditable = true;
155
+ this.update();
156
+ }
157
+ }
158
+ };
159
+ this.saveHeaderInputValue = (e) => {
160
+ const isMouseDown = !('key' in e);
161
+ const isSaveKey = 'key' in e && e.key === 'Enter';
162
+ const isCancelKey = 'key' in e && e.key === 'Escape';
163
+ e.stopPropagation();
164
+ if (isMouseDown || isSaveKey || isCancelKey) {
165
+ this.updateHeader(isCancelKey);
166
+ }
167
+ };
168
+ this.assignHeaderInputRef = (element) => {
169
+ if (element) {
170
+ this.headerInputField = element;
171
+ element.focus();
172
+ }
173
+ };
174
+ this.doShowMemoryErrors = (doClearError = false) => {
175
+ if (this.errorTimeout !== undefined) {
176
+ clearTimeout(this.errorTimeout);
177
+ }
178
+ if (doClearError) {
179
+ this.showMemoryError = false;
180
+ this.update();
181
+ this.errorTimeout = undefined;
182
+ return;
183
+ }
184
+ this.showMemoryError = true;
185
+ this.update();
186
+ this.errorTimeout = setTimeout(() => {
187
+ this.showMemoryError = false;
188
+ this.update();
189
+ this.errorTimeout = undefined;
190
+ }, memory_widget_utils_1.Constants.ERROR_TIMEOUT);
191
+ };
192
+ this.doRefresh = (event) => {
193
+ if ('key' in event && event.key !== 'Enter') {
194
+ return;
195
+ }
196
+ this.updateMemoryView();
197
+ };
198
+ this.updateMemoryView = debounce(this.doUpdateMemoryView.bind(this), memory_widget_utils_1.Constants.DEBOUNCE_TIME, { trailing: true });
199
+ // Callbacks for when the various view parameters change.
200
+ /**
201
+ * Handle bytes per row changed event.
202
+ */
203
+ this.onGroupsPerRowChange = (event) => {
204
+ const { value, id } = event.target;
205
+ this.groupsPerRow = parseInt(value);
206
+ this.fireDidChangeOptions(id);
207
+ };
208
+ /**
209
+ * Handle bytes per group changed event.
210
+ */
211
+ this.onBytesPerGroupChange = (event) => {
212
+ const { value, id } = event.target;
213
+ this.bytesPerGroup = parseInt(value);
214
+ this.fireDidChangeOptions(id);
215
+ };
216
+ /**
217
+ * Handle endianness changed event.
218
+ */
219
+ this.onEndiannessChange = (event) => {
220
+ const { value, id } = event.target;
221
+ if (value !== memory_widget_utils_1.Interfaces.Endianness.Big && value !== memory_widget_utils_1.Interfaces.Endianness.Little) {
222
+ return;
223
+ }
224
+ this.endianness = value;
225
+ this.fireDidChangeOptions(id);
226
+ };
227
+ }
228
+ get memory() {
229
+ return Object.assign(Object.assign({}, this.memoryReadResult), { variables: this.variables });
230
+ }
231
+ get options() {
232
+ return this.storeState();
233
+ }
234
+ init() {
235
+ this.addClass(MemoryOptionsWidget_1.ID);
236
+ this.title.label = core_1.nls.localize('theia/memory-inspector/memory', 'Memory ({0})', this.memoryWidgetOptions.displayId);
237
+ this.title.caption = core_1.nls.localize('theia/memory-inspector/memory', 'Memory ({0})', this.memoryWidgetOptions.displayId);
238
+ this.title.iconClass = this.iconClass;
239
+ this.title.closable = true;
240
+ if (this.memoryWidgetOptions.dynamic !== false) {
241
+ this.toDispose.push(this.sessionManager.onDidChangeActiveDebugSession(({ current }) => {
242
+ this.setUpListeners(current);
243
+ }));
244
+ this.toDispose.push(this.sessionManager.onDidCreateDebugSession(current => {
245
+ this.setUpListeners(current);
246
+ }));
247
+ this.setUpListeners(this.sessionManager.currentSession);
248
+ }
249
+ this.toDispose.push(this.onOptionsChanged(() => this.update()));
250
+ this.update();
251
+ }
252
+ async setAddressAndGo(newAddress, newOffset, newLength, direction) {
253
+ let doUpdate = false;
254
+ const originalValues = {
255
+ offset: '',
256
+ length: '',
257
+ };
258
+ if (this.addressField) {
259
+ this.addressField.value = newAddress;
260
+ doUpdate = true;
261
+ }
262
+ if (this.offsetField && newOffset !== undefined) {
263
+ originalValues.offset = this.offsetField.value;
264
+ this.offsetField.value = newOffset.toString();
265
+ doUpdate = true;
266
+ }
267
+ if (this.readLengthField && newLength !== undefined) {
268
+ originalValues.length = this.readLengthField.value;
269
+ this.readLengthField.value = newLength.toString();
270
+ doUpdate = true;
271
+ }
272
+ if (doUpdate && this.readLengthField && this.offsetField) {
273
+ this.pinnedMemoryReadResult = new promise_util_1.Deferred();
274
+ this.updateMemoryView();
275
+ const result = await this.pinnedMemoryReadResult.promise;
276
+ if (result === false) {
277
+ // Memory request errored
278
+ this.readLengthField.value = originalValues.length;
279
+ this.offsetField.value = originalValues.offset;
280
+ }
281
+ if (result) {
282
+ // Memory request returned some memory
283
+ const resultLength = result.bytes.length * 8 / this.byteSize;
284
+ const lengthFieldValue = parseInt(this.readLengthField.value);
285
+ if (lengthFieldValue !== resultLength) {
286
+ this.memoryReadError = core_1.nls.localize('theia/memory-inspector/memory/readError/bounds', 'Memory bounds exceeded, result will be truncated.');
287
+ this.doShowMemoryErrors();
288
+ this.readLengthField.value = resultLength.toString();
289
+ if (direction === 'above') {
290
+ this.offsetField.value = `${parseInt(originalValues.offset) - (resultLength - parseInt(originalValues.length))}`;
291
+ }
292
+ this.update();
293
+ }
294
+ }
295
+ }
296
+ return undefined;
297
+ }
298
+ setUpListeners(session) {
299
+ this.sessionListeners.dispose();
300
+ this.sessionListeners = new core_1.DisposableCollection(core_1.Disposable.create(() => this.handleActiveSessionChange()));
301
+ if (session) {
302
+ this.sessionListeners.push(session.onDidChange(() => this.handleSessionChange()));
303
+ }
304
+ }
305
+ handleActiveSessionChange() {
306
+ const isDynamic = this.memoryWidgetOptions.dynamic !== false;
307
+ if (isDynamic && this.doUpdateAutomatically) {
308
+ this.memoryReadResult = exports.EMPTY_MEMORY;
309
+ this.fireDidChangeMemory();
310
+ }
311
+ }
312
+ handleSessionChange() {
313
+ var _a, _b;
314
+ const isStopped = ((_a = this.sessionManager.currentSession) === null || _a === void 0 ? void 0 : _a.state) === debug_session_1.DebugState.Stopped;
315
+ const isReadyForQuery = !!((_b = this.sessionManager.currentSession) === null || _b === void 0 ? void 0 : _b.currentFrame);
316
+ const isDynamic = this.memoryWidgetOptions.dynamic !== false;
317
+ if (isStopped && isReadyForQuery && isDynamic && this.doUpdateAutomatically && this.memoryReadResult !== exports.EMPTY_MEMORY) {
318
+ this.updateMemoryView();
319
+ }
320
+ }
321
+ onActivateRequest(msg) {
322
+ super.onActivateRequest(msg);
323
+ this.acceptFocus();
324
+ }
325
+ acceptFocus() {
326
+ if (this.doUpdateAutomatically) {
327
+ if (this.addressField) {
328
+ this.addressField.focus();
329
+ this.addressField.select();
330
+ }
331
+ }
332
+ else {
333
+ const settingsCog = this.node.querySelector('.toggle-settings-click-zone');
334
+ settingsCog === null || settingsCog === void 0 ? void 0 : settingsCog.focus();
335
+ }
336
+ }
337
+ doHandleColumnSelectionChange(columnLabel, doShow) {
338
+ if (columnLabel in this.columnsDisplayed) {
339
+ this.columnsDisplayed[columnLabel].doRender = doShow;
340
+ this.fireDidChangeOptions(exports.ASCII_TOGGLE_ID);
341
+ }
342
+ }
343
+ onAfterAttach(msg) {
344
+ super.onAfterAttach(msg);
345
+ if (this.memoryWidgetOptions.dynamic !== false) {
346
+ if (this.addressField) {
347
+ this.addressField.value = this.address.toString();
348
+ }
349
+ }
350
+ }
351
+ render() {
352
+ return (React.createElement("div", { className: 't-mv-container' }, this.renderInputContainer()));
353
+ }
354
+ renderInputContainer() {
355
+ return (React.createElement("div", { className: 't-mv-settings-container' },
356
+ React.createElement("div", { className: 't-mv-wrapper' },
357
+ this.renderToolbar(),
358
+ this.renderMemoryLocationGroup(),
359
+ this.doDisplaySettings && (React.createElement("div", { className: 't-mv-toggle-settings-wrapper' }, this.renderByteDisplayGroup())))));
360
+ }
361
+ renderByteDisplayGroup() {
362
+ return (React.createElement("div", { className: 't-mv-group settings-group' },
363
+ React.createElement(memory_widget_components_1.MWSelect, { id: 'byte-size-select', label: core_1.nls.localize('theia/memory-inspector/byteSize', 'Byte Size'), value: this.byteSize.toString(), onChange: this.onByteSizeChange, options: ['8', '16', '32', '64'] }),
364
+ React.createElement(memory_widget_components_1.MWSelect, { id: exports.BYTES_PER_GROUP_FIELD_ID, label: core_1.nls.localize('theia/memory-inspector/bytesPerGroup', 'Bytes Per Group'), value: this.bytesPerGroup.toString(), onChange: this.onBytesPerGroupChange, options: ['1', '2', '4', '8', '16'] }),
365
+ React.createElement(memory_widget_components_1.MWSelect, { id: exports.BYTES_PER_ROW_FIELD_ID, label: core_1.nls.localize('theia/memory-inspector/groupsPerRow', 'Groups Per Row'), value: this.groupsPerRow.toString(), onChange: this.onGroupsPerRowChange, options: ['1', '2', '4', '8', '16', '32'] }),
366
+ React.createElement(memory_widget_components_1.MWSelect, { id: exports.ENDIAN_SELECT_ID, label: core_1.nls.localize('theia/memory-inspector/endianness', 'Endianness'), value: this.endianness, onChange: this.onEndiannessChange, options: [memory_widget_utils_1.Interfaces.Endianness.Little, memory_widget_utils_1.Interfaces.Endianness.Big] }),
367
+ React.createElement(multi_select_bar_1.MWMultiSelect, { id: exports.ASCII_TOGGLE_ID, label: core_1.nls.localize('theia/memory-inspector/columns', 'Columns'), items: this.getOptionalColumns(), onSelectionChanged: this.handleColumnSelectionChange })));
368
+ }
369
+ getObligatoryColumnIds() {
370
+ return ['address', 'data'];
371
+ }
372
+ getOptionalColumns() {
373
+ const obligatoryColumns = new Set(this.getObligatoryColumnIds());
374
+ return Object.entries(this.columnsDisplayed)
375
+ .reduce((accumulated, [id, { doRender, label }]) => {
376
+ if (!obligatoryColumns.has(id)) {
377
+ accumulated.push({ id, label, defaultChecked: doRender });
378
+ }
379
+ return accumulated;
380
+ }, []);
381
+ }
382
+ renderMemoryLocationGroup() {
383
+ return (React.createElement(React.Fragment, null,
384
+ React.createElement("div", { className: 't-mv-group view-group' },
385
+ React.createElement(memory_widget_components_1.MWInputWithSelect, { id: exports.LOCATION_FIELD_ID, label: core_1.nls.localizeByDefault('Address'), title: core_1.nls.localize('theia/memory-inspector/addressTooltip', 'Memory location to display, an address or expression evaluating to an address'), defaultValue: `${this.address}`, onSelectChange: this.setAddressFromSelect, passRef: this.assignLocationRef, onKeyDown: this.doRefresh, options: [...this.recentLocations.values], disabled: !this.doUpdateAutomatically }),
386
+ React.createElement(memory_widget_components_1.MWInput, { id: exports.LOCATION_OFFSET_FIELD_ID, label: core_1.nls.localize('theia/memory-inspector/offset', 'Offset'), title: core_1.nls.localize('theia/memory-inspector/offsetTooltip', 'Offset to be added to the current memory location, when navigating'), defaultValue: '0', passRef: this.assignOffsetRef, onKeyDown: this.doRefresh, disabled: !this.doUpdateAutomatically }),
387
+ React.createElement(memory_widget_components_1.MWInput, { id: exports.LENGTH_FIELD_ID, label: core_1.nls.localize('theia/memory-inspector/length', 'Length'), title: core_1.nls.localize('theia/memory-inspector/lengthTooltip', 'Number of bytes to fetch, in decimal or hexadecimal'), defaultValue: this.readLength.toString(), passRef: this.assignReadLengthRef, onChange: memory_widget_utils_1.Utils.validateNumericalInputs, onKeyDown: this.doRefresh, disabled: !this.doUpdateAutomatically }),
388
+ React.createElement("button", { type: 'button', className: 'theia-button main view-group-go-button', onClick: this.doRefresh, disabled: !this.doUpdateAutomatically, title: core_1.nls.localizeByDefault('Go') }, core_1.nls.localizeByDefault('Go'))),
389
+ React.createElement("div", { className: `t-mv-memory-fetch-error${this.showMemoryError ? ' show' : ' hide'}` }, this.memoryReadError)));
390
+ }
391
+ updateHeader(isCancelKey) {
392
+ if (!isCancelKey && this.headerInputField) {
393
+ this.title.label = this.headerInputField.value;
394
+ this.title.caption = this.headerInputField.value;
395
+ }
396
+ this.isTitleEditable = false;
397
+ this.update();
398
+ }
399
+ renderToolbar() {
400
+ return (React.createElement("div", { className: 'memory-widget-toolbar' },
401
+ this.renderLockIcon(),
402
+ this.renderEditableTitleField(),
403
+ this.renderSettingsContainer()));
404
+ }
405
+ renderSettingsContainer() {
406
+ return React.createElement("div", { className: 'toggle-settings-container' },
407
+ React.createElement("div", { className: 'toggle-settings-click-zone no-select', tabIndex: 0, "aria-label": this.doDisplaySettings ?
408
+ core_1.nls.localize('theia/memory-inspector/memory/hideSettings', 'Hide Settings Panel') :
409
+ core_1.nls.localize('theia/memory-inspector/memory/showSettings', 'Show Settings Panel'), role: 'button', onClick: this.toggleDoShowSettings, onKeyDown: this.toggleDoShowSettings, title: this.doDisplaySettings ?
410
+ core_1.nls.localize('theia/memory-inspector/memory/hideSettings', 'Hide Settings Panel') :
411
+ core_1.nls.localize('theia/memory-inspector/memory/showSettings', 'Show Settings Panel') },
412
+ React.createElement("i", { className: 'codicon codicon-settings-gear' }),
413
+ React.createElement("span", null, this.doDisplaySettings ?
414
+ core_1.nls.localize('theia/memory-inspector/closeSettings', 'Close Settings') :
415
+ core_1.nls.localizeByDefault('Settings'))));
416
+ }
417
+ renderLockIcon() {
418
+ return this.memoryWidgetOptions.dynamic !== false && (React.createElement("div", { className: 'memory-widget-auto-updates-container' },
419
+ React.createElement("div", { className: `fa fa-${this.doUpdateAutomatically ? 'unlock' : 'lock'}`, id: exports.AUTO_UPDATE_TOGGLE_ID, title: this.doUpdateAutomatically ?
420
+ core_1.nls.localize('theia/memory-inspector/memory/freeze', 'Freeze Memory View') :
421
+ core_1.nls.localize('theia/memory-inspector/memory/unfreeze', 'Unfreeze Memory View'), onClick: this.toggleAutoUpdate, onKeyDown: this.toggleAutoUpdate, role: 'button', tabIndex: 0 })));
422
+ }
423
+ renderEditableTitleField() {
424
+ return (React.createElement("div", { className: 'memory-widget-header-click-zone', tabIndex: 0, onClick: this.activateHeaderInputField, onKeyDown: this.activateHeaderInputField, role: 'button' },
425
+ !this.isTitleEditable
426
+ ? (React.createElement("h2", { className: `${MemoryOptionsWidget_1.WIDGET_H2_CLASS}${!this.doUpdateAutomatically ? ' disabled' : ''} no-select` }, this.title.label))
427
+ : React.createElement("input", { className: 'theia-input', type: 'text', defaultValue: this.title.label, onKeyDown: this.saveHeaderInputValue, spellCheck: false, ref: this.assignHeaderInputRef }),
428
+ !this.isTitleEditable && (React.createElement("div", { className: `fa fa-pencil${this.showTitleEditIcon ? ' show' : ' hide'}` })),
429
+ this.isTitleEditable && (React.createElement("div", { className: 'fa fa-save', onClick: this.saveHeaderInputValue, onKeyDown: this.saveHeaderInputValue, role: 'button', tabIndex: 0, title: core_1.nls.localizeByDefault('Save') }))));
430
+ }
431
+ storeState() {
432
+ var _a, _b, _c, _d, _e, _f;
433
+ return {
434
+ address: (_b = (_a = this.addressField) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : this.address,
435
+ offset: (_d = parseInt(`${(_c = this.offsetField) === null || _c === void 0 ? void 0 : _c.value}`)) !== null && _d !== void 0 ? _d : this.offset,
436
+ length: (_f = parseInt(`${(_e = this.readLengthField) === null || _e === void 0 ? void 0 : _e.value}`)) !== null && _f !== void 0 ? _f : this.readLength,
437
+ byteSize: this.byteSize,
438
+ bytesPerGroup: this.bytesPerGroup,
439
+ groupsPerRow: this.groupsPerRow,
440
+ endianness: this.endianness,
441
+ doDisplaySettings: this.doDisplaySettings,
442
+ columnsDisplayed: this.columnsDisplayed,
443
+ recentLocationsArray: this.recentLocations.values,
444
+ isFrozen: !this.doUpdateAutomatically,
445
+ doUpdateAutomatically: this.doUpdateAutomatically,
446
+ };
447
+ }
448
+ restoreState(oldState) {
449
+ var _a, _b, _c, _d, _e, _f, _g, _h;
450
+ this.address = (_a = oldState.address) !== null && _a !== void 0 ? _a : this.address;
451
+ this.offset = (_b = oldState.offset) !== null && _b !== void 0 ? _b : this.offset;
452
+ this.readLength = (_c = oldState.length) !== null && _c !== void 0 ? _c : this.readLength;
453
+ this.byteSize = (_d = oldState.byteSize) !== null && _d !== void 0 ? _d : this.byteSize;
454
+ this.bytesPerGroup = (_e = oldState.bytesPerGroup) !== null && _e !== void 0 ? _e : this.bytesPerGroup;
455
+ this.groupsPerRow = (_f = oldState.groupsPerRow) !== null && _f !== void 0 ? _f : this.groupsPerRow;
456
+ this.endianness = (_g = oldState.endianness) !== null && _g !== void 0 ? _g : this.endianness;
457
+ this.recentLocations = (_h = new memory_recents_1.Recents(oldState.recentLocationsArray)) !== null && _h !== void 0 ? _h : this.recentLocations;
458
+ this.doDisplaySettings = !!oldState.doDisplaySettings;
459
+ if (oldState.columnsDisplayed) {
460
+ this.columnsDisplayed = oldState.columnsDisplayed;
461
+ }
462
+ }
463
+ fetchNewMemory() {
464
+ this.updateMemoryView();
465
+ }
466
+ async doUpdateMemoryView() {
467
+ var _a, _b;
468
+ if (!(this.addressField && this.readLengthField)) {
469
+ return;
470
+ }
471
+ if (((_a = this.addressField) === null || _a === void 0 ? void 0 : _a.value.trim().length) === 0) {
472
+ this.memoryReadError = core_1.nls.localize('theia/memory-inspector/memory/addressField/memoryReadError', 'Enter an address or expression in the Location field.');
473
+ this.doShowMemoryErrors();
474
+ return;
475
+ }
476
+ if (this.readLengthField.value.trim().length === 0) {
477
+ this.memoryReadError = core_1.nls.localize('theia/memory-inspector/memory/readLength/memoryReadError', 'Enter a length (decimal or hexadecimal number) in the Length field.');
478
+ this.doShowMemoryErrors();
479
+ return;
480
+ }
481
+ const startAddress = this.addressField.value;
482
+ const locationOffset = parseInt(`${(_b = this.offsetField) === null || _b === void 0 ? void 0 : _b.value}`) || 0;
483
+ const readLength = parseInt(this.readLengthField.value);
484
+ try {
485
+ this.memoryReadResult = await this.getMemory(startAddress, readLength, locationOffset);
486
+ this.fireDidChangeMemory();
487
+ if (this.pinnedMemoryReadResult) {
488
+ this.pinnedMemoryReadResult.resolve(this.memoryReadResult);
489
+ }
490
+ this.doShowMemoryErrors(true);
491
+ }
492
+ catch (err) {
493
+ this.memoryReadError = this.getUserError(err);
494
+ console.error('Failed to read memory', err);
495
+ this.doShowMemoryErrors();
496
+ if (this.pinnedMemoryReadResult) {
497
+ this.pinnedMemoryReadResult.resolve(this.memoryReadResult);
498
+ }
499
+ }
500
+ finally {
501
+ this.pinnedMemoryReadResult = undefined;
502
+ this.update();
503
+ }
504
+ }
505
+ getUserError(err) {
506
+ return err instanceof Error ? err.message : core_1.nls.localize('theia/memory-inspector/memory/userError', 'There was an error fetching memory.');
507
+ }
508
+ async getMemory(memoryReference, count, offset) {
509
+ const result = await this.retrieveMemory(memoryReference, count, offset);
510
+ try {
511
+ this.variables = await this.memoryProvider.getLocals();
512
+ }
513
+ catch (_a) {
514
+ this.variables = [];
515
+ }
516
+ this.recentLocations.add(memoryReference);
517
+ this.updateDefaults(memoryReference, count, offset);
518
+ return result;
519
+ }
520
+ async retrieveMemory(memoryReference, count, offset) {
521
+ return this.memoryProvider.readMemory({ memoryReference, count, offset });
522
+ }
523
+ // TODO: This may not be necessary if we change how state is stored (currently in the text fields themselves.)
524
+ updateDefaults(address, readLength, offset) {
525
+ this.address = address;
526
+ this.readLength = readLength;
527
+ this.offset = offset;
528
+ }
529
+ fireDidChangeOptions(targetId) {
530
+ this.onOptionsChangedEmitter.fire(targetId);
531
+ }
532
+ fireDidChangeMemory() {
533
+ this.onMemoryChangedEmitter.fire(this.memoryReadResult);
534
+ }
535
+ };
536
+ MemoryOptionsWidget.ID = 'memory-view-options-widget';
537
+ MemoryOptionsWidget.LABEL = core_1.nls.localize('theia/memory-inspector/memoryTitle', 'Memory');
538
+ MemoryOptionsWidget.WIDGET_H2_CLASS = 'memory-widget-header';
539
+ MemoryOptionsWidget.WIDGET_HEADER_INPUT_CLASS = 'memory-widget-header-input';
540
+ __decorate([
541
+ (0, inversify_1.inject)(memory_provider_service_1.MemoryProviderService),
542
+ __metadata("design:type", memory_provider_service_1.MemoryProviderService)
543
+ ], MemoryOptionsWidget.prototype, "memoryProvider", void 0);
544
+ __decorate([
545
+ (0, inversify_1.inject)(debug_session_manager_1.DebugSessionManager),
546
+ __metadata("design:type", debug_session_manager_1.DebugSessionManager)
547
+ ], MemoryOptionsWidget.prototype, "sessionManager", void 0);
548
+ __decorate([
549
+ (0, inversify_1.inject)(memory_widget_utils_1.MemoryWidgetOptions),
550
+ __metadata("design:type", Object)
551
+ ], MemoryOptionsWidget.prototype, "memoryWidgetOptions", void 0);
552
+ __decorate([
553
+ (0, inversify_1.postConstruct)(),
554
+ __metadata("design:type", Function),
555
+ __metadata("design:paramtypes", []),
556
+ __metadata("design:returntype", void 0)
557
+ ], MemoryOptionsWidget.prototype, "init", null);
558
+ MemoryOptionsWidget = MemoryOptionsWidget_1 = __decorate([
559
+ (0, inversify_1.injectable)()
560
+ ], MemoryOptionsWidget);
561
+ exports.MemoryOptionsWidget = MemoryOptionsWidget;
562
562
  //# sourceMappingURL=memory-options-widget.js.map