Remove hasEditor from ICellEditorProvider (#22145)

This commit is contained in:
Charles Gagnon
2023-03-06 11:02:41 -08:00
committed by GitHub
parent c882aeddb0
commit a657aa6cb5
5 changed files with 2 additions and 17 deletions

View File

@@ -147,10 +147,6 @@ export class CodeComponent extends CellView implements OnInit, OnChanges {
return this._editor; return this._editor;
} }
public override hasEditor(): boolean {
return true;
}
public cellGuid(): string { public cellGuid(): string {
return this.cellModel.cellGuid; return this.cellModel.cellGuid;
} }

View File

@@ -38,10 +38,6 @@ export abstract class CellView extends AngularDisposable implements OnDestroy, I
return undefined; return undefined;
} }
public hasEditor(): boolean {
return false;
}
public abstract cellGuid(): string; public abstract cellGuid(): string;
public deltaDecorations(newDecorationsRange: NotebookRange | NotebookRange[], oldDecorationsRange: NotebookRange | NotebookRange[]): void { public deltaDecorations(newDecorationsRange: NotebookRange | NotebookRange[], oldDecorationsRange: NotebookRange | NotebookRange[]): void {

View File

@@ -375,10 +375,7 @@ export class MarkdownToolbarComponent extends AngularDisposable {
if (!this._cellEditor?.getEditor()?.getControl()) { if (!this._cellEditor?.getEditor()?.getControl()) {
this._cellEditor = this._notebookEditor?.cellEditors?.find(e => e.cellGuid() === this.cellModel?.cellGuid); this._cellEditor = this._notebookEditor?.cellEditors?.find(e => e.cellGuid() === this.cellModel?.cellGuid);
} }
if (this._cellEditor?.hasEditor) { return this._cellEditor.getEditor()?.getControl();
return this._cellEditor.getEditor()?.getControl();
}
return undefined;
} }
public async getFileContentBase64(fileUri: URI): Promise<string> { public async getFileContentBase64(fileUri: URI): Promise<string> {

View File

@@ -719,9 +719,6 @@ export class NotebookEditorStub implements INotebookEditor {
export class CellEditorProviderStub implements ICellEditorProvider { export class CellEditorProviderStub implements ICellEditorProvider {
isCellOutput = false; isCellOutput = false;
hasEditor(): boolean {
throw new Error('Method not implemented.');
}
cellGuid(): string { cellGuid(): string {
throw new Error('Method not implemented.'); throw new Error('Method not implemented.');
} }

View File

@@ -194,10 +194,9 @@ export interface INotebookSection {
} }
export interface ICellEditorProvider { export interface ICellEditorProvider {
hasEditor(): boolean;
isCellOutput: boolean; isCellOutput: boolean;
cellGuid(): string; cellGuid(): string;
getEditor(): BaseTextEditor<ICodeEditorViewState>; getEditor(): BaseTextEditor<ICodeEditorViewState> | undefined;
deltaDecorations(newDecorationsRange: NotebookRange | NotebookRange[], oldDecorationsRange: NotebookRange | NotebookRange[]): void; deltaDecorations(newDecorationsRange: NotebookRange | NotebookRange[], oldDecorationsRange: NotebookRange | NotebookRange[]): void;
} }