Skip to content

Commit a525593

Browse files
author
aiday-mar
committed
Removing stickyScrollController.ts duplicate file
1 parent b949c41 commit a525593

File tree

3 files changed

+33
-175
lines changed

3 files changed

+33
-175
lines changed

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

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@
55

66
import { Disposable, DisposableStore } from 'vs/base/common/lifecycle';
77
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
8-
import { registerEditorContribution } from 'vs/editor/browser/editorExtensions';
8+
import { registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions';
99
import { IEditorContribution } from 'vs/editor/common/editorCommon';
1010
import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';
1111
import { EditorOption, RenderLineNumbersType } from 'vs/editor/common/config/editorOptions';
1212
import { StickyScrollWidget, StickyScrollWidgetState } from './stickyScrollWidget';
1313
import { StickyLineCandidateProvider, StickyRange } from './stickyScrollProvider';
1414
import { IModelTokensChangedEvent } from 'vs/editor/common/textModelEvents';
15+
import { Action2, MenuId, registerAction2 } from 'vs/platform/actions/common/actions';
16+
import { localize } from 'vs/nls';
17+
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
18+
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
1519

1620
class StickyScrollController extends Disposable implements IEditorContribution {
1721

@@ -139,3 +143,30 @@ class StickyScrollController extends Disposable implements IEditorContribution {
139143

140144
registerEditorContribution(StickyScrollController.ID, StickyScrollController);
141145

146+
registerAction2(class ToggleStickyScroll extends Action2 {
147+
148+
constructor() {
149+
super({
150+
id: 'editor.action.toggleStickyScroll',
151+
title: {
152+
value: localize('toggleStickyScroll', "Toggle Sticky Scroll"),
153+
mnemonicTitle: localize('miStickyScroll', "&&Sticky Scroll"),
154+
original: 'Toggle Sticky Scroll',
155+
},
156+
// Hardcoding due to import violation
157+
category: { value: localize('view', "View"), original: 'View' },
158+
toggled: ContextKeyExpr.equals('config.editor.experimental.stickyScroll.enabled', true),
159+
menu: [
160+
{ id: MenuId.CommandPalette },
161+
{ id: MenuId.MenubarViewMenu, group: '5_editor', order: 6 },
162+
]
163+
});
164+
}
165+
166+
override async run(accessor: ServicesAccessor): Promise<void> {
167+
const configurationService = accessor.get(IConfigurationService);
168+
const newValue = !configurationService.getValue('editor.experimental.stickyScroll.enabled');
169+
return configurationService.updateValue('editor.experimental.stickyScroll.enabled', newValue);
170+
}
171+
});
172+

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

Lines changed: 0 additions & 173 deletions
This file was deleted.

src/vs/editor/editor.all.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import 'vs/editor/contrib/links/browser/links';
4141
import 'vs/editor/contrib/multicursor/browser/multicursor';
4242
import 'vs/editor/contrib/parameterHints/browser/parameterHints';
4343
import 'vs/editor/contrib/rename/browser/rename';
44-
import 'vs/editor/contrib/stickyScroll/browser/stickyScrollController';
44+
import 'vs/editor/contrib/stickyScroll/browser/stickyScroll';
4545
import 'vs/editor/contrib/smartSelect/browser/smartSelect';
4646
import 'vs/editor/contrib/snippet/browser/snippetController2';
4747
import 'vs/editor/contrib/suggest/browser/suggestController';

0 commit comments

Comments
 (0)