Skip to content

Commit

Permalink
Corrected the rejection when formatting on save.
Browse files Browse the repository at this point in the history
Also removed obsolete `await`.

Signed-off-by: Akos Kitta <kittaakos@typefox.io>
  • Loading branch information
Akos Kitta authored and kittaakos committed Mar 12, 2020
1 parent a546178 commit 93ffbab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/monaco/src/browser/monaco-editor-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ export class MonacoEditorProvider {
}
const formatOnSaveTimeout = this.editorPreferences.get({ preferenceName: 'editor.formatOnSaveTimeout', overrideIdentifier }, undefined, uri)!;
await Promise.race([
new Promise(reject => setTimeout(() => reject(new Error(`Aborted format on save after ${formatOnSaveTimeout}ms`)), formatOnSaveTimeout)),
await editor.commandService.executeCommand('editor.action.formatDocument')
new Promise((_, reject) => setTimeout(() => reject(new Error(`Aborted format on save after ${formatOnSaveTimeout}ms`)), formatOnSaveTimeout)),
editor.commandService.executeCommand('editor.action.formatDocument')
]);
return [];
}
Expand Down

0 comments on commit 93ffbab

Please sign in to comment.