We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 51c2f7f commit e13720eCopy full SHA for e13720e
src/CodeFormatManager.ts
@@ -45,11 +45,10 @@ export default class CodeFormatManager {
45
// Make sure we halt everything when the editor gets destroyed.
46
const edits = await this._formatCodeInTextEditor(editor)
47
try {
48
- applyTextEditsToBuffer(editor.getBuffer(), edits).forEach((result) => {
49
- if (!result) {
50
- throw new Error("No code formatting providers found!")
51
- }
52
- })
+ const success = applyTextEditsToBuffer(editor.getBuffer(), edits) as boolean
+ if (!success) {
+ throw new Error("No code formatting providers found!")
+ }
53
} catch (err) {
54
atom.notifications.addError(`Failed to format code: ${err.message}`, {
55
detail: err.detail,
0 commit comments