44 *--------------------------------------------------------------------------------------------*/
55
66import { IDisposable } from 'vs/base/common/lifecycle' ;
7- import { TPromise } from 'vs/base/common/winjs.base' ;
87import { ITextModel } from 'vs/editor/common/model' ;
98import { ColorId , MetadataConsts , FontStyle , TokenizationRegistry , ITokenizationSupport } from 'vs/editor/common/modes' ;
109import { IModeService } from 'vs/editor/common/services/modeService' ;
@@ -26,7 +25,7 @@ export interface IColorizerElementOptions extends IColorizerOptions {
2625
2726export class Colorizer {
2827
29- public static colorizeElement ( themeService : IStandaloneThemeService , modeService : IModeService , domNode : HTMLElement , options : IColorizerElementOptions ) : TPromise < void > {
28+ public static colorizeElement ( themeService : IStandaloneThemeService , modeService : IModeService , domNode : HTMLElement , options : IColorizerElementOptions ) : Promise < void > {
3029 options = options || { } ;
3130 let theme = options . theme || 'vs' ;
3231 let mimeType = options . mimeType || domNode . getAttribute ( 'lang' ) || domNode . getAttribute ( 'data-lang' ) ;
@@ -45,7 +44,7 @@ export class Colorizer {
4544 return this . colorize ( modeService , text , mimeType , options ) . then ( render , ( err ) => console . error ( err ) ) ;
4645 }
4746
48- public static colorize ( modeService : IModeService , text : string , mimeType : string , options : IColorizerOptions ) : TPromise < string > {
47+ public static colorize ( modeService : IModeService , text : string , mimeType : string , options : IColorizerOptions ) : Promise < string > {
4948 if ( strings . startsWithUTF8BOM ( text ) ) {
5049 text = text . substr ( 1 ) ;
5150 }
@@ -62,10 +61,10 @@ export class Colorizer {
6261
6362 let tokenizationSupport = TokenizationRegistry . get ( language ) ;
6463 if ( tokenizationSupport ) {
65- return TPromise . as ( _colorize ( lines , options . tabSize , tokenizationSupport ) ) ;
64+ return Promise . resolve ( _colorize ( lines , options . tabSize , tokenizationSupport ) ) ;
6665 }
6766
68- return new TPromise < string > ( ( resolve , reject ) => {
67+ return new Promise < string > ( ( resolve , reject ) => {
6968 let listener : IDisposable = null ;
7069 let timeout : TimeoutTimer = null ;
7170
0 commit comments