Support DI in UnicodeService
This commit is contained in:
@@ -109,6 +109,7 @@ export class MockOptionsService implements IOptionsService {
|
||||
|
||||
// defaults to V6 always to keep tests passing
|
||||
export class MockUnicodeService implements IUnicodeService {
|
||||
public serviceBrand: any;
|
||||
private _provider = new UnicodeV6();
|
||||
public register(provider: IUnicodeVersionProvider): void {
|
||||
throw new Error('Method not implemented.');
|
||||
|
||||
@@ -311,6 +311,7 @@ export interface ITheme {
|
||||
|
||||
export const IUnicodeService = createDecorator<IUnicodeService>('UnicodeService');
|
||||
export interface IUnicodeService {
|
||||
serviceBrand: any;
|
||||
/** Register an Unicode version provider. */
|
||||
register(provider: IUnicodeVersionProvider): void;
|
||||
/** Registered Unicode versions. */
|
||||
|
||||
@@ -8,6 +8,8 @@ import { UnicodeV6 } from 'common/input/UnicodeV6';
|
||||
|
||||
|
||||
export class UnicodeService implements IUnicodeService {
|
||||
public serviceBrand: any;
|
||||
|
||||
private _providers: {[key: string]: IUnicodeVersionProvider} = Object.create(null);
|
||||
private _active: string = '';
|
||||
private _activeProvider: IUnicodeVersionProvider;
|
||||
|
||||
Reference in New Issue
Block a user