(scrollProgram)
| 141 | // Formatting is currently defined as formatting the entire original source file |
| 142 | // using the last parser present. |
| 143 | async formatFile(scrollProgram) { |
| 144 | await scrollProgram.ensureFileLoaded() |
| 145 | const { formatted, filePath, filename, codeAtStart } = scrollProgram |
| 146 | if (codeAtStart === formatted) return |
| 147 | await this.sfs.write(filePath, formatted) |
| 148 | this.log(`💾 formatted ${filename}`) |
| 149 | } |
| 150 | |
| 151 | // A user provides a list of filenames such as 'index.scroll ../foobar.scroll' and we |
| 152 | // know the cwd, turn them into absolute file paths |
no test coverage detected