mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 02:48:30 -05:00
SQL Operations Studio Public Preview 1 (0.23) release source code
This commit is contained in:
43
src/vs/editor/browser/editorBrowserExtensions.ts
Normal file
43
src/vs/editor/browser/editorBrowserExtensions.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { IEditorContributionCtor } from 'vs/editor/browser/editorBrowser';
|
||||
|
||||
export function editorContribution(ctor: IEditorContributionCtor): void {
|
||||
EditorContributionRegistry.INSTANCE.registerEditorBrowserContribution(ctor);
|
||||
}
|
||||
|
||||
export namespace EditorBrowserRegistry {
|
||||
export function getEditorContributions(): IEditorContributionCtor[] {
|
||||
return EditorContributionRegistry.INSTANCE.getEditorBrowserContributions();
|
||||
}
|
||||
}
|
||||
|
||||
const Extensions = {
|
||||
EditorContributions: 'editor.contributions'
|
||||
};
|
||||
|
||||
class EditorContributionRegistry {
|
||||
|
||||
public static INSTANCE = new EditorContributionRegistry();
|
||||
|
||||
private editorContributions: IEditorContributionCtor[];
|
||||
|
||||
constructor() {
|
||||
this.editorContributions = [];
|
||||
}
|
||||
|
||||
public registerEditorBrowserContribution(ctor: IEditorContributionCtor): void {
|
||||
this.editorContributions.push(ctor);
|
||||
}
|
||||
|
||||
public getEditorBrowserContributions(): IEditorContributionCtor[] {
|
||||
return this.editorContributions.slice(0);
|
||||
}
|
||||
}
|
||||
|
||||
Registry.add(Extensions.EditorContributions, EditorContributionRegistry.INSTANCE);
|
||||
Reference in New Issue
Block a user