@@ -478,59 +478,58 @@ function createInterface(msg: p.RequestMessage): m.Message {
478478 } ;
479479
480480 return response ;
481- } else {
482- let cmiPartialPath = utils . replaceFileExtension (
483- filePath . split ( projDir ) [ 1 ] ,
484- c . cmiExt
485- ) ;
486- let cmiPath = path . join (
487- projDir ,
488- c . compilerDirPartialPath ,
489- cmiPartialPath
490- ) ;
491- let cmiAvailable = fs . existsSync ( cmiPath ) ;
481+ } ;
492482
493- if ( ! cmiAvailable ) {
494- let params : p . ShowMessageParams = {
495- type : p . MessageType . Error ,
496- message : `No compiled interface file found. Please compile your project first.` ,
497- } ;
483+ let cmiPartialPath = utils . replaceFileExtension (
484+ filePath . split ( projDir ) [ 1 ] ,
485+ c . cmiExt
486+ ) ;
487+ let cmiPath = path . join (
488+ projDir ,
489+ c . compilerDirPartialPath ,
490+ cmiPartialPath
491+ ) ;
492+ let cmiAvailable = fs . existsSync ( cmiPath ) ;
498493
499- let response : m . NotificationMessage = {
500- jsonrpc : c . jsonrpcVersion ,
501- method : "window/showMessage" ,
502- params ,
503- } ;
494+ if ( ! cmiAvailable ) {
495+ let params : p . ShowMessageParams = {
496+ type : p . MessageType . Error ,
497+ message : `No compiled interface file found. Please compile your project first.` ,
498+ } ;
504499
505- return response ;
506- } else {
507- let intfResult = utils . createInterfaceFileUsingValidBscExePath (
508- filePath ,
509- cmiPath ,
510- bscNativePath
511- ) ;
500+ let response : m . NotificationMessage = {
501+ jsonrpc : c . jsonrpcVersion ,
502+ method : "window/showMessage" ,
503+ params,
504+ } ;
512505
513- if ( intfResult . kind === "success" ) {
514- let response : m . ResponseMessage = {
515- jsonrpc : c . jsonrpcVersion ,
516- id : msg . id ,
517- result : intfResult . result ,
518- } ;
506+ return response ;
507+ } ;
508+ let intfResult = utils . createInterfaceFileUsingValidBscExePath (
509+ filePath ,
510+ cmiPath ,
511+ bscNativePath
512+ ) ;
519513
520- return response ;
521- } else {
522- let response : m . ResponseMessage = {
523- jsonrpc : c . jsonrpcVersion ,
524- id : msg . id ,
525- error : {
526- code : m . ErrorCodes . InternalError ,
527- message : "Unable to create interface file." ,
528- } ,
529- } ;
514+ if ( intfResult . kind === "success" ) {
515+ let response : m . ResponseMessage = {
516+ jsonrpc : c . jsonrpcVersion ,
517+ id : msg . id ,
518+ result : intfResult . result ,
519+ } ;
530520
531- return response ;
532- }
533- }
521+ return response ;
522+ } else {
523+ let response : m . ResponseMessage = {
524+ jsonrpc : c . jsonrpcVersion ,
525+ id : msg . id ,
526+ error : {
527+ code : m . ErrorCodes . InternalError ,
528+ message : "Unable to create interface file." ,
529+ } ,
530+ } ;
531+
532+ return response ;
534533 }
535534}
536535
0 commit comments