@@ -13,7 +13,6 @@ import { IThemeService } from 'vs/platform/theme/common/themeService';
1313import { contrastBorder , widgetShadow } from 'vs/platform/theme/common/colorRegistry' ;
1414import { SIDE_BAR_BACKGROUND , SIDE_BAR_FOREGROUND } from 'vs/workbench/common/theme' ;
1515import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen' ;
16- import { TPromise } from 'vs/base/common/winjs.base' ;
1716import { CancellationToken } from 'vs/base/common/cancellation' ;
1817import { QuickInputList } from './quickInputList' ;
1918import { QuickInputBox } from './quickInputBox' ;
@@ -1041,8 +1040,8 @@ export class QuickInputService extends Component implements IQuickInputService {
10411040 this . updateStyles ( ) ;
10421041 }
10431042
1044- pick < T extends IQuickPickItem , O extends IPickOptions < T > > ( picks : TPromise < QuickPickInput < T > [ ] > | QuickPickInput < T > [ ] , options : O = < O > { } , token : CancellationToken = CancellationToken . None ) : TPromise < O extends { canPickMany : true } ? T [ ] : T > {
1045- return new TPromise < O extends { canPickMany : true } ? T [ ] : T > ( ( doResolve , reject ) => {
1043+ pick < T extends IQuickPickItem , O extends IPickOptions < T > > ( picks : Promise < QuickPickInput < T > [ ] > | QuickPickInput < T > [ ] , options : O = < O > { } , token : CancellationToken = CancellationToken . None ) : Promise < O extends { canPickMany : true } ? T [ ] : T > {
1044+ return new Promise < O extends { canPickMany : true } ? T [ ] : T > ( ( doResolve , reject ) => {
10461045 let resolve = ( result : any ) => {
10471046 resolve = doResolve ;
10481047 if ( options . onKeyMods ) {
@@ -1117,7 +1116,7 @@ export class QuickInputService extends Component implements IQuickInputService {
11171116 input . quickNavigate = options . quickNavigate ;
11181117 input . contextKey = options . contextKey ;
11191118 input . busy = true ;
1120- TPromise . join ( [ picks , options . activeItem ] )
1119+ Promise . all ( [ picks , options . activeItem ] )
11211120 . then ( ( [ items , _activeItem ] ) => {
11221121 activeItem = _activeItem ;
11231122 input . busy = false ;
@@ -1130,29 +1129,29 @@ export class QuickInputService extends Component implements IQuickInputService {
11301129 }
11311130 } ) ;
11321131 input . show ( ) ;
1133- TPromise . wrap ( picks ) . then ( null , err => {
1132+ Promise . resolve ( picks ) . then ( null , err => {
11341133 reject ( err ) ;
11351134 input . hide ( ) ;
11361135 } ) ;
11371136 } ) ;
11381137 }
11391138
1140- input ( options : IInputOptions = { } , token : CancellationToken = CancellationToken . None ) : TPromise < string > {
1141- return new TPromise < string > ( ( resolve , reject ) => {
1139+ input ( options : IInputOptions = { } , token : CancellationToken = CancellationToken . None ) : Promise < string > {
1140+ return new Promise < string > ( ( resolve , reject ) => {
11421141 if ( token . isCancellationRequested ) {
11431142 resolve ( undefined ) ;
11441143 return ;
11451144 }
11461145 const input = this . createInputBox ( ) ;
1147- const validateInput = options . validateInput || ( ( ) => TPromise . as ( undefined ) ) ;
1146+ const validateInput = options . validateInput || ( ( ) => < Thenable < undefined > > Promise . resolve ( undefined ) ) ;
11481147 const onDidValueChange = debounceEvent ( input . onDidChangeValue , ( last , cur ) => cur , 100 ) ;
11491148 let validationValue = options . value || '' ;
1150- let validation = TPromise . wrap ( validateInput ( validationValue ) ) ;
1149+ let validation = Promise . resolve ( validateInput ( validationValue ) ) ;
11511150 const disposables = [
11521151 input ,
11531152 onDidValueChange ( value => {
11541153 if ( value !== validationValue ) {
1155- validation = TPromise . wrap ( validateInput ( value ) ) ;
1154+ validation = Promise . resolve ( validateInput ( value ) ) ;
11561155 validationValue = value ;
11571156 }
11581157 validation . then ( result => {
@@ -1164,7 +1163,7 @@ export class QuickInputService extends Component implements IQuickInputService {
11641163 input . onDidAccept ( ( ) => {
11651164 const value = input . value ;
11661165 if ( value !== validationValue ) {
1167- validation = TPromise . wrap ( validateInput ( value ) ) ;
1166+ validation = Promise . resolve ( validateInput ( value ) ) ;
11681167 validationValue = value ;
11691168 }
11701169 validation . then ( result => {
@@ -1335,17 +1334,17 @@ export class QuickInputService extends Component implements IQuickInputService {
13351334
13361335 accept ( ) {
13371336 this . onDidAcceptEmitter . fire ( ) ;
1338- return TPromise . as ( undefined ) ;
1337+ return Promise . resolve ( undefined ) ;
13391338 }
13401339
13411340 back ( ) {
13421341 this . onDidTriggerButtonEmitter . fire ( this . backButton ) ;
1343- return TPromise . as ( undefined ) ;
1342+ return Promise . resolve ( undefined ) ;
13441343 }
13451344
13461345 cancel ( ) {
13471346 this . hide ( ) ;
1348- return TPromise . as ( undefined ) ;
1347+ return Promise . resolve ( undefined ) ;
13491348 }
13501349
13511350 layout ( dimension : dom . Dimension ) : void {
@@ -1411,8 +1410,8 @@ export class BackAction extends Action {
14111410 super ( id , label ) ;
14121411 }
14131412
1414- public run ( ) : TPromise < any > {
1413+ public run ( ) : Promise < any > {
14151414 this . quickInputService . back ( ) ;
1416- return TPromise . as ( null ) ;
1415+ return Promise . resolve ( null ) ;
14171416 }
14181417}
0 commit comments