From 86757168027f08bc397c3f60583b829b3a344f6a Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Wed, 8 Nov 2017 15:47:59 +0100 Subject: [PATCH] Remove usages of @commonEditorContribution (#37212) --- .../editor/common/editorCommonExtensions.ts | 2 +- .../bracketMatching/common/bracketMatching.ts | 4 +- .../contrib/format/browser/formatActions.ts | 8 ++- .../inPlaceReplace/common/inPlaceReplace.ts | 4 +- .../contrib/indentation/common/indentation.ts | 4 +- .../contrib/message/messageController.ts | 5 +- .../contrib/multicursor/common/multicursor.ts | 7 +-- .../browser/referenceSearch.ts | 5 +- .../contrib/smartSelect/common/smartSelect.ts | 4 +- .../snippet/browser/snippetController2.ts | 5 +- .../wordHighlighter/common/wordHighlighter.ts | 51 +++++++++---------- .../electron-browser/toggleWordWrap.ts | 7 +-- .../electron-browser/tabCompletion.ts | 5 +- 13 files changed, 57 insertions(+), 54 deletions(-) diff --git a/src/vs/editor/common/editorCommonExtensions.ts b/src/vs/editor/common/editorCommonExtensions.ts index e5998dd3075..f2f5747fdc7 100644 --- a/src/vs/editor/common/editorCommonExtensions.ts +++ b/src/vs/editor/common/editorCommonExtensions.ts @@ -225,7 +225,7 @@ export function registerEditorCommand(editorCommand: T) return editorCommand; } -export function commonEditorContribution(ctor: ICommonEditorContributionCtor): void { +export function registerCommonEditorContribution(ctor: ICommonEditorContributionCtor): void { EditorContributionRegistry.INSTANCE.registerEditorContribution(ctor); } diff --git a/src/vs/editor/contrib/bracketMatching/common/bracketMatching.ts b/src/vs/editor/contrib/bracketMatching/common/bracketMatching.ts index 34be978afce..e737f7dfbc5 100644 --- a/src/vs/editor/contrib/bracketMatching/common/bracketMatching.ts +++ b/src/vs/editor/contrib/bracketMatching/common/bracketMatching.ts @@ -13,7 +13,7 @@ import { Position } from 'vs/editor/common/core/position'; import { Selection } from 'vs/editor/common/core/selection'; import { RunOnceScheduler } from 'vs/base/common/async'; import * as editorCommon from 'vs/editor/common/editorCommon'; -import { registerEditorAction, commonEditorContribution, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions'; +import { registerEditorAction, registerCommonEditorContribution, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { editorBracketMatchBackground, editorBracketMatchBorder } from 'vs/editor/common/view/editorColorRegistry'; @@ -54,7 +54,6 @@ class BracketsData { } } -@commonEditorContribution export class BracketMatchingController extends Disposable implements editorCommon.IEditorContribution { private static ID = 'editor.contrib.bracketMatchingController'; @@ -225,6 +224,7 @@ export class BracketMatchingController extends Disposable implements editorCommo } } +registerCommonEditorContribution(BracketMatchingController); registerEditorAction(new SelectBracketAction()); registerThemingParticipant((theme, collector) => { let bracketMatchBackground = theme.getColor(editorBracketMatchBackground); diff --git a/src/vs/editor/contrib/format/browser/formatActions.ts b/src/vs/editor/contrib/format/browser/formatActions.ts index d57ff56e9e6..554ee50458f 100644 --- a/src/vs/editor/contrib/format/browser/formatActions.ts +++ b/src/vs/editor/contrib/format/browser/formatActions.ts @@ -11,7 +11,7 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { TPromise } from 'vs/base/common/winjs.base'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { registerEditorAction, ServicesAccessor, EditorAction, commonEditorContribution, IActionOptions } from 'vs/editor/common/editorCommonExtensions'; +import { registerEditorAction, ServicesAccessor, EditorAction, registerCommonEditorContribution, IActionOptions } from 'vs/editor/common/editorCommonExtensions'; import { OnTypeFormattingEditProviderRegistry, DocumentRangeFormattingEditProviderRegistry } from 'vs/editor/common/modes'; import { getOnTypeFormattingEdits, getDocumentFormattingEdits, getDocumentRangeFormattingEdits, NoProviderError } from '../common/format'; import { EditOperationsCommand } from '../common/formatCommand'; @@ -53,8 +53,6 @@ function alertFormattingEdits(edits: editorCommon.ISingleEditOperation[]): void } } -@commonEditorContribution -// @ts-ignore @editorAction uses the class class FormatOnType implements editorCommon.IEditorContribution { private static ID = 'editor.contrib.autoFormat'; @@ -180,8 +178,6 @@ class FormatOnType implements editorCommon.IEditorContribution { } } -@commonEditorContribution -// @ts-ignore @editorAction uses the class class FormatOnPaste implements editorCommon.IEditorContribution { private static ID = 'editor.contrib.formatOnPaste'; @@ -356,6 +352,8 @@ export class FormatSelectionAction extends AbstractFormatAction { } } +registerCommonEditorContribution(FormatOnType); +registerCommonEditorContribution(FormatOnPaste); registerEditorAction(new FormatDocumentAction()); registerEditorAction(new FormatSelectionAction()); diff --git a/src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.ts b/src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.ts index 9190997ea23..437c5e390a9 100644 --- a/src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.ts +++ b/src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.ts @@ -11,7 +11,7 @@ import { Range } from 'vs/editor/common/core/range'; import { Selection } from 'vs/editor/common/core/selection'; import { IEditorContribution, ICommonCodeEditor, IModelDecorationsChangeAccessor } from 'vs/editor/common/editorCommon'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { registerEditorAction, ServicesAccessor, EditorAction, commonEditorContribution } from 'vs/editor/common/editorCommonExtensions'; +import { registerEditorAction, ServicesAccessor, EditorAction, registerCommonEditorContribution } from 'vs/editor/common/editorCommonExtensions'; import { IInplaceReplaceSupportResult } from 'vs/editor/common/modes'; import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService'; import { InPlaceReplaceCommand } from './inPlaceReplaceCommand'; @@ -20,7 +20,6 @@ import { registerThemingParticipant } from 'vs/platform/theme/common/themeServic import { editorBracketMatchBorder } from 'vs/editor/common/view/editorColorRegistry'; import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; -@commonEditorContribution class InPlaceReplaceController implements IEditorContribution { private static ID = 'editor.contrib.inPlaceReplaceController'; @@ -186,6 +185,7 @@ class InPlaceReplaceDown extends EditorAction { } } +registerCommonEditorContribution(InPlaceReplaceController); registerEditorAction(new InPlaceReplaceUp()); registerEditorAction(new InPlaceReplaceDown()); diff --git a/src/vs/editor/contrib/indentation/common/indentation.ts b/src/vs/editor/contrib/indentation/common/indentation.ts index 8dcddf9fbed..0bdd5ba8329 100644 --- a/src/vs/editor/contrib/indentation/common/indentation.ts +++ b/src/vs/editor/contrib/indentation/common/indentation.ts @@ -9,7 +9,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import * as strings from 'vs/base/common/strings'; import { ICommonCodeEditor, IEditorContribution, IIdentifiedSingleEditOperation, ICommand, ICursorStateComputerData, IEditOperationBuilder, ITokenizedModel, EndOfLineSequence } from 'vs/editor/common/editorCommon'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { registerEditorAction, ServicesAccessor, IActionOptions, EditorAction, commonEditorContribution } from 'vs/editor/common/editorCommonExtensions'; +import { registerEditorAction, ServicesAccessor, IActionOptions, EditorAction, registerCommonEditorContribution } from 'vs/editor/common/editorCommonExtensions'; import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen'; import { IModelService } from 'vs/editor/common/services/modelService'; import { Range } from 'vs/editor/common/core/range'; @@ -376,7 +376,6 @@ export class AutoIndentOnPasteCommand implements ICommand { } } -@commonEditorContribution export class AutoIndentOnPaste implements IEditorContribution { private static ID = 'editor.contrib.autoIndentOnPaste'; @@ -616,6 +615,7 @@ export class IndentationToTabsCommand implements ICommand { } } +registerCommonEditorContribution(AutoIndentOnPaste); registerEditorAction(new IndentationToSpacesAction()); registerEditorAction(new IndentationToTabsAction()); registerEditorAction(new IndentUsingTabs()); diff --git a/src/vs/editor/contrib/message/messageController.ts b/src/vs/editor/contrib/message/messageController.ts index ce5d45af58c..8123cda7b98 100644 --- a/src/vs/editor/contrib/message/messageController.ts +++ b/src/vs/editor/contrib/message/messageController.ts @@ -12,14 +12,13 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { alert } from 'vs/base/browser/ui/aria/aria'; import { Range } from 'vs/editor/common/core/range'; import * as editorCommon from 'vs/editor/common/editorCommon'; -import { commonEditorContribution, CommonEditorRegistry, EditorCommand } from 'vs/editor/common/editorCommonExtensions'; +import { registerCommonEditorContribution, CommonEditorRegistry, EditorCommand } from 'vs/editor/common/editorCommonExtensions'; import { ICodeEditor, IContentWidget, IContentWidgetPosition, ContentWidgetPositionPreference } from 'vs/editor/browser/editorBrowser'; import { IContextKeyService, RawContextKey, IContextKey } from 'vs/platform/contextkey/common/contextkey'; import { IPosition } from 'vs/editor/common/core/position'; import { registerThemingParticipant, HIGH_CONTRAST } from 'vs/platform/theme/common/themeService'; import { inputValidationInfoBorder, inputValidationInfoBackground } from 'vs/platform/theme/common/colorRegistry'; -@commonEditorContribution export class MessageController { private static _id = 'editor.contrib.messageController'; @@ -174,6 +173,8 @@ class MessageWidget implements IContentWidget { } } +registerCommonEditorContribution(MessageController); + registerThemingParticipant((theme, collector) => { let border = theme.getColor(inputValidationInfoBorder); if (border) { diff --git a/src/vs/editor/contrib/multicursor/common/multicursor.ts b/src/vs/editor/contrib/multicursor/common/multicursor.ts index dd3eba54ce6..b5cd72fc91a 100644 --- a/src/vs/editor/contrib/multicursor/common/multicursor.ts +++ b/src/vs/editor/contrib/multicursor/common/multicursor.ts @@ -10,7 +10,7 @@ import { KeyCode, KeyMod, KeyChord } from 'vs/base/common/keyCodes'; import { RunOnceScheduler } from 'vs/base/common/async'; import { ICommonCodeEditor, ScrollType, IEditorContribution, FindMatch, TrackedRangeStickiness, OverviewRulerLane, IModel } from 'vs/editor/common/editorCommon'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { registerEditorAction, commonEditorContribution, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions'; +import { registerEditorAction, registerCommonEditorContribution, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions'; import { Range } from 'vs/editor/common/core/range'; import { Selection } from 'vs/editor/common/core/selection'; import { CursorChangeReason, ICursorSelectionChangedEvent } from 'vs/editor/common/controller/cursorEvents'; @@ -300,7 +300,6 @@ export class MultiCursorSession { } } -@commonEditorContribution export class MultiCursorSelectionController extends Disposable implements IEditorContribution { private static ID = 'editor.contrib.multiCursorController'; @@ -653,7 +652,6 @@ class SelectionHighlighterState { } } -@commonEditorContribution export class SelectionHighlighter extends Disposable implements IEditorContribution { private static ID = 'editor.contrib.selectionHighlighter'; @@ -902,6 +900,9 @@ function getValueInRange(model: IModel, range: Range, toLowerCase: boolean): str return (toLowerCase ? text.toLowerCase() : text); } +registerCommonEditorContribution(MultiCursorSelectionController); +registerCommonEditorContribution(SelectionHighlighter); + registerEditorAction(new InsertCursorAbove()); registerEditorAction(new InsertCursorBelow()); registerEditorAction(new InsertCursorAtEndOfEachLineSelected()); diff --git a/src/vs/editor/contrib/referenceSearch/browser/referenceSearch.ts b/src/vs/editor/contrib/referenceSearch/browser/referenceSearch.ts index 3ba8f2834b7..a8b14acb243 100644 --- a/src/vs/editor/contrib/referenceSearch/browser/referenceSearch.ts +++ b/src/vs/editor/contrib/referenceSearch/browser/referenceSearch.ts @@ -15,7 +15,7 @@ import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRe import { Position, IPosition } from 'vs/editor/common/core/position'; import { Range } from 'vs/editor/common/core/range'; import * as editorCommon from 'vs/editor/common/editorCommon'; -import { registerEditorAction, ServicesAccessor, EditorAction, CommonEditorRegistry, commonEditorContribution } from 'vs/editor/common/editorCommonExtensions'; +import { registerEditorAction, ServicesAccessor, EditorAction, CommonEditorRegistry, registerCommonEditorContribution } from 'vs/editor/common/editorCommonExtensions'; import { Location, ReferenceProviderRegistry } from 'vs/editor/common/modes'; import { PeekContext, getOuterEditor } from './peekViewWidget'; import { ReferencesController, RequestOptions, ctxReferenceSearchVisible } from './referencesController'; @@ -31,7 +31,6 @@ const defaultReferenceSearchOptions: RequestOptions = { } }; -@commonEditorContribution export class ReferenceController implements editorCommon.IEditorContribution { private static ID = 'editor.contrib.referenceController'; @@ -87,6 +86,8 @@ export class ReferenceAction extends EditorAction { } } +registerCommonEditorContribution(ReferenceController); + registerEditorAction(new ReferenceAction()); let findReferencesCommand: ICommandHandler = (accessor: ServicesAccessor, resource: URI, position: IPosition) => { diff --git a/src/vs/editor/contrib/smartSelect/common/smartSelect.ts b/src/vs/editor/contrib/smartSelect/common/smartSelect.ts index d0c37e9a32b..ed1c24e8c96 100644 --- a/src/vs/editor/contrib/smartSelect/common/smartSelect.ts +++ b/src/vs/editor/contrib/smartSelect/common/smartSelect.ts @@ -12,7 +12,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { Range } from 'vs/editor/common/core/range'; import { ICommonCodeEditor, IEditorContribution } from 'vs/editor/common/editorCommon'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { registerEditorAction, ServicesAccessor, IActionOptions, EditorAction, commonEditorContribution } from 'vs/editor/common/editorCommonExtensions'; +import { registerEditorAction, ServicesAccessor, IActionOptions, EditorAction, registerCommonEditorContribution } from 'vs/editor/common/editorCommonExtensions'; import { TokenSelectionSupport, ILogicalSelectionEntry } from './tokenSelectionSupport'; import { ICursorPositionChangedEvent } from 'vs/editor/common/controller/cursorEvents'; @@ -39,7 +39,6 @@ var ignoreSelection = false; // -- action implementation -@commonEditorContribution class SmartSelectController implements IEditorContribution { private static ID = 'editor.contrib.smartSelectController'; @@ -195,5 +194,6 @@ class ShrinkSelectionAction extends AbstractSmartSelect { } } +registerCommonEditorContribution(SmartSelectController); registerEditorAction(new GrowSelectionAction()); registerEditorAction(new ShrinkSelectionAction()); diff --git a/src/vs/editor/contrib/snippet/browser/snippetController2.ts b/src/vs/editor/contrib/snippet/browser/snippetController2.ts index 8a3c149379b..5c36d20df8d 100644 --- a/src/vs/editor/contrib/snippet/browser/snippetController2.ts +++ b/src/vs/editor/contrib/snippet/browser/snippetController2.ts @@ -7,7 +7,7 @@ import { RawContextKey, IContextKey, IContextKeyService, ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { ICommonCodeEditor } from 'vs/editor/common/editorCommon'; -import { commonEditorContribution, CommonEditorRegistry, EditorCommand } from 'vs/editor/common/editorCommonExtensions'; +import { registerCommonEditorContribution, CommonEditorRegistry, EditorCommand } from 'vs/editor/common/editorCommonExtensions'; import { dispose, IDisposable } from 'vs/base/common/lifecycle'; import { SnippetSession } from './snippetSession'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; @@ -18,7 +18,6 @@ import { Selection } from 'vs/editor/common/core/selection'; import { Choice } from 'vs/editor/contrib/snippet/browser/snippetParser'; import { repeat } from 'vs/base/common/strings'; -@commonEditorContribution export class SnippetController2 { static get(editor: ICommonCodeEditor): SnippetController2 { @@ -183,6 +182,8 @@ export class SnippetController2 { } +registerCommonEditorContribution(SnippetController2); + const CommandCtor = EditorCommand.bindToContribution(SnippetController2.get); CommonEditorRegistry.registerEditorCommand(new CommandCtor({ diff --git a/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.ts b/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.ts index 9d0fb6f88c6..51d508a4afe 100644 --- a/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.ts +++ b/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.ts @@ -11,7 +11,7 @@ import { onUnexpectedExternalError } from 'vs/base/common/errors'; import { TPromise } from 'vs/base/common/winjs.base'; import { Range } from 'vs/editor/common/core/range'; import * as editorCommon from 'vs/editor/common/editorCommon'; -import { CommonEditorRegistry, commonEditorContribution, EditorAction, IActionOptions, registerEditorAction } from 'vs/editor/common/editorCommonExtensions'; +import { CommonEditorRegistry, registerCommonEditorContribution, EditorAction, IActionOptions, registerEditorAction } from 'vs/editor/common/editorCommonExtensions'; import { DocumentHighlight, DocumentHighlightKind, DocumentHighlightProviderRegistry } from 'vs/editor/common/modes'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { Position } from 'vs/editor/common/core/position'; @@ -397,9 +397,6 @@ class WordHighlighter { } } - - -@commonEditorContribution class WordHighlighterContribution implements editorCommon.IEditorContribution { private static ID = 'editor.contrib.wordHighlighter'; @@ -444,28 +441,6 @@ class WordHighlighterContribution implements editorCommon.IEditorContribution { } } -registerThemingParticipant((theme, collector) => { - let selectionHighlight = theme.getColor(editorSelectionHighlight); - if (selectionHighlight) { - collector.addRule(`.monaco-editor .focused .selectionHighlight { background-color: ${selectionHighlight}; }`); - collector.addRule(`.monaco-editor .selectionHighlight { background-color: ${selectionHighlight.transparent(0.5)}; }`); - } - let wordHighlight = theme.getColor(editorWordHighlight); - if (wordHighlight) { - collector.addRule(`.monaco-editor .wordHighlight { background-color: ${wordHighlight}; }`); - } - let wordHighlightStrong = theme.getColor(editorWordHighlightStrong); - if (wordHighlightStrong) { - collector.addRule(`.monaco-editor .wordHighlightStrong { background-color: ${wordHighlightStrong}; }`); - } - let hcOutline = theme.getColor(activeContrastBorder); - if (hcOutline) { - collector.addRule(`.monaco-editor .selectionHighlight { border: 1px dotted ${hcOutline}; box-sizing: border-box; }`); - collector.addRule(`.monaco-editor .wordHighlight { border: 1px dashed ${hcOutline}; box-sizing: border-box; }`); - collector.addRule(`.monaco-editor .wordHighlightStrong { border: 1px dashed ${hcOutline}; box-sizing: border-box; }`); - } - -}); class WordHighlightNavigationAction extends EditorAction { @@ -520,5 +495,29 @@ class PrevWordHighlightAction extends WordHighlightNavigationAction { } } +registerCommonEditorContribution(WordHighlighterContribution); registerEditorAction(new NextWordHighlightAction()); registerEditorAction(new PrevWordHighlightAction()); + +registerThemingParticipant((theme, collector) => { + let selectionHighlight = theme.getColor(editorSelectionHighlight); + if (selectionHighlight) { + collector.addRule(`.monaco-editor .focused .selectionHighlight { background-color: ${selectionHighlight}; }`); + collector.addRule(`.monaco-editor .selectionHighlight { background-color: ${selectionHighlight.transparent(0.5)}; }`); + } + let wordHighlight = theme.getColor(editorWordHighlight); + if (wordHighlight) { + collector.addRule(`.monaco-editor .wordHighlight { background-color: ${wordHighlight}; }`); + } + let wordHighlightStrong = theme.getColor(editorWordHighlightStrong); + if (wordHighlightStrong) { + collector.addRule(`.monaco-editor .wordHighlightStrong { background-color: ${wordHighlightStrong}; }`); + } + let hcOutline = theme.getColor(activeContrastBorder); + if (hcOutline) { + collector.addRule(`.monaco-editor .selectionHighlight { border: 1px dotted ${hcOutline}; box-sizing: border-box; }`); + collector.addRule(`.monaco-editor .wordHighlight { border: 1px dashed ${hcOutline}; box-sizing: border-box; }`); + collector.addRule(`.monaco-editor .wordHighlightStrong { border: 1px dashed ${hcOutline}; box-sizing: border-box; }`); + } + +}); diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts b/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts index 20330a57341..b56581a8b9e 100644 --- a/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts +++ b/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts @@ -8,7 +8,7 @@ import 'vs/css!./media/codeEditor'; import * as nls from 'vs/nls'; import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; import { ICommonCodeEditor, IEditorContribution, IModel } from 'vs/editor/common/editorCommon'; -import { registerEditorAction, ServicesAccessor, EditorAction, commonEditorContribution } from 'vs/editor/common/editorCommonExtensions'; +import { registerEditorAction, ServicesAccessor, EditorAction, registerCommonEditorContribution } from 'vs/editor/common/editorCommonExtensions'; import { ICodeEditorService } from 'vs/editor/common/services/codeEditorService'; import { MenuRegistry, MenuId } from 'vs/platform/actions/common/actions'; import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; @@ -173,8 +173,6 @@ class ToggleWordWrapAction extends EditorAction { } } -@commonEditorContribution -// @ts-ignore @editorAction uses the class class ToggleWordWrapController extends Disposable implements IEditorContribution { private static _ID = 'editor.contrib.toggleWordWrapController'; @@ -250,6 +248,9 @@ function canToggleWordWrap(uri: URI): boolean { return (uri.scheme !== 'output' && uri.scheme !== 'vscode'); } + +registerCommonEditorContribution(ToggleWordWrapController); + registerEditorAction(new ToggleWordWrapAction()); MenuRegistry.appendMenuItem(MenuId.EditorTitle, { diff --git a/src/vs/workbench/parts/snippets/electron-browser/tabCompletion.ts b/src/vs/workbench/parts/snippets/electron-browser/tabCompletion.ts index 620afaa6156..0c665574d30 100644 --- a/src/vs/workbench/parts/snippets/electron-browser/tabCompletion.ts +++ b/src/vs/workbench/parts/snippets/electron-browser/tabCompletion.ts @@ -16,14 +16,13 @@ import { endsWith } from 'vs/base/common/strings'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { Range } from 'vs/editor/common/core/range'; -import { CommonEditorRegistry, commonEditorContribution, EditorCommand } from 'vs/editor/common/editorCommonExtensions'; +import { CommonEditorRegistry, registerCommonEditorContribution, EditorCommand } from 'vs/editor/common/editorCommonExtensions'; import { SnippetController2 } from 'vs/editor/contrib/snippet/browser/snippetController2'; import { showSimpleSuggestions } from 'vs/editor/contrib/suggest/browser/suggest'; import { IConfigurationRegistry, Extensions as ConfigExt } from 'vs/platform/configuration/common/configurationRegistry'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -@commonEditorContribution export class TabCompletionController implements editorCommon.IEditorContribution { private static ID = 'editor.tabCompletionController'; @@ -132,6 +131,8 @@ export class TabCompletionController implements editorCommon.IEditorContribution } } +registerCommonEditorContribution(TabCompletionController); + const TabCompletionCommand = EditorCommand.bindToContribution(TabCompletionController.get); CommonEditorRegistry.registerEditorCommand(new TabCompletionCommand({ -- GitLab