Skip to content

Commit 23e7148

Browse files
authored
fix cyclic dependency (microsoft#251438)
1 parent 6faeecb commit 23e7148

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,18 @@ import { ITreeNode, ITreeRenderer } from '../../../../../../base/browser/ui/tree
1010
import { FuzzyScore } from '../../../../../../base/common/filters.js';
1111
import { DisposableStore } from '../../../../../../base/common/lifecycle.js';
1212
import { observableValue } from '../../../../../../base/common/observable.js';
13-
import { localize } from '../../../../../../nls.js';
13+
import { ILocalizedString, localize, localize2 } from '../../../../../../nls.js';
1414
import { IInstantiationService } from '../../../../../../platform/instantiation/common/instantiation.js';
1515
import { WorkbenchObjectTree } from '../../../../../../platform/list/browser/listService.js';
1616
import { DebugExpressionRenderer } from '../../../../debug/browser/debugExpressionRenderer.js';
1717
import { INotebookVariableElement } from './notebookVariablesDataSource.js';
18-
import { NotebookVariablesView } from './notebookVariablesView.js';
1918

2019
const $ = dom.$;
2120
const MAX_VALUE_RENDER_LENGTH_IN_VIEWLET = 1024;
2221

22+
export const NOTEBOOK_TITLE: ILocalizedString = localize2('notebook.notebookVariables', "Notebook Variables");
23+
export const REPL_TITLE: ILocalizedString = localize2('notebook.ReplVariables', "REPL Variables");
24+
2325
export class NotebookVariablesTree extends WorkbenchObjectTree<INotebookVariableElement> { }
2426

2527
export class NotebookVariablesDelegate implements IListVirtualDelegate<INotebookVariableElement> {
@@ -33,6 +35,7 @@ export class NotebookVariablesDelegate implements IListVirtualDelegate<INotebook
3335
}
3436
}
3537

38+
3639
export interface IVariableTemplateData {
3740
expression: HTMLElement;
3841
name: HTMLSpanElement;
@@ -88,7 +91,7 @@ export class NotebookVariableRenderer implements ITreeRenderer<INotebookVariable
8891

8992
export class NotebookVariableAccessibilityProvider implements IListAccessibilityProvider<INotebookVariableElement> {
9093

91-
private _widgetAriaLabel = observableValue('widgetAriaLabel', NotebookVariablesView.NOTEBOOK_TITLE.value);
94+
private _widgetAriaLabel = observableValue('widgetAriaLabel', NOTEBOOK_TITLE.value);
9295

9396
getWidgetAriaLabel() {
9497
return this._widgetAriaLabel;

src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
import { ITreeContextMenuEvent } from '../../../../../../base/browser/ui/tree/tree.js';
77
import { RunOnceScheduler } from '../../../../../../base/common/async.js';
88
import { URI } from '../../../../../../base/common/uri.js';
9-
import * as nls from '../../../../../../nls.js';
10-
import { ILocalizedString } from '../../../../../../platform/action/common/action.js';
119
import { getFlatContextMenuActions } from '../../../../../../platform/actions/browser/menuEntryActionViewItem.js';
1210
import { IMenuService, MenuId } from '../../../../../../platform/actions/common/actions.js';
1311
import { ICommandService } from '../../../../../../platform/commands/common/commands.js';
@@ -25,7 +23,7 @@ import { IViewPaneOptions, ViewPane } from '../../../../../browser/parts/views/v
2523
import { IViewDescriptorService } from '../../../../../common/views.js';
2624
import { CONTEXT_VARIABLE_EXTENSIONID, CONTEXT_VARIABLE_INTERFACES, CONTEXT_VARIABLE_LANGUAGE, CONTEXT_VARIABLE_NAME, CONTEXT_VARIABLE_TYPE, CONTEXT_VARIABLE_VALUE } from '../../../../debug/common/debug.js';
2725
import { IEmptyScope, INotebookScope, INotebookVariableElement, NotebookVariableDataSource } from './notebookVariablesDataSource.js';
28-
import { NotebookVariableAccessibilityProvider, NotebookVariableRenderer, NotebookVariablesDelegate } from './notebookVariablesTree.js';
26+
import { NOTEBOOK_TITLE, NotebookVariableAccessibilityProvider, NotebookVariableRenderer, NotebookVariablesDelegate, REPL_TITLE } from './notebookVariablesTree.js';
2927
import { getNotebookEditorFromEditorPane } from '../../notebookBrowser.js';
3028
import { NotebookTextModel } from '../../../common/model/notebookTextModel.js';
3129
import { ICellExecutionStateChangedEvent, IExecutionStateChangedEvent, INotebookExecutionStateService } from '../../../common/notebookExecutionStateService.js';
@@ -39,8 +37,6 @@ export type contextMenuArg = { source: string; name: string; type?: string; valu
3937
export class NotebookVariablesView extends ViewPane {
4038

4139
static readonly ID = 'notebookVariablesView';
42-
static readonly NOTEBOOK_TITLE: ILocalizedString = nls.localize2('notebook.notebookVariables', "Notebook Variables");
43-
static readonly REPL_TITLE: ILocalizedString = nls.localize2('notebook.ReplVariables', "REPL Variables");
4440

4541
private tree: WorkbenchAsyncDataTree<INotebookScope | IEmptyScope, INotebookVariableElement> | undefined;
4642
private activeNotebook: NotebookTextModel | undefined;
@@ -151,11 +147,11 @@ export class NotebookVariablesView extends ViewPane {
151147
this.activeNotebook = notebookDocument;
152148

153149
if (isCompositeNotebookEditorInput(editor.input)) {
154-
this.updateTitle(NotebookVariablesView.REPL_TITLE.value);
155-
this.accessibilityProvider.updateWidgetAriaLabel(NotebookVariablesView.REPL_TITLE.value);
150+
this.updateTitle(REPL_TITLE.value);
151+
this.accessibilityProvider.updateWidgetAriaLabel(REPL_TITLE.value);
156152
} else {
157-
this.updateTitle(NotebookVariablesView.NOTEBOOK_TITLE.value);
158-
this.accessibilityProvider.updateWidgetAriaLabel(NotebookVariablesView.NOTEBOOK_TITLE.value);
153+
this.updateTitle(NOTEBOOK_TITLE.value);
154+
this.accessibilityProvider.updateWidgetAriaLabel(NOTEBOOK_TITLE.value);
159155
}
160156

161157
if (doUpdate) {

0 commit comments

Comments
 (0)