Skip to content

Commit

Permalink
Changes requested by reviewers
Browse files Browse the repository at this point in the history
  • Loading branch information
gbodeen committed Mar 7, 2024
1 parent 039cc4a commit 6c16770
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
9 changes: 6 additions & 3 deletions src/webview/components/memory-table.tsx
Expand Up @@ -101,7 +101,7 @@ export const MoreMemorySelect: React.FC<MoreMemorySelectProps> = ({ count, offse
interface MemoryTableProps extends TableRenderOptions, MemoryDisplayConfiguration {
memory?: Memory;
decorations: Decoration[];
hovers: HoverService;
hoverService: HoverService;
offset: number;
count: number;
fetchMemory(partialOptions?: Partial<DebugProtocol.ReadMemoryArguments>): Promise<void>;
Expand Down Expand Up @@ -189,9 +189,12 @@ export class MemoryTable extends React.PureComponent<MemoryTableProps, MemoryTab
return (
<div className='flex-1 overflow-auto px-4'>
<Tooltip
// On mouseover of a .hoverable element, this.handleOnBeforeTooltipShow runs and generates this.state.hoverContent
target=".hoverable"
onBeforeShow={this.handleOnBeforeTooltipShow}
onHide={this.handleOnTooltipHide}
target=".hoverable"
showDelay={1000}
autoHide={false}
>{this.state.hoverContent}</Tooltip>
<DataTable<MemoryRowData[]>
ref={this.datatableRef}
Expand Down Expand Up @@ -338,7 +341,7 @@ export class MemoryTable extends React.PureComponent<MemoryTableProps, MemoryTab
try {
extraData = JSON.parse(event.target.dataset[columnId] ?? '{}');
} catch { /* no-op */ }
const node = await this.props.hovers.render({ columnId, textContent, extraData });
const node = await this.props.hoverService.render({ columnId, textContent, extraData });
this.setState(prev => ({
...prev,
hoverContent: node,
Expand Down
4 changes: 2 additions & 2 deletions src/webview/components/memory-widget.tsx
Expand Up @@ -26,7 +26,7 @@ interface MemoryWidgetProps extends MemoryDisplayConfiguration {
memory?: Memory;
title: string;
decorations: Decoration[];
hovers: HoverService;
hoverService: HoverService;
columns: ColumnStatus[];
memoryReference: string;
offset: number;
Expand Down Expand Up @@ -82,7 +82,7 @@ export class MemoryWidget extends React.Component<MemoryWidgetProps, MemoryWidge
/>
<MemoryTable
decorations={this.props.decorations}
hovers={this.props.hovers}
hoverService={this.props.hoverService}
columnOptions={this.props.columns.filter(candidate => candidate.active)}
memory={this.props.memory}
endianness={this.state.endianness}
Expand Down
6 changes: 3 additions & 3 deletions src/webview/memory-webview-view.tsx
Expand Up @@ -46,7 +46,7 @@ import { VariableHover } from './hovers/variable-hover';
export interface MemoryAppState extends MemoryState, MemoryDisplayConfiguration {
title: string;
decorations: Decoration[];
hovers: HoverService;
hoverService: HoverService;
columns: ColumnStatus[];
isFrozen: boolean;
}
Expand Down Expand Up @@ -79,7 +79,7 @@ class App extends React.Component<{}, MemoryAppState> {
offset: 0,
count: 256,
decorations: [],
hovers: hoverService,
hoverService: hoverService,
columns: columnContributionService.getColumns(),
isMemoryFetching: false,
isFrozen: false,
Expand Down Expand Up @@ -109,7 +109,7 @@ class App extends React.Component<{}, MemoryAppState> {
<MemoryWidget
memory={this.state.memory}
decorations={this.state.decorations}
hovers={this.state.hovers}
hoverService={this.state.hoverService}
columns={this.state.columns}
memoryReference={this.state.memoryReference}
offset={this.state.offset ?? 0}
Expand Down

0 comments on commit 6c16770

Please sign in to comment.