@theia/memory-inspector 1.53.0-next.55 → 1.53.0-next.64

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 (40) hide show
  1. package/README.md +71 -71
  2. package/package.json +4 -4
  3. package/src/browser/diff-widget/memory-diff-options-widget.tsx +152 -152
  4. package/src/browser/diff-widget/memory-diff-select-widget.tsx +163 -163
  5. package/src/browser/diff-widget/memory-diff-table-widget.tsx +366 -366
  6. package/src/browser/diff-widget/memory-diff-widget-types.ts +45 -45
  7. package/src/browser/editable-widget/memory-editable-table-widget.tsx +359 -359
  8. package/src/browser/memory-inspector-frontend-contribution.ts +301 -301
  9. package/src/browser/memory-inspector-frontend-module.ts +118 -118
  10. package/src/browser/memory-provider/cdt-gdb-memory-provider.ts +132 -132
  11. package/src/browser/memory-provider/memory-provider-service.ts +86 -86
  12. package/src/browser/memory-provider/memory-provider.spec.ts +23 -23
  13. package/src/browser/memory-provider/memory-provider.ts +119 -119
  14. package/src/browser/memory-widget/memory-options-widget.tsx +738 -738
  15. package/src/browser/memory-widget/memory-table-widget.tsx +625 -625
  16. package/src/browser/memory-widget/memory-widget.ts +114 -114
  17. package/src/browser/register-widget/register-filter-service.ts +76 -76
  18. package/src/browser/register-widget/register-options-widget.tsx +393 -393
  19. package/src/browser/register-widget/register-table-widget.tsx +276 -276
  20. package/src/browser/register-widget/register-widget-types.ts +45 -45
  21. package/src/browser/register-widget/register-widget.css +34 -34
  22. package/src/browser/style/index.css +746 -746
  23. package/src/browser/style/memory-lock.svg +21 -21
  24. package/src/browser/style/memory-view.svg +20 -20
  25. package/src/browser/style/register-lock.svg +29 -29
  26. package/src/browser/style/register-view.svg +28 -28
  27. package/src/browser/utils/memory-commands.ts +76 -76
  28. package/src/browser/utils/memory-hover-renderer.ts +113 -113
  29. package/src/browser/utils/memory-recents.ts +58 -58
  30. package/src/browser/utils/memory-widget-components.tsx +193 -193
  31. package/src/browser/utils/memory-widget-manager.ts +179 -179
  32. package/src/browser/utils/memory-widget-utils.tsx +132 -132
  33. package/src/browser/utils/memory-widget-variable-utils.ts +170 -170
  34. package/src/browser/utils/multi-select-bar.css +61 -61
  35. package/src/browser/utils/multi-select-bar.tsx +75 -75
  36. package/src/browser/wrapper-widgets/memory-dock-panel.ts +51 -51
  37. package/src/browser/wrapper-widgets/memory-dockpanel-placeholder-widget.tsx +38 -38
  38. package/src/browser/wrapper-widgets/memory-layout-widget.tsx +167 -167
  39. package/src/common/util.ts +28 -28
  40. package/src/common/utils.spec.ts +52 -52
@@ -1,114 +1,114 @@
1
- /********************************************************************************
2
- * Copyright (C) 2021 Ericsson and others.
3
- *
4
- * This program and the accompanying materials are made available under the
5
- * terms of the Eclipse Public License v. 2.0 which is available at
6
- * http://www.eclipse.org/legal/epl-2.0.
7
- *
8
- * This Source Code may also be made available under the following Secondary
9
- * Licenses when the conditions for such availability set forth in the Eclipse
10
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- * with the GNU Classpath Exception which is available at
12
- * https://www.gnu.org/software/classpath/license.html.
13
- *
14
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- ********************************************************************************/
16
-
17
- import { nls } from '@theia/core';
18
- import { BaseWidget, PanelLayout } from '@theia/core/lib/browser';
19
- import { Container, inject, injectable, interfaces, postConstruct } from '@theia/core/shared/inversify';
20
- import { MemoryWidgetOptions } from '../utils/memory-widget-utils';
21
- import { MemoryOptionsWidget } from './memory-options-widget';
22
- import { MemoryTableWidget } from './memory-table-widget';
23
-
24
- @injectable()
25
- export class MemoryWidget<
26
- O extends MemoryOptionsWidget = MemoryOptionsWidget,
27
- T extends MemoryTableWidget = MemoryTableWidget
28
- >
29
- extends BaseWidget {
30
- static readonly ID = 'memory-view-wrapper';
31
- static readonly LABEL = nls.localize('theia/memory-inspector/memoryTitle', 'Memory');
32
-
33
- @inject(MemoryWidgetOptions) protected readonly memoryWidgetOptions: MemoryWidgetOptions;
34
- @inject(MemoryOptionsWidget) readonly optionsWidget: O;
35
- @inject(MemoryTableWidget) readonly tableWidget: T;
36
-
37
- static createWidget<
38
- Options extends MemoryOptionsWidget = MemoryOptionsWidget,
39
- Table extends MemoryTableWidget = MemoryTableWidget
40
- >(
41
- parent: interfaces.Container,
42
- optionsWidget: interfaces.ServiceIdentifier<Options>,
43
- tableWidget: interfaces.ServiceIdentifier<Table>,
44
- optionSymbol: interfaces.ServiceIdentifier<MemoryWidgetOptions> = MemoryWidgetOptions,
45
- options?: MemoryWidgetOptions,
46
- ): MemoryWidget<Options, Table> {
47
- const child = MemoryWidget.createContainer(parent, optionsWidget, tableWidget, optionSymbol, options);
48
- return child.get(MemoryWidget);
49
- }
50
-
51
- static createContainer(
52
- parent: interfaces.Container,
53
- optionsWidget: interfaces.ServiceIdentifier<MemoryOptionsWidget>,
54
- tableWidget: interfaces.ServiceIdentifier<MemoryTableWidget>,
55
- optionSymbol: interfaces.ServiceIdentifier<MemoryWidgetOptions | undefined> = MemoryWidgetOptions,
56
- options?: MemoryWidgetOptions,
57
- ): interfaces.Container {
58
- const child = new Container({ defaultScope: 'Singleton' });
59
- child.parent = parent;
60
- child.bind(optionsWidget).toSelf();
61
- child.bind(tableWidget).toSelf();
62
- child.bind(MemoryWidgetOptions).toConstantValue(options);
63
- if (optionsWidget !== MemoryOptionsWidget) {
64
- child.bind(MemoryOptionsWidget).toService(optionsWidget);
65
- }
66
- if (tableWidget !== MemoryTableWidget) {
67
- child.bind(MemoryTableWidget).toService(tableWidget);
68
- }
69
- if (optionSymbol !== MemoryWidgetOptions) {
70
- child.bind(optionSymbol).toConstantValue(options);
71
- }
72
- child.bind(MemoryWidget).toSelf();
73
- return child;
74
- }
75
-
76
- static getIdentifier(optionsWidgetID: string): string {
77
- return `${MemoryWidget.ID}-${optionsWidgetID}`;
78
- }
79
-
80
- @postConstruct()
81
- protected init(): void {
82
- this.doInit();
83
- }
84
-
85
- protected async doInit(): Promise<void> {
86
- this.id = MemoryWidget.getIdentifier(this.memoryWidgetOptions.identifier.toString());
87
- this.addClass(MemoryWidget.ID);
88
-
89
- this.title.label = this.optionsWidget.title.label;
90
- this.title.caption = this.optionsWidget.title.caption;
91
- this.title.iconClass = this.optionsWidget.title.iconClass;
92
- this.title.closable = this.optionsWidget.title.closable;
93
-
94
- const layout = this.layout = new PanelLayout();
95
- layout.addWidget(this.optionsWidget);
96
- layout.addWidget(this.tableWidget);
97
-
98
- this.toDispose.pushAll([
99
- this.layout,
100
- this.optionsWidget,
101
- this.tableWidget,
102
- ]);
103
-
104
- this.optionsWidget.title.changed.connect(title => {
105
- this.title.label = title.label;
106
- this.title.caption = title.caption;
107
- this.title.iconClass = title.iconClass;
108
- });
109
- }
110
-
111
- protected override onActivateRequest(): void {
112
- this.optionsWidget.activate();
113
- }
114
- }
1
+ /********************************************************************************
2
+ * Copyright (C) 2021 Ericsson and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+
17
+ import { nls } from '@theia/core';
18
+ import { BaseWidget, PanelLayout } from '@theia/core/lib/browser';
19
+ import { Container, inject, injectable, interfaces, postConstruct } from '@theia/core/shared/inversify';
20
+ import { MemoryWidgetOptions } from '../utils/memory-widget-utils';
21
+ import { MemoryOptionsWidget } from './memory-options-widget';
22
+ import { MemoryTableWidget } from './memory-table-widget';
23
+
24
+ @injectable()
25
+ export class MemoryWidget<
26
+ O extends MemoryOptionsWidget = MemoryOptionsWidget,
27
+ T extends MemoryTableWidget = MemoryTableWidget
28
+ >
29
+ extends BaseWidget {
30
+ static readonly ID = 'memory-view-wrapper';
31
+ static readonly LABEL = nls.localize('theia/memory-inspector/memoryTitle', 'Memory');
32
+
33
+ @inject(MemoryWidgetOptions) protected readonly memoryWidgetOptions: MemoryWidgetOptions;
34
+ @inject(MemoryOptionsWidget) readonly optionsWidget: O;
35
+ @inject(MemoryTableWidget) readonly tableWidget: T;
36
+
37
+ static createWidget<
38
+ Options extends MemoryOptionsWidget = MemoryOptionsWidget,
39
+ Table extends MemoryTableWidget = MemoryTableWidget
40
+ >(
41
+ parent: interfaces.Container,
42
+ optionsWidget: interfaces.ServiceIdentifier<Options>,
43
+ tableWidget: interfaces.ServiceIdentifier<Table>,
44
+ optionSymbol: interfaces.ServiceIdentifier<MemoryWidgetOptions> = MemoryWidgetOptions,
45
+ options?: MemoryWidgetOptions,
46
+ ): MemoryWidget<Options, Table> {
47
+ const child = MemoryWidget.createContainer(parent, optionsWidget, tableWidget, optionSymbol, options);
48
+ return child.get(MemoryWidget);
49
+ }
50
+
51
+ static createContainer(
52
+ parent: interfaces.Container,
53
+ optionsWidget: interfaces.ServiceIdentifier<MemoryOptionsWidget>,
54
+ tableWidget: interfaces.ServiceIdentifier<MemoryTableWidget>,
55
+ optionSymbol: interfaces.ServiceIdentifier<MemoryWidgetOptions | undefined> = MemoryWidgetOptions,
56
+ options?: MemoryWidgetOptions,
57
+ ): interfaces.Container {
58
+ const child = new Container({ defaultScope: 'Singleton' });
59
+ child.parent = parent;
60
+ child.bind(optionsWidget).toSelf();
61
+ child.bind(tableWidget).toSelf();
62
+ child.bind(MemoryWidgetOptions).toConstantValue(options);
63
+ if (optionsWidget !== MemoryOptionsWidget) {
64
+ child.bind(MemoryOptionsWidget).toService(optionsWidget);
65
+ }
66
+ if (tableWidget !== MemoryTableWidget) {
67
+ child.bind(MemoryTableWidget).toService(tableWidget);
68
+ }
69
+ if (optionSymbol !== MemoryWidgetOptions) {
70
+ child.bind(optionSymbol).toConstantValue(options);
71
+ }
72
+ child.bind(MemoryWidget).toSelf();
73
+ return child;
74
+ }
75
+
76
+ static getIdentifier(optionsWidgetID: string): string {
77
+ return `${MemoryWidget.ID}-${optionsWidgetID}`;
78
+ }
79
+
80
+ @postConstruct()
81
+ protected init(): void {
82
+ this.doInit();
83
+ }
84
+
85
+ protected async doInit(): Promise<void> {
86
+ this.id = MemoryWidget.getIdentifier(this.memoryWidgetOptions.identifier.toString());
87
+ this.addClass(MemoryWidget.ID);
88
+
89
+ this.title.label = this.optionsWidget.title.label;
90
+ this.title.caption = this.optionsWidget.title.caption;
91
+ this.title.iconClass = this.optionsWidget.title.iconClass;
92
+ this.title.closable = this.optionsWidget.title.closable;
93
+
94
+ const layout = this.layout = new PanelLayout();
95
+ layout.addWidget(this.optionsWidget);
96
+ layout.addWidget(this.tableWidget);
97
+
98
+ this.toDispose.pushAll([
99
+ this.layout,
100
+ this.optionsWidget,
101
+ this.tableWidget,
102
+ ]);
103
+
104
+ this.optionsWidget.title.changed.connect(title => {
105
+ this.title.label = title.label;
106
+ this.title.caption = title.caption;
107
+ this.title.iconClass = title.iconClass;
108
+ });
109
+ }
110
+
111
+ protected override onActivateRequest(): void {
112
+ this.optionsWidget.activate();
113
+ }
114
+ }
@@ -1,76 +1,76 @@
1
- /********************************************************************************
2
- * Copyright (C) 2021 Ericsson and others.
3
- *
4
- * This program and the accompanying materials are made available under the
5
- * terms of the Eclipse Public License v. 2.0 which is available at
6
- * http://www.eclipse.org/legal/epl-2.0.
7
- *
8
- * This Source Code may also be made available under the following Secondary
9
- * Licenses when the conditions for such availability set forth in the Eclipse
10
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- * with the GNU Classpath Exception which is available at
12
- * https://www.gnu.org/software/classpath/license.html.
13
- *
14
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- ********************************************************************************/
16
-
17
- import { inject, injectable, postConstruct } from '@theia/core/shared/inversify';
18
-
19
- export enum AllOrCustom {
20
- All = 'All',
21
- Custom = 'Custom'
22
- }
23
-
24
- export const RegisterFilterService = Symbol('RegisterFilterService');
25
- export interface RegisterFilterService {
26
- currentFilterLabel: string;
27
- filterLabels: string[];
28
- setFilter(filterLabel: string): void;
29
- shouldDisplayRegister(registerName: string): boolean;
30
- currentFilterRegisters(): string[];
31
- }
32
- export const RegisterFilterServiceOptions = Symbol('RegisterFilterServiceOptions');
33
- export interface RegisterFilterServiceOptions {
34
- [key: string]: string[];
35
- }
36
-
37
- @injectable()
38
- export class RegisterFilterServiceImpl implements RegisterFilterService {
39
- @inject(RegisterFilterServiceOptions) protected readonly options: RegisterFilterServiceOptions;
40
-
41
- protected filters: Map<string, Set<string> | undefined> = new Map();
42
- protected currentFilter: string = AllOrCustom.All;
43
-
44
- get filterLabels(): string[] {
45
- return [...this.filters.keys()];
46
- }
47
-
48
- get currentFilterLabel(): string {
49
- return this.currentFilter;
50
- }
51
-
52
- @postConstruct()
53
- protected init(): void {
54
- this.filters.set(AllOrCustom.All, undefined);
55
- this.filters.set(AllOrCustom.Custom, new Set());
56
- for (const [key, values] of Object.entries(this.options)) {
57
- this.filters.set(key, new Set(values));
58
- }
59
- }
60
-
61
- setFilter(filterLabel: string): void {
62
- if (this.filters.has(filterLabel)) {
63
- this.currentFilter = filterLabel;
64
- }
65
- }
66
-
67
- shouldDisplayRegister(registerName: string): boolean {
68
- const currentFilter = this.filters.get(this.currentFilter);
69
- return !currentFilter || currentFilter.has(registerName);
70
- }
71
-
72
- currentFilterRegisters(): string[] {
73
- const currentFilterRegisters = this.filters.get(this.currentFilter);
74
- return currentFilterRegisters ? Array.from(currentFilterRegisters) : [];
75
- }
76
- }
1
+ /********************************************************************************
2
+ * Copyright (C) 2021 Ericsson and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+
17
+ import { inject, injectable, postConstruct } from '@theia/core/shared/inversify';
18
+
19
+ export enum AllOrCustom {
20
+ All = 'All',
21
+ Custom = 'Custom'
22
+ }
23
+
24
+ export const RegisterFilterService = Symbol('RegisterFilterService');
25
+ export interface RegisterFilterService {
26
+ currentFilterLabel: string;
27
+ filterLabels: string[];
28
+ setFilter(filterLabel: string): void;
29
+ shouldDisplayRegister(registerName: string): boolean;
30
+ currentFilterRegisters(): string[];
31
+ }
32
+ export const RegisterFilterServiceOptions = Symbol('RegisterFilterServiceOptions');
33
+ export interface RegisterFilterServiceOptions {
34
+ [key: string]: string[];
35
+ }
36
+
37
+ @injectable()
38
+ export class RegisterFilterServiceImpl implements RegisterFilterService {
39
+ @inject(RegisterFilterServiceOptions) protected readonly options: RegisterFilterServiceOptions;
40
+
41
+ protected filters: Map<string, Set<string> | undefined> = new Map();
42
+ protected currentFilter: string = AllOrCustom.All;
43
+
44
+ get filterLabels(): string[] {
45
+ return [...this.filters.keys()];
46
+ }
47
+
48
+ get currentFilterLabel(): string {
49
+ return this.currentFilter;
50
+ }
51
+
52
+ @postConstruct()
53
+ protected init(): void {
54
+ this.filters.set(AllOrCustom.All, undefined);
55
+ this.filters.set(AllOrCustom.Custom, new Set());
56
+ for (const [key, values] of Object.entries(this.options)) {
57
+ this.filters.set(key, new Set(values));
58
+ }
59
+ }
60
+
61
+ setFilter(filterLabel: string): void {
62
+ if (this.filters.has(filterLabel)) {
63
+ this.currentFilter = filterLabel;
64
+ }
65
+ }
66
+
67
+ shouldDisplayRegister(registerName: string): boolean {
68
+ const currentFilter = this.filters.get(this.currentFilter);
69
+ return !currentFilter || currentFilter.has(registerName);
70
+ }
71
+
72
+ currentFilterRegisters(): string[] {
73
+ const currentFilterRegisters = this.filters.get(this.currentFilter);
74
+ return currentFilterRegisters ? Array.from(currentFilterRegisters) : [];
75
+ }
76
+ }