mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 13:46:13 +00:00
debug hover: use WorkbenchAsyncDataTree
This commit is contained in:
parent
d012106744
commit
d3e7f797ad
|
@ -34,7 +34,6 @@ import { IDebugEditorContribution, IDebugService, State, IBreakpoint, EDITOR_CON
|
|||
import { BreakpointWidget } from 'vs/workbench/parts/debug/electron-browser/breakpointWidget';
|
||||
import { ExceptionWidget } from 'vs/workbench/parts/debug/browser/exceptionWidget';
|
||||
import { FloatingClickWidget } from 'vs/workbench/browser/parts/editor/editorWidgets';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { Position } from 'vs/editor/common/core/position';
|
||||
import { CoreEditingCommands } from 'vs/editor/browser/controller/coreCommands';
|
||||
import { first } from 'vs/base/common/arrays';
|
||||
|
@ -80,12 +79,11 @@ export class DebugEditorContribution implements IDebugEditorContribution {
|
|||
@ICodeEditorService private codeEditorService: ICodeEditorService,
|
||||
@ITelemetryService private telemetryService: ITelemetryService,
|
||||
@IConfigurationService private configurationService: IConfigurationService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IKeybindingService private keybindingService: IKeybindingService,
|
||||
@IDialogService private dialogService: IDialogService,
|
||||
) {
|
||||
this.breakpointHintDecoration = [];
|
||||
this.hoverWidget = new DebugHoverWidget(this.editor, this.debugService, this.instantiationService, themeService);
|
||||
this.hoverWidget = this.instantiationService.createInstance(DebugHoverWidget, this.editor);
|
||||
this.toDispose = [];
|
||||
this.registerListeners();
|
||||
this.breakpointWidgetVisible = CONTEXT_BREAKPOINT_WIDGET_VISIBLE.bindTo(contextKeyService);
|
||||
|
|
|
@ -27,6 +27,9 @@ import { getExactExpressionStartAndEnd } from 'vs/workbench/parts/debug/common/d
|
|||
import { AsyncDataTree, IDataSource } from 'vs/base/browser/ui/tree/asyncDataTree';
|
||||
import { IAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget';
|
||||
import { IListVirtualDelegate } from 'vs/base/browser/ui/list/list';
|
||||
import { WorkbenchAsyncDataTree, IListService } from 'vs/platform/list/browser/listService';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
|
||||
const $ = dom.$;
|
||||
const MAX_TREE_HEIGHT = 324;
|
||||
|
@ -52,9 +55,12 @@ export class DebugHoverWidget implements IContentWidget {
|
|||
|
||||
constructor(
|
||||
private editor: ICodeEditor,
|
||||
private debugService: IDebugService,
|
||||
private instantiationService: IInstantiationService,
|
||||
private themeService: IThemeService
|
||||
@IDebugService private debugService: IDebugService,
|
||||
@IInstantiationService private instantiationService: IInstantiationService,
|
||||
@IThemeService private themeService: IThemeService,
|
||||
@IContextKeyService private contextKeyService: IContextKeyService,
|
||||
@IListService private listService: IListService,
|
||||
@IConfigurationService private configurationService: IConfigurationService
|
||||
) {
|
||||
this.toDispose = [];
|
||||
|
||||
|
@ -71,11 +77,11 @@ export class DebugHoverWidget implements IContentWidget {
|
|||
treeContainer.setAttribute('role', 'tree');
|
||||
this.dataSource = new DebugHoverDataSource();
|
||||
|
||||
this.tree = new AsyncDataTree(treeContainer, new DebugHoverDelegate(), [this.instantiationService.createInstance(VariablesRenderer)],
|
||||
this.tree = new WorkbenchAsyncDataTree(treeContainer, new DebugHoverDelegate(), [this.instantiationService.createInstance(VariablesRenderer)],
|
||||
this.dataSource, {
|
||||
ariaLabel: nls.localize('treeAriaLabel', "Debug Hover"),
|
||||
accessibilityProvider: new DebugHoverAccessibilityProvider(),
|
||||
});
|
||||
}, this.contextKeyService, this.listService, this.themeService, this.configurationService);
|
||||
|
||||
this.valueContainer = $('.value');
|
||||
this.valueContainer.tabIndex = 0;
|
||||
|
|
Loading…
Reference in a new issue