MCPcopy Create free account
hub / github.com/Marus/cortex-debug / getTreeItem

Method getTreeItem

src/frontend/views/nodes/fieldnode.ts:18–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16 }
17
18 public getTreeItem(): TreeItem | Promise<TreeItem> {
19 const value = this.register.extractBits(this.offset, this.size);
20 this.value = value.toString();
21
22 const label: TreeItemLabel = {
23 label: this.name + ' ' + this.value
24 };
25 if (this.prevValue && (this.prevValue !== this.value)) {
26 label.highlights = [[this.name.length + 1, label.label.length]];
27 }
28 this.prevValue = this.value;
29
30 const ti = new TreeItem(label, TreeItemCollapsibleState.None);
31 // ti.description = this.value;
32 ti.contextValue = 'field';
33 ti.tooltip = '$' + this.register.name + '.' + this.name + '\n' + toStringDecHexOctBin(value);
34
35 return ti;
36 }
37
38 public getCopyValue(): string | undefined {
39 const value = this.register.extractBits(this.offset, this.size);

Callers

nothing calls this directly

Calls 3

toStringDecHexOctBinFunction · 0.90
extractBitsMethod · 0.80
toStringMethod · 0.80

Tested by

no test coverage detected