From 43c72aa8aa2a6db12132a72616a202a17c36e560 Mon Sep 17 00:00:00 2001 From: rebornix Date: Wed, 29 Mar 2023 10:07:03 -0700 Subject: [PATCH] promote nb diff overview ruler setting --- .../contrib/notebook/browser/diff/notebookDiffEditor.ts | 4 ++-- .../contrib/notebook/browser/notebook.contribution.ts | 6 ++++++ src/vs/workbench/contrib/notebook/common/notebookCommon.ts | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.ts b/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.ts index 06d6049a2d1bb..4b5054fcfbbb2 100644 --- a/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.ts +++ b/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.ts @@ -29,7 +29,7 @@ import { DiffSide, DIFF_CELL_MARGIN, IDiffCellInfo, INotebookTextDiffEditor } fr import { Emitter, Event } from 'vs/base/common/event'; import { DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; import { EditorPane } from 'vs/workbench/browser/parts/editor/editorPane'; -import { CellUri, INotebookDiffEditorModel, INotebookDiffResult, NOTEBOOK_DIFF_EDITOR_ID } from 'vs/workbench/contrib/notebook/common/notebookCommon'; +import { CellUri, INotebookDiffEditorModel, INotebookDiffResult, NOTEBOOK_DIFF_EDITOR_ID, NotebookSetting } from 'vs/workbench/contrib/notebook/common/notebookCommon'; import { URI } from 'vs/base/common/uri'; import { IDiffChange, IDiffResult } from 'vs/base/common/diff/diff'; import { NotebookTextModel } from 'vs/workbench/contrib/notebook/common/model/notebookTextModel'; @@ -159,7 +159,7 @@ export class NotebookTextDiffEditor extends EditorPane implements INotebookTextD } private isOverviewRulerEnabled(): boolean { - return this.configurationService.getValue('notebook.experimental.diffOverviewRuler.enabled') ?? false; + return this.configurationService.getValue(NotebookSetting.diffOverviewRuler) ?? false; } getSelection(): IEditorPaneSelection | undefined { diff --git a/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts b/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts index d9e883fce4001..02a40f9eefcb4 100644 --- a/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts +++ b/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts @@ -770,6 +770,12 @@ configurationRegistry.registerConfiguration({ default: true, tags: ['notebookLayout'] }, + [NotebookSetting.diffOverviewRuler]: { + description: nls.localize('notebook.diff.enableOverviewRuler.description', "Whether to render the overview ruler in the diff editor for notebook."), + type: 'boolean', + default: false, + tags: ['notebookLayout'] + }, [NotebookSetting.cellToolbarVisibility]: { markdownDescription: nls.localize('notebook.cellToolbarVisibility.description', "Whether the cell toolbar should appear on hover or click."), type: 'string', diff --git a/src/vs/workbench/contrib/notebook/common/notebookCommon.ts b/src/vs/workbench/contrib/notebook/common/notebookCommon.ts index 2da521025762e..2c7728eddb977 100644 --- a/src/vs/workbench/contrib/notebook/common/notebookCommon.ts +++ b/src/vs/workbench/contrib/notebook/common/notebookCommon.ts @@ -911,6 +911,7 @@ export const NotebookSetting = { cellToolbarVisibility: 'notebook.cellToolbarVisibility', showCellStatusBar: 'notebook.showCellStatusBar', textDiffEditorPreview: 'notebook.diff.enablePreview', + diffOverviewRuler: 'notebook.diff.overviewRuler', experimentalInsertToolbarAlignment: 'notebook.experimental.insertToolbarAlignment', compactView: 'notebook.compactView', focusIndicator: 'notebook.cellFocusIndicator',