Skip to content

Commit 30f2ef6

Browse files
fixed comments
1 parent 09c68fe commit 30f2ef6

16 files changed

Lines changed: 45 additions & 86 deletions

src/debug-session/gdbtarget-debug-session.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export class GDBTargetDebugSession {
106106
return this.session.configuration.request === 'launch' && this.capabilities?.supportsTerminateRequest === true;
107107
}
108108

109-
/** Function returns string only in case of failure */
109+
// Function returns string only in case of failure
110110
public async evaluateGlobalExpression(expression: string, context = 'hover'): Promise<DebugProtocol.EvaluateResponse['body'] | string> {
111111
try {
112112
const frameId = (vscode.debug.activeStackItem as vscode.DebugStackFrame)?.frameId ?? 0;

src/views/component-viewer/component-viewer-target-access.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ export class ComponentViewerTargetAccess {
8787
} catch (error: unknown) {
8888
const errorMessage = (error as Error)?.message;
8989
logger.debug(`Session '${this._activeSession?.session.name}': Failed to evaluate name '${address}' - '${errorMessage}'`);
90-
//return errorMessage === 'custom request failed' ? 'No active session' : errorMessage;
9190
return undefined;
9291
}
9392
}

src/views/component-viewer/data-host/access-host.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import type { EvalValue, RefContainer } from '../parser-evaluator/ref-container';
1919

20-
/** Concrete data I/O (memory/register access). */
20+
// Concrete data I/O (memory/register access).
2121
export interface DataAccessHost {
2222
// Value access acts on container.{anchor,offsetBytes,widthBytes}
2323
readValue(container: RefContainer): Promise<EvalValue>; // may return undefined -> error

src/views/component-viewer/data-host/memory-host.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ type ElementMeta = {
118118
elementSize?: number; // known uniform stride when consistent
119119
};
120120

121-
/** The piece your host delegates to for readValue/writeValue. */
121+
// The piece your host delegates to for readValue/writeValue.
122122
export class MemoryHost {
123123
private cache = new ValidatingCache<MemoryContainer>();
124124
private endianness: Endianness;
@@ -152,7 +152,7 @@ export class MemoryHost {
152152
return this.cache.ensure(varName, () => new MemoryContainer(varName), false);
153153
}
154154

155-
/** Read a value, using byte-only offsets and widths. */
155+
// Read a value, using byte-only offsets and widths.
156156
public async readValue(ref: RefContainer): Promise<EvalValue> {
157157
const variableName = ref.anchor?.name;
158158
const widthBytes = ref.widthBytes ?? 0;
@@ -200,7 +200,7 @@ export class MemoryHost {
200200
return raw.slice();
201201
}
202202

203-
/** Read raw bytes without interpretation. */
203+
// Read raw bytes without interpretation.
204204
public async readRaw(ref: RefContainer, size: number): Promise<Uint8Array | undefined> {
205205
const variableName = ref.anchor?.name;
206206
if (!variableName || size <= 0) {
@@ -211,7 +211,7 @@ export class MemoryHost {
211211
return container.read(byteOff, size).slice();
212212
}
213213

214-
/** Write a value, using byte-only offsets and widths. */
214+
// Write a value, using byte-only offsets and widths.
215215
public async writeValue(ref: RefContainer, value: EvalValue, virtualSize?: number): Promise<void> {
216216
const variableName = ref.anchor?.name;
217217
const widthBytes = ref.widthBytes ?? 0;
@@ -425,20 +425,20 @@ export class MemoryHost {
425425
this.cache.clear();
426426
}
427427

428-
/** Number of array elements recorded for `name`. Defaults to 1 when unknown. */
428+
// Number of array elements recorded for `name`. Defaults to 1 when unknown.
429429
public getArrayElementCount(name: string): number {
430430
const m = this.elementMeta.get(name);
431431
const n = m?.offsets.length ?? 0;
432432
return n > 0 ? n : 1;
433433
}
434434

435-
/** All recorded target base addresses (per append) for `name`. */
435+
// All recorded target base addresses (per append) for `name`.
436436
public getArrayTargetBases(name: string): (number | undefined)[] {
437437
const m = this.elementMeta.get(name);
438438
return m ? m.bases.slice() : [];
439439
}
440440

441-
/** Target base address for element `index` of `name` (number | undefined). */
441+
// Target base address for element `index` of `name` (number | undefined).
442442
public getElementTargetBase(name: string, index: number): number | undefined {
443443
const m = this.elementMeta.get(name);
444444
if (!m) {
@@ -452,7 +452,7 @@ export class MemoryHost {
452452
return m.bases.at(index);
453453
}
454454

455-
/** Optional: repair or set an address later. */
455+
// Optional: repair or set an address later.
456456
public setElementTargetBase(name: string, index: number, base: number): void {
457457
const m = this.elementMeta.get(name);
458458
if (!m) {

src/views/component-viewer/model/scvd-item.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,6 @@ export class ScvdItem extends ScvdNode {
179179
return await this.property.getGuiValue();
180180
}
181181

182-
// public getGuiChildren(): ScvdGuiInterface[] {
183-
// const guiItems = [this.item, this.listOut, this.print]
184-
// .flat() // merge
185-
// .filter(x => x.getGuiConditionResult()) // filter
186-
// .sort(this.sortByLine); // sort in-place, returned
187-
// return guiItems && guiItems.length > 0 ? guiItems : undefined;
188-
// }
189-
190182
public hasGuiChildren(): boolean {
191183
return this.item.length > 0 || this.listOut.length > 0 || this.print.length > 0;
192184
}

src/views/component-viewer/model/scvd-list-out.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -82,20 +82,7 @@ export class ScvdListOut extends ScvdList {
8282
return newItem;
8383
}
8484

85-
// public getGuiChildren(): ScvdNode[] | undefined {
86-
// const guiItems = [this.item, this.listOut]
87-
// .flat() // merge
88-
// .filter(x => x.getGuiConditionResult()) // filter
89-
// .sort(this.sortByLine); // sort in-place, returned
90-
// return guiItems && guiItems.length > 0 ? guiItems : undefined;
91-
// }
92-
93-
// public hasGuiChildren(): boolean {
94-
// return this.item.length > 0 || this.listOut.length > 0;
95-
// }
96-
9785
public override async getGuiName(): Promise<string | undefined> {
9886
return undefined;
9987
}
100-
10188
}

src/views/component-viewer/model/scvd-out.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,4 @@ export class ScvdOut extends ScvdNode {
121121
public override getValueType(): string | undefined {
122122
return this.type?.getValueType();
123123
}
124-
125-
// public getGuiChildren(): ScvdGuiInterface[] | undefined {
126-
// const guiItems = this.item
127-
// .filter(x => x.getGuiConditionResult()) // filter
128-
// .sort(this.sortByLine); // sort in-place, returned
129-
// return guiItems && guiItems.length > 0 ? guiItems : undefined;
130-
// }
131-
132-
// public hasGuiChildren(): boolean {
133-
// return this.item.length > 0 || this.list.length > 0;
134-
// }
135-
136124
}

src/views/component-viewer/parser-evaluator/evaluator.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ type Host = ModelHost & DataAccessHost & IntrinsicProvider;
7070

7171
export interface EvalContextInit {
7272
data: Host;
73-
/** Starting container for symbol resolution (root model). */
73+
// Starting container for symbol resolution (root model).
7474
container: ScvdNode;
7575
}
7676

7777
export class EvalContext {
7878
readonly data: Host;
79-
/** Composite container context (root + last member/index/current). */
79+
// Composite container context (root + last member/index/current).
8080
container: RefContainer;
8181

8282
constructor(init: EvalContextInit) {
@@ -453,7 +453,7 @@ type LValue = {
453453
type: ScalarType | undefined;
454454
};
455455

456-
/** Accumulate a byte offset into the container (anchor-relative). */
456+
// Accumulate a byte offset into the container (anchor-relative).
457457
function addByteOffset(ctx: EvalContext, bytes: number) {
458458
const c = ctx.container;
459459
const add = (bytes | 0);

src/views/component-viewer/parser-evaluator/intrinsics.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,28 @@ import type { EvalValue, RefContainer } from './model-host';
1919
import type { ScvdNode } from '../model/scvd-node';
2020

2121
export interface IntrinsicDefinition {
22-
/** Arguments should be identifier names (not evaluated values). */
22+
// Arguments should be identifier names (not evaluated values).
2323
expectsNameArg?: boolean;
24-
/** Allow CallExpression(Identifier(...)) as a fallback to EvalPointCall. */
24+
// Allow CallExpression(Identifier(...)) as a fallback to EvalPointCall.
2525
allowCallExpression?: boolean;
26-
/** Minimum positional arguments expected. */
26+
// Minimum positional arguments expected.
2727
minArgs?: number;
28-
/** Maximum positional arguments expected. */
28+
// Maximum positional arguments expected.
2929
maxArgs?: number;
3030
}
3131

3232
// formatPrintf is a host hook, not an intrinsic. Exclude it from intrinsic names.
3333
export type IntrinsicName = Exclude<keyof IntrinsicProvider, 'formatPrintf'>;
3434

35-
/** Intrinsic hooks exposed by the host (built-ins plus pseudo-members). */
35+
// Intrinsic hooks exposed by the host (built-ins plus pseudo-members).
3636
export interface IntrinsicProvider {
3737
// Named intrinsics
3838
// Note: __GetRegVal(reg) is special-cased (no container); others use the explicit hooks below
3939
__GetRegVal(reg: string): Promise<number | bigint | undefined>;
4040
__FindSymbol(symbol: string): Promise<number | undefined>;
4141
__CalcMemUsed(stackAddress: number, stackSize: number, fillPattern: number, magicValue: number): Promise<number | undefined>;
4242

43-
/** sizeof-like intrinsic – semantics are host-defined (usually bytes). */
43+
// sizeof-like intrinsic – semantics are host-defined (usually bytes).
4444
__size_of(symbol: string): Promise<number | undefined>;
4545

4646
__Symbol_exists(symbol: string): Promise<number | undefined>;
@@ -55,7 +55,7 @@ export interface IntrinsicProvider {
5555
_addr(container: RefContainer): Promise<number | undefined>; // added as var because arrays can have different base addresses
5656
}
5757

58-
/** Intrinsics that expect identifier *names* instead of evaluated values. */
58+
// Intrinsics that expect identifier *names* instead of evaluated values.
5959
/**
6060
* Metadata describing special intrinsic handling. Used both by evaluator logic
6161
* and as the single source of truth for intrinsic names in type definitions.

src/views/component-viewer/parser-evaluator/model-host.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import type { ScvdNode } from '../model/scvd-node';
2121

2222
export type { EvalValue, ScalarKind, ScalarType, RefContainer, DataAccessHost };
2323

24-
/** Symbol/model resolution and metadata helpers (no direct memory I/O). */
24+
// Symbol/model resolution and metadata helpers (no direct memory I/O).
2525
export interface ModelHost {
2626
// Resolution APIs — must set container.current to the resolved ref on success
2727
getSymbolRef(container: RefContainer, name: string, forWrite?: boolean): Promise<ScvdNode | undefined>;
@@ -30,16 +30,16 @@ export interface ModelHost {
3030
// Advanced lookups / intrinsics use the whole container context
3131
resolveColonPath(container: RefContainer, parts: string[]): Promise<EvalValue>; // undefined => not found
3232
// Metadata (lets evaluator accumulate offsets itself)
33-
/** Bytes per element (including any padding/alignment inside the array layout). */
33+
// Bytes per element (including any padding/alignment inside the array layout).
3434
getElementStride(ref: ScvdNode): Promise<number>; // bytes per element
3535

36-
/** Member offset in bytes from base. */
36+
// Member offset in bytes from base.
3737
getMemberOffset(base: ScvdNode, member: ScvdNode): Promise<number | undefined>; // bytes
3838

39-
/** Explicit byte width helper for a ref. */
39+
// Explicit byte width helper for a ref.
4040
getByteWidth(ref: ScvdNode): Promise<number | undefined>;
4141

42-
/** Provide an element model (prototype/type) for array-ish refs. */
42+
// Provide an element model (prototype/type) for array-ish refs.
4343
getElementRef(ref: ScvdNode): Promise<ScvdNode | undefined>;
4444

4545
/**

0 commit comments

Comments
 (0)