Skip to content

Commit

Permalink
Re #212879. track child instantiation service for notebooks (#214281)
Browse files Browse the repository at this point in the history
  • Loading branch information
rebornix authored Jun 4, 2024
1 parent 90a47ca commit 0ec39fa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD

this._overlayContainer = document.createElement('div');
this.scopedContextKeyService = this._register(contextKeyService.createScoped(this._overlayContainer));
this.instantiationService = instantiationService.createChild(new ServiceCollection([IContextKeyService, this.scopedContextKeyService]));
this.instantiationService = this._register(instantiationService.createChild(new ServiceCollection([IContextKeyService, this.scopedContextKeyService])));

this._register(_notebookService.onDidChangeOutputRenderers(() => {
this._updateOutputRenderers();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ export class MarkupCell extends Disposable {
// create a special context key service that set the inCompositeEditor-contextkey
const editorContextKeyService = this.contextKeyService.createScoped(this.templateData.editorPart);
EditorContextKeys.inCompositeEditor.bindTo(editorContextKeyService).set(true);
const editorInstaService = this.instantiationService.createChild(new ServiceCollection([IContextKeyService, editorContextKeyService]));
const editorInstaService = this.editorDisposables.add(this.instantiationService.createChild(new ServiceCollection([IContextKeyService, editorContextKeyService])));
this.editorDisposables.add(editorContextKeyService);

this.editor = this.editorDisposables.add(editorInstaService.createInstance(CodeEditorWidget, this.templateData.editorContainer, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export class MarkupCellRenderer extends AbstractCellRenderer implements IListRen
const innerContent = DOM.append(container, $('.cell.markdown'));
const bottomCellContainer = DOM.append(container, $('.cell-bottom-toolbar-container'));

const scopedInstaService = this.instantiationService.createChild(new ServiceCollection([IContextKeyService, contextKeyService]));
const scopedInstaService = templateDisposables.add(this.instantiationService.createChild(new ServiceCollection([IContextKeyService, contextKeyService])));
const rootClassDelegate = {
toggle: (className: string, force?: boolean) => container.classList.toggle(className, force)
};
Expand Down Expand Up @@ -279,7 +279,7 @@ export class CodeCellRenderer extends AbstractCellRenderer implements IListRende

// create a special context key service that set the inCompositeEditor-contextkey
const editorContextKeyService = templateDisposables.add(this.contextKeyServiceProvider(editorPart));
const editorInstaService = this.instantiationService.createChild(new ServiceCollection([IContextKeyService, editorContextKeyService]));
const editorInstaService = templateDisposables.add(this.instantiationService.createChild(new ServiceCollection([IContextKeyService, editorContextKeyService])));
EditorContextKeys.inCompositeEditor.bindTo(editorContextKeyService).set(true);

const editor = editorInstaService.createInstance(CodeEditorWidget, editorContainer, {
Expand All @@ -303,7 +303,7 @@ export class CodeCellRenderer extends AbstractCellRenderer implements IListRende
const bottomCellToolbarContainer = DOM.append(container, $('.cell-bottom-toolbar-container'));
const focusIndicatorBottom = new FastDomNode(DOM.append(container, $('.cell-focus-indicator.cell-focus-indicator-bottom')));

const scopedInstaService = this.instantiationService.createChild(new ServiceCollection([IContextKeyService, contextKeyService]));
const scopedInstaService = templateDisposables.add(this.instantiationService.createChild(new ServiceCollection([IContextKeyService, contextKeyService])));
const rootClassDelegate = {
toggle: (className: string, force?: boolean) => container.classList.toggle(className, force)
};
Expand Down

0 comments on commit 0ec39fa

Please sign in to comment.