Skip to content

Commit

Permalink
Value explorer improvements (#2690)
Browse files Browse the repository at this point in the history
* change header text

* fix input

* use routing slip and intercept completions of sendvalue
  • Loading branch information
colombod authored Feb 7, 2023
1 parent ab3ad73 commit a7154c9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
11 changes: 10 additions & 1 deletion src/dotnet-interactive-vscode-common/src/variableExplorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,21 @@ class WatchWindowTableViewProvider implements vscode.WebviewViewProvider {
case contracts.CommandSucceededType:
case contracts.CommandFailedType:
case contracts.CommandCancelledType:
if (envelope.command?.commandType === contracts.SubmitCodeType) {
if (envelope.command?.commandType === contracts.SubmitCodeType
|| envelope.command?.commandType === contracts.SendValueType) {

const completedKernels = this.completedNotebookKernels.get(uri) ?? new Set<string>();
const kernelName = envelope.command?.command?.targetKernelName;
if (kernelName) {
completedKernels.add(kernelName);
}
if ((envelope.routingSlip?.length ?? 0) > 0) {
const kernelUri = envelope.routingSlip![0];
let kernel = client.kernel.findKernelByUri(kernelUri);
if (kernel) {
completedKernels.add(kernel.name);
}
}

this.completedNotebookKernels.set(uri, completedKernels);
debounce(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,17 @@ export class VariableGrid extends React.Component<VariableGridProps, VariableGri
}
}

handleFilterChange(e: React.ChangeEvent<HTMLInputElement>): void {
handleInput(e: React.FormEvent<HTMLInputElement>): void {
const inputField = e.target as HTMLInputElement;
this.updateFilter(inputField.value);
}
updateFilter(filter: string) {
this.setState({
...this.state,
filter: e.target.value
filter: filter
});
}


clearFilter(): void {
this.setState({
...this.state,
Expand All @@ -146,7 +149,9 @@ export class VariableGrid extends React.Component<VariableGridProps, VariableGri
}

cancelOnEscKey(e: React.KeyboardEvent<HTMLInputElement>): void {
this.clearFilter();
if (e.code === "Escape") {
this.clearFilter();
}
}

render(): React.ReactNode {
Expand Down Expand Up @@ -194,7 +199,7 @@ export class VariableGrid extends React.Component<VariableGridProps, VariableGri
aria-label="filter the grid results"
placeholder="filter"
onKeyDown={(e) => this.cancelOnEscKey(e)}
onChange={(e) => this.handleFilterChange(e)}
onInput={(e) => this.handleInput(e)}
/>
</div>
<table>
Expand Down Expand Up @@ -231,7 +236,7 @@ export class VariableGrid extends React.Component<VariableGridProps, VariableGri
id={`0-2`}
className="header"
>
TypeName
Type
<div
className='grip'
draggable={true}
Expand Down Expand Up @@ -337,4 +342,6 @@ export class VariableGrid extends React.Component<VariableGridProps, VariableGri
</div>
);
}


}

0 comments on commit a7154c9

Please sign in to comment.