Skip to content

Commit d708be4

Browse files
committed
Fixes microsoft#156645: Change the sticky scroll option to editor.experimental.stickyScroll
1 parent e8ee2cf commit d708be4

File tree

4 files changed

+195
-184
lines changed

4 files changed

+195
-184
lines changed

src/vs/editor/common/config/editorOptions.ts

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ export interface IEditorOptions {
170170
*/
171171
scrollbar?: IEditorScrollbarOptions;
172172
/**
173-
* Control the behavior of the sticky scroll
173+
* Control the behavior of experimental options
174174
*/
175-
stickyScroll?: IEditorStickyScrollOptions;
175+
experimental?: IEditorExperimentalOptions;
176176
/**
177177
* Control the behavior and rendering of the minimap.
178178
*/
@@ -2508,48 +2508,51 @@ class EditorLightbulb extends BaseEditorOption<EditorOption.lightbulb, IEditorLi
25082508

25092509
//#endregion
25102510

2511-
//#region sticky scroll
2511+
//#region experimental
25122512

2513-
/**
2514-
* Configuration options for editor sticky scroll
2515-
*/
2516-
2517-
export interface IEditorStickyScrollOptions {
2513+
export interface IEditorExperimentalOptions {
25182514
/**
2519-
* Enable the sticky scroll
2515+
* Configuration options for editor sticky scroll
25202516
*/
2521-
enabled?: boolean;
2517+
stickyScroll?: {
2518+
/**
2519+
* Enable the sticky scroll
2520+
*/
2521+
enabled?: boolean;
2522+
};
25222523
}
25232524

2524-
/**
2525-
* @internal
2526-
*/
2527-
2528-
export type EditorStickyScrollOptions = Readonly<Required<IEditorStickyScrollOptions>>;
2525+
export interface EditorExperimentalOptions {
2526+
stickyScroll: {
2527+
enabled: boolean;
2528+
};
2529+
}
25292530

2530-
class EditorStickyScroll extends BaseEditorOption<EditorOption.stickyScroll, IEditorStickyScrollOptions, EditorStickyScrollOptions> {
2531+
class EditorExperimental extends BaseEditorOption<EditorOption.experimental, IEditorExperimentalOptions, EditorExperimentalOptions> {
25312532

25322533
constructor() {
2533-
const defaults: EditorStickyScrollOptions = { enabled: false };
2534+
const defaults: EditorExperimentalOptions = { stickyScroll: { enabled: false } };
25342535
super(
2535-
EditorOption.stickyScroll, 'stickyScroll', defaults,
2536+
EditorOption.experimental, 'experimental', defaults,
25362537
{
2537-
'editor.stickyScroll.enabled': {
2538+
'editor.experimental.stickyScroll.enabled': {
25382539
type: 'boolean',
2539-
default: defaults.enabled,
2540-
description: nls.localize('editor.stickyScroll', "Shows the nested current scopes during the scroll at the top of the editor.")
2540+
default: defaults.stickyScroll.enabled,
2541+
description: nls.localize('editor.experimental.stickyScroll', "Shows the nested current scopes during the scroll at the top of the editor.")
25412542
},
25422543
}
25432544
);
25442545
}
25452546

2546-
public validate(_input: any): EditorStickyScrollOptions {
2547+
public validate(_input: any): EditorExperimentalOptions {
25472548
if (!_input || typeof _input !== 'object') {
25482549
return this.defaultValue;
25492550
}
2550-
const input = _input as IEditorStickyScrollOptions;
2551+
const input = _input as IEditorExperimentalOptions;
25512552
return {
2552-
enabled: boolean(input.enabled, this.defaultValue.enabled)
2553+
stickyScroll: {
2554+
enabled: boolean(input.stickyScroll?.enabled, this.defaultValue.stickyScroll.enabled)
2555+
}
25532556
};
25542557
}
25552558
}
@@ -4550,6 +4553,7 @@ export const enum EditorOption {
45504553
dragAndDrop,
45514554
dropIntoEditor,
45524555
emptySelectionClipboard,
4556+
experimental,
45534557
extraEditorClassName,
45544558
fastScrollSensitivity,
45554559
find,
@@ -4622,7 +4626,6 @@ export const enum EditorOption {
46224626
smartSelect,
46234627
smoothScrolling,
46244628
stickyTabStops,
4625-
stickyScroll,
46264629
stopRenderingLineAfter,
46274630
suggest,
46284631
suggestFontSize,
@@ -4859,6 +4862,7 @@ export const EditorOptions = {
48594862
)),
48604863
emptySelectionClipboard: register(new EditorEmptySelectionClipboard()),
48614864
dropIntoEditor: register(new EditorDropIntoEditor()),
4865+
experimental: register(new EditorExperimental()),
48624866
extraEditorClassName: register(new EditorStringOption(
48634867
EditorOption.extraEditorClassName, 'extraEditorClassName', '',
48644868
)),
@@ -5177,7 +5181,6 @@ export const EditorOptions = {
51775181
EditorOption.smoothScrolling, 'smoothScrolling', false,
51785182
{ description: nls.localize('smoothScrolling', "Controls whether the editor will scroll using an animation.") }
51795183
)),
5180-
stickyScroll: register(new EditorStickyScroll()),
51815184
stopRenderingLineAfter: register(new EditorIntOption(
51825185
EditorOption.stopRenderingLineAfter, 'stopRenderingLineAfter',
51835186
10000, -1, Constants.MAX_SAFE_SMALL_INTEGER,

src/vs/editor/common/standalone/standaloneEnums.ts

Lines changed: 73 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -206,79 +206,79 @@ export enum EditorOption {
206206
dragAndDrop = 31,
207207
dropIntoEditor = 32,
208208
emptySelectionClipboard = 33,
209-
extraEditorClassName = 34,
210-
fastScrollSensitivity = 35,
211-
find = 36,
212-
fixedOverflowWidgets = 37,
213-
folding = 38,
214-
foldingStrategy = 39,
215-
foldingHighlight = 40,
216-
foldingImportsByDefault = 41,
217-
foldingMaximumRegions = 42,
218-
unfoldOnClickAfterEndOfLine = 43,
219-
fontFamily = 44,
220-
fontInfo = 45,
221-
fontLigatures = 46,
222-
fontSize = 47,
223-
fontWeight = 48,
224-
formatOnPaste = 49,
225-
formatOnType = 50,
226-
glyphMargin = 51,
227-
gotoLocation = 52,
228-
hideCursorInOverviewRuler = 53,
229-
hover = 54,
230-
inDiffEditor = 55,
231-
inlineSuggest = 56,
232-
letterSpacing = 57,
233-
lightbulb = 58,
234-
lineDecorationsWidth = 59,
235-
lineHeight = 60,
236-
lineNumbers = 61,
237-
lineNumbersMinChars = 62,
238-
linkedEditing = 63,
239-
links = 64,
240-
matchBrackets = 65,
241-
minimap = 66,
242-
mouseStyle = 67,
243-
mouseWheelScrollSensitivity = 68,
244-
mouseWheelZoom = 69,
245-
multiCursorMergeOverlapping = 70,
246-
multiCursorModifier = 71,
247-
multiCursorPaste = 72,
248-
occurrencesHighlight = 73,
249-
overviewRulerBorder = 74,
250-
overviewRulerLanes = 75,
251-
padding = 76,
252-
parameterHints = 77,
253-
peekWidgetDefaultFocus = 78,
254-
definitionLinkOpensInPeek = 79,
255-
quickSuggestions = 80,
256-
quickSuggestionsDelay = 81,
257-
readOnly = 82,
258-
renameOnType = 83,
259-
renderControlCharacters = 84,
260-
renderFinalNewline = 85,
261-
renderLineHighlight = 86,
262-
renderLineHighlightOnlyWhenFocus = 87,
263-
renderValidationDecorations = 88,
264-
renderWhitespace = 89,
265-
revealHorizontalRightPadding = 90,
266-
roundedSelection = 91,
267-
rulers = 92,
268-
scrollbar = 93,
269-
scrollBeyondLastColumn = 94,
270-
scrollBeyondLastLine = 95,
271-
scrollPredominantAxis = 96,
272-
selectionClipboard = 97,
273-
selectionHighlight = 98,
274-
selectOnLineNumbers = 99,
275-
showFoldingControls = 100,
276-
showUnused = 101,
277-
snippetSuggestions = 102,
278-
smartSelect = 103,
279-
smoothScrolling = 104,
280-
stickyTabStops = 105,
281-
stickyScroll = 106,
209+
experimental = 34,
210+
extraEditorClassName = 35,
211+
fastScrollSensitivity = 36,
212+
find = 37,
213+
fixedOverflowWidgets = 38,
214+
folding = 39,
215+
foldingStrategy = 40,
216+
foldingHighlight = 41,
217+
foldingImportsByDefault = 42,
218+
foldingMaximumRegions = 43,
219+
unfoldOnClickAfterEndOfLine = 44,
220+
fontFamily = 45,
221+
fontInfo = 46,
222+
fontLigatures = 47,
223+
fontSize = 48,
224+
fontWeight = 49,
225+
formatOnPaste = 50,
226+
formatOnType = 51,
227+
glyphMargin = 52,
228+
gotoLocation = 53,
229+
hideCursorInOverviewRuler = 54,
230+
hover = 55,
231+
inDiffEditor = 56,
232+
inlineSuggest = 57,
233+
letterSpacing = 58,
234+
lightbulb = 59,
235+
lineDecorationsWidth = 60,
236+
lineHeight = 61,
237+
lineNumbers = 62,
238+
lineNumbersMinChars = 63,
239+
linkedEditing = 64,
240+
links = 65,
241+
matchBrackets = 66,
242+
minimap = 67,
243+
mouseStyle = 68,
244+
mouseWheelScrollSensitivity = 69,
245+
mouseWheelZoom = 70,
246+
multiCursorMergeOverlapping = 71,
247+
multiCursorModifier = 72,
248+
multiCursorPaste = 73,
249+
occurrencesHighlight = 74,
250+
overviewRulerBorder = 75,
251+
overviewRulerLanes = 76,
252+
padding = 77,
253+
parameterHints = 78,
254+
peekWidgetDefaultFocus = 79,
255+
definitionLinkOpensInPeek = 80,
256+
quickSuggestions = 81,
257+
quickSuggestionsDelay = 82,
258+
readOnly = 83,
259+
renameOnType = 84,
260+
renderControlCharacters = 85,
261+
renderFinalNewline = 86,
262+
renderLineHighlight = 87,
263+
renderLineHighlightOnlyWhenFocus = 88,
264+
renderValidationDecorations = 89,
265+
renderWhitespace = 90,
266+
revealHorizontalRightPadding = 91,
267+
roundedSelection = 92,
268+
rulers = 93,
269+
scrollbar = 94,
270+
scrollBeyondLastColumn = 95,
271+
scrollBeyondLastLine = 96,
272+
scrollPredominantAxis = 97,
273+
selectionClipboard = 98,
274+
selectionHighlight = 99,
275+
selectOnLineNumbers = 100,
276+
showFoldingControls = 101,
277+
showUnused = 102,
278+
snippetSuggestions = 103,
279+
smartSelect = 104,
280+
smoothScrolling = 105,
281+
stickyTabStops = 106,
282282
stopRenderingLineAfter = 107,
283283
suggest = 108,
284284
suggestFontSize = 109,

src/vs/editor/contrib/stickyScroll/browser/stickyScroll.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class StickyScrollController extends Disposable implements IEditorContribution {
4343
this._languageFeaturesService = _languageFeaturesService;
4444
this.stickyScrollWidget = new StickyScrollWidget(this._editor);
4545
this._register(this._editor.onDidChangeConfiguration(e => {
46-
if (e.hasChanged(EditorOption.stickyScroll)) {
46+
if (e.hasChanged(EditorOption.experimental)) {
4747
this.onConfigurationChange();
4848
}
4949
}));
@@ -52,8 +52,8 @@ class StickyScrollController extends Disposable implements IEditorContribution {
5252
}
5353

5454
private onConfigurationChange() {
55-
const options = this._editor.getOption(EditorOption.stickyScroll);
56-
if (options.enabled === false) {
55+
const options = this._editor.getOption(EditorOption.experimental);
56+
if (options.stickyScroll.enabled === false) {
5757
this.stickyScrollWidget.emptyRootNode();
5858
this._editor.removeOverlayWidget(this.stickyScrollWidget);
5959
this._sessionStore.clear();

0 commit comments

Comments
 (0)