From c38aa5a341eaab3d5ce1ca597eb2daa01a98a6e8 Mon Sep 17 00:00:00 2001 From: rebornix Date: Sun, 21 Feb 2021 23:13:03 -0800 Subject: [PATCH] file cleaning. --- src/vs/monaco.d.ts | 8 ++++---- src/vs/workbench/api/common/extHost.protocol.ts | 1 - src/vs/workbench/api/common/extHostNotebook.ts | 2 +- src/vs/workbench/api/common/extHostNotebookEditor.ts | 8 +++----- .../contrib/notebook/browser/notebookEditorWidget.ts | 1 - .../notebook/browser/viewModel/notebookViewModel.ts | 1 - .../workbench/contrib/notebook/common/notebookCommon.ts | 1 - 7 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index c8b2e0aec53..7b729f29901 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -4088,12 +4088,12 @@ declare namespace monaco.editor { accessibilitySupport: IEditorOption; accessibilityPageSize: IEditorOption; ariaLabel: IEditorOption; - autoClosingBrackets: IEditorOption; - autoClosingOvertype: IEditorOption; - autoClosingQuotes: IEditorOption; + autoClosingBrackets: IEditorOption; + autoClosingOvertype: IEditorOption; + autoClosingQuotes: IEditorOption; autoIndent: IEditorOption; automaticLayout: IEditorOption; - autoSurround: IEditorOption; + autoSurround: IEditorOption; stickyTabStops: IEditorOption; codeLens: IEditorOption; codeLensFontFamily: IEditorOption; diff --git a/src/vs/workbench/api/common/extHost.protocol.ts b/src/vs/workbench/api/common/extHost.protocol.ts index e64d07c3875..8cda182b9c5 100644 --- a/src/vs/workbench/api/common/extHost.protocol.ts +++ b/src/vs/workbench/api/common/extHost.protocol.ts @@ -1743,7 +1743,6 @@ export interface ExtHostCommentsShape { export interface INotebookSelectionChangeEvent { primary: number | null; - // handles selections: ICellRange[]; } diff --git a/src/vs/workbench/api/common/extHostNotebook.ts b/src/vs/workbench/api/common/extHostNotebook.ts index ec2cd81a167..6b330c73e57 100644 --- a/src/vs/workbench/api/common/extHostNotebook.ts +++ b/src/vs/workbench/api/common/extHostNotebook.ts @@ -593,7 +593,7 @@ export class ExtHostNotebookController implements ExtHostNotebookShape { this._onDidChangeNotebookEditorSelection.fire({ notebookEditor: editor.editor.editor, - selection: editor.editor.selection + selection: editor.editor.editor.selection }); } } diff --git a/src/vs/workbench/api/common/extHostNotebookEditor.ts b/src/vs/workbench/api/common/extHostNotebookEditor.ts index b7c17d0f495..18150a8902e 100644 --- a/src/vs/workbench/api/common/extHostNotebookEditor.ts +++ b/src/vs/workbench/api/common/extHostNotebookEditor.ts @@ -85,9 +85,7 @@ class NotebookEditorCellEditBuilder implements vscode.NotebookEditorEdit { } export class ExtHostNotebookEditor { - - //TODO@rebornix noop setter? - selection?: vscode.NotebookCell; + private _selection?: vscode.NotebookCell; private _selections: vscode.NotebookCellRange[] = []; private _visibleRanges: extHostTypes.NotebookCellRange[] = []; @@ -124,7 +122,7 @@ export class ExtHostNotebookEditor { return that.notebookData.notebookDocument; }, get selection() { - return that.selection; + return that._selection; }, get selections() { return that._selections; @@ -178,7 +176,7 @@ export class ExtHostNotebookEditor { } _acceptSelections(primary: number | null, selections: ICellRange[]): void { - this.selection = primary !== null ? this.notebookData.getCellFromIndex(primary)?.cell : undefined; + this._selection = primary !== null ? this.notebookData.getCellFromIndex(primary)?.cell : undefined; this._selections = selections.map(val => new extHostTypes.NotebookCellRange(val.start, val.end)); } diff --git a/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts b/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts index 1e6af916724..dc9075000af 100644 --- a/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts +++ b/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts @@ -1285,7 +1285,6 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor focusElement(cell: ICellViewModel) { this._list.focusElement(cell); - this._list.selectElement(cell); } revealCellRangeInView(range: ICellRange) { diff --git a/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModel.ts b/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModel.ts index 4872faa2bcd..276cf536af0 100644 --- a/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModel.ts +++ b/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModel.ts @@ -924,7 +924,6 @@ export class NotebookViewModel extends Disposable implements EditorFoldingStateD { quotableLabel: 'Join Notebook Cells' } ); - // TODO@rebornix this.selectionHandles = endSelections; return { cell: above, deletedCells: [cell] }; diff --git a/src/vs/workbench/contrib/notebook/common/notebookCommon.ts b/src/vs/workbench/contrib/notebook/common/notebookCommon.ts index 36709fb12ce..4b9ae845931 100644 --- a/src/vs/workbench/contrib/notebook/common/notebookCommon.ts +++ b/src/vs/workbench/contrib/notebook/common/notebookCommon.ts @@ -299,7 +299,6 @@ export type NotebookCellsChangedEventDto = { export type NotebookRawContentEvent = (NotebookCellsInitializeEvent | NotebookDocumentChangeMetadataEvent | NotebookCellContentChangeEvent | NotebookCellsModelChangedEvent | NotebookCellsModelMoveEvent | NotebookOutputChangedEvent | NotebookOutputItemChangedEvent | NotebookCellsChangeLanguageEvent | NotebookCellsChangeMetadataEvent | NotebookDocumentUnknownChangeEvent) & { transient: boolean; }; - export enum SelectionStateType { Handle = 0, Index = 1