From 3bd7c6981e703542ce92d0e1fb8d3fa522cd3fdf Mon Sep 17 00:00:00 2001 From: rebornix Date: Thu, 27 Aug 2020 11:38:13 -0700 Subject: [PATCH] enable enhanced text diff view for notebook by default. --- .../contrib/notebook/browser/notebook.contribution.ts | 9 +++++++-- .../workbench/contrib/notebook/common/notebookCommon.ts | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts b/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts index f4c192236af..09954d65527 100644 --- a/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts +++ b/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts @@ -30,7 +30,7 @@ import { NotebookEditor } from 'vs/workbench/contrib/notebook/browser/notebookEd import { NotebookEditorInput } from 'vs/workbench/contrib/notebook/browser/notebookEditorInput'; import { INotebookService } from 'vs/workbench/contrib/notebook/common/notebookService'; import { NotebookService } from 'vs/workbench/contrib/notebook/browser/notebookServiceImpl'; -import { CellKind, CellToolbarLocKey, CellUri, DisplayOrderKey, getCellUndoRedoComparisonKey, NotebookDocumentBackupData, NotebookEditorPriority, ShowCellStatusbarKey } from 'vs/workbench/contrib/notebook/common/notebookCommon'; +import { CellKind, CellToolbarLocKey, CellUri, DisplayOrderKey, getCellUndoRedoComparisonKey, NotebookDocumentBackupData, NotebookEditorPriority, NotebookTextDiffEditorPreview, ShowCellStatusbarKey } from 'vs/workbench/contrib/notebook/common/notebookCommon'; import { NotebookProviderInfo } from 'vs/workbench/contrib/notebook/common/notebookProvider'; import { IEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsService'; import { IEditorService, IOpenEditorOverride } from 'vs/workbench/services/editor/common/editorService'; @@ -249,7 +249,7 @@ export class NotebookContribution extends Disposable implements IWorkbenchContri return undefined; } - if (originalInput instanceof DiffEditorInput && this.configurationService.getValue('notebook.diff.enablePreview')) { + if (originalInput instanceof DiffEditorInput && this.configurationService.getValue(NotebookTextDiffEditorPreview)) { return this._handleDiffEditorInput(originalInput, options, group); } @@ -546,6 +546,11 @@ configurationRegistry.registerConfiguration({ description: nls.localize('notebook.showCellStatusbar.description', "Whether the cell statusbar should be shown."), type: 'boolean', default: true + }, + [NotebookTextDiffEditorPreview]: { + description: nls.localize('notebook.diff.enablePreview.description', "Whether to use the enhanced text diff editor for notebook."), + type: 'boolean', + default: true } } }); diff --git a/src/vs/workbench/contrib/notebook/common/notebookCommon.ts b/src/vs/workbench/contrib/notebook/common/notebookCommon.ts index 42875da23ae..8f3e2d757d9 100644 --- a/src/vs/workbench/contrib/notebook/common/notebookCommon.ts +++ b/src/vs/workbench/contrib/notebook/common/notebookCommon.ts @@ -789,6 +789,7 @@ export interface INotebookCellStatusBarEntry { export const DisplayOrderKey = 'notebook.displayOrder'; export const CellToolbarLocKey = 'notebook.cellToolbarLocation'; export const ShowCellStatusbarKey = 'notebook.showCellStatusbar'; +export const NotebookTextDiffEditorPreview = 'notebook.diff.enablePreview'; export const enum CellStatusbarAlignment { LEFT,