Skip to content

Commit

Permalink
Revert "Debug variable nodes kept expanded while stepping (#10338)"
Browse files Browse the repository at this point in the history
This reverts commit db48de3.
  • Loading branch information
vince-fugnitto authored and marcdumais-work committed Mar 15, 2023
1 parent db48de3 commit f8654ec
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 137 deletions.
7 changes: 2 additions & 5 deletions packages/core/src/browser/source-tree/source-tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ import { MaybePromise } from '../../common/types';
import { TreeImpl, CompositeTreeNode, TreeNode, SelectableTreeNode, ExpandableTreeNode } from '../tree';
import { TreeElement, CompositeTreeElement, TreeSource } from './tree-source';

export const SOURCE_NODE_ID_PREFIX = '__source__';
export const SOURCE_NODE_ID_SEPARATOR = ':';

@injectable()
export class SourceTree extends TreeImpl {

Expand All @@ -47,7 +44,7 @@ export class SourceTree extends TreeImpl {
}

protected toNode(element: TreeElement, index: number, parent: TreeElementNodeParent): TreeElementNode {
const id = element.id ? String(element.id) : (parent.id + SOURCE_NODE_ID_SEPARATOR + index);
const id = element.id ? String(element.id) : (parent.id + ':' + index);
const name = id;
const existing = this.getNode(id);
const updated = existing && <TreeElementNode>Object.assign(existing, { element, parent });
Expand Down Expand Up @@ -135,7 +132,7 @@ export namespace TreeSourceNode {
if (!source) {
return source;
}
const id = source.id || SOURCE_NODE_ID_PREFIX;
const id = source.id || '__source__';
return {
id,
name: id,
Expand Down
92 changes: 0 additions & 92 deletions packages/debug/src/browser/debug-variables-source-tree.ts

This file was deleted.

31 changes: 0 additions & 31 deletions packages/debug/src/browser/debug-variables-tree-model.ts

This file was deleted.

3 changes: 2 additions & 1 deletion packages/debug/src/browser/view/debug-variables-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { injectable, inject, postConstruct } from '@theia/core/shared/inversify'
import { TreeSource } from '@theia/core/lib/browser/source-tree';
import { DebugScope } from '../console/debug-console-items';
import { DebugViewModel } from './debug-view-model';
import debounce = require('p-debounce');

@injectable()
export class DebugVariablesSource extends TreeSource {
Expand All @@ -31,7 +32,7 @@ export class DebugVariablesSource extends TreeSource {
this.toDispose.push(this.model.onDidChange(() => this.refresh()));
}

protected readonly refresh = () => this.fireDidChange();
protected readonly refresh = debounce(() => this.fireDidChange(), 400);

async getElements(): Promise<IterableIterator<DebugScope>> {
const { currentSession } = this.model;
Expand Down
8 changes: 0 additions & 8 deletions packages/debug/src/browser/view/debug-variables-widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ import { SourceTreeWidget } from '@theia/core/lib/browser/source-tree';
import { DebugVariablesSource } from './debug-variables-source';
import { DebugViewModel } from './debug-view-model';
import { nls } from '@theia/core/lib/common/nls';
import { DebugVariablesSourceTree } from '../debug-variables-source-tree';
import { Tree, TreeModel } from '@theia/core/lib/browser';
import { DebugVariablesTreeModel } from '../debug-variables-tree-model';

@injectable()
export class DebugVariablesWidget extends SourceTreeWidget {
Expand All @@ -40,11 +37,6 @@ export class DebugVariablesWidget extends SourceTreeWidget {
child.bind(DebugVariablesSource).toSelf();
child.unbind(SourceTreeWidget);
child.bind(DebugVariablesWidget).toSelf();
child.bind(DebugVariablesSourceTree).toSelf();
child.rebind(Tree).toService(DebugVariablesSourceTree);
child.bind(DebugVariablesTreeModel).toSelf();
child.rebind(TreeModel).toService(DebugVariablesTreeModel);

return child;
}
static createWidget(parent: interfaces.Container): DebugVariablesWidget {
Expand Down

0 comments on commit f8654ec

Please sign in to comment.