File tree Expand file tree Collapse file tree 1 file changed +15
-16
lines changed Expand file tree Collapse file tree 1 file changed +15
-16
lines changed Original file line number Diff line number Diff line change @@ -106,19 +106,18 @@ export let formatCode = (filePath: string, code: string): execResult => {
106
106
107
107
// Default to using the project formatter. If not, use the one we ship with
108
108
// the analysis binary in the extension itself.
109
- // if (bscNativePath != null) {
110
- // let result = childProcess.execFileSync(bscNativePath, [
111
- // "-color",
112
- // "never",
113
- // "-format",
114
- // formatTempFileFullPath,
115
- // ]);
116
- // return {
117
- // kind: "success",
118
- // result: result.toString(),
119
- // };
120
- // } else
121
- {
109
+ if ( bscNativePath != null ) {
110
+ let result = childProcess . execFileSync ( bscNativePath , [
111
+ "-color" ,
112
+ "never" ,
113
+ "-format" ,
114
+ formatTempFileFullPath ,
115
+ ] ) ;
116
+ return {
117
+ kind : "success" ,
118
+ result : result . toString ( ) ,
119
+ } ;
120
+ } else {
122
121
let result = runAnalysisAfterSanityCheck (
123
122
formatTempFileFullPath ,
124
123
[ "format" , formatTempFileFullPath ] ,
@@ -128,9 +127,9 @@ export let formatCode = (filePath: string, code: string): execResult => {
128
127
// The formatter returning an empty string means it couldn't format the
129
128
// sources, probably because of errors. In that case, we bail from
130
129
// formatting by returning the unformatted content.
131
- // if (result === "") {
132
- // result = code;
133
- // }
130
+ if ( result === "" ) {
131
+ result = code ;
132
+ }
134
133
135
134
return {
136
135
kind : "success" ,
You can’t perform that action at this time.
0 commit comments