This repository was archived by the owner on Jan 10, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-18
lines changed Expand file tree Collapse file tree 2 files changed +6
-18
lines changed Original file line number Diff line number Diff line change 22 "name" : " vs-script-commands" ,
33 "displayName" : " Script Commands" ,
44 "description" : " Adds additional commands to Visual Studio Code that uses scripts (JavaScript) for execution." ,
5- "version" : " 2.0.1 " ,
5+ "version" : " 2.1.0 " ,
66 "publisher" : " mkloubert" ,
77 "engines" : {
88 "vscode" : " ^1.5.0"
Original file line number Diff line number Diff line change @@ -868,23 +868,11 @@ export class ScriptCommandController extends Events.EventEmitter implements vsco
868868 } ) ;
869869
870870 let result = cmdModule . execute ( args ) ;
871- if ( 'object' === typeof result ) {
872- if ( 'function' === typeof result [ 'then' ] ) {
873- // seems to be a promise
874-
875- result . then ( ( r ) => {
876- completed ( null , r ) ;
877- } , ( err ) => {
878- completed ( err ) ;
879- } ) ;
880- }
881- else {
882- completed ( null , result ) ; // DOES NOT seem to be a promise
883- }
884- }
885- else {
886- completed ( null , result ) ; // no object
887- }
871+ Promise . resolve ( result ) . then ( ( r ) => {
872+ completed ( null , r ) ;
873+ } ) . catch ( ( err ) => {
874+ completed ( err ) ;
875+ } ) ;
888876 }
889877 else {
890878 completed ( null ) ; // no execute() function found
You can’t perform that action at this time.
0 commit comments