|
5 | 5 |
|
6 | 6 | import { Disposable, DisposableStore } from 'vs/base/common/lifecycle';
|
7 | 7 | import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
|
8 |
| -import { registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; |
9 | 8 | import { IEditorContribution } from 'vs/editor/common/editorCommon';
|
10 | 9 | import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';
|
11 | 10 | import { EditorOption, RenderLineNumbersType } from 'vs/editor/common/config/editorOptions';
|
12 | 11 | import { StickyScrollWidget, StickyScrollWidgetState } from './stickyScrollWidget';
|
13 | 12 | import { StickyLineCandidateProvider, StickyRange } from './stickyScrollProvider';
|
14 | 13 | 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'; |
19 | 14 |
|
20 |
| -class StickyScrollController extends Disposable implements IEditorContribution { |
| 15 | + |
| 16 | +export class StickyScrollController extends Disposable implements IEditorContribution { |
21 | 17 |
|
22 | 18 | static readonly ID = 'store.contrib.stickyScrollController';
|
23 | 19 | private readonly editor: ICodeEditor;
|
@@ -140,33 +136,3 @@ class StickyScrollController extends Disposable implements IEditorContribution {
|
140 | 136 | this.sessionStore.dispose();
|
141 | 137 | }
|
142 | 138 | }
|
143 |
| - |
144 |
| -registerEditorContribution(StickyScrollController.ID, StickyScrollController); |
145 |
| - |
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 |
| - |
0 commit comments