@@ -51,26 +51,24 @@ export default class ApplyEditAdapter {
51
51
// Keep checkpoints from all successful buffer edits
52
52
const checkpoints : Array < { buffer : TextBuffer ; checkpoint : number } > = [ ]
53
53
54
- const promises = ( workspaceEdit . documentChanges || [ ] ) . map (
55
- async ( edit ) : Promise < void > => {
56
- if ( ! TextDocumentEdit . is ( edit ) ) {
57
- return ApplyEditAdapter . handleResourceOperation ( edit ) . catch ( ( err ) => {
58
- throw Error ( `Error during ${ edit . kind } resource operation: ${ err . message } ` )
59
- } )
60
- }
61
- const path = Convert . uriToPath ( edit . textDocument . uri )
62
- const editor = ( await atom . workspace . open ( path , {
63
- searchAllPanes : true ,
64
- // Open new editors in the background.
65
- activatePane : false ,
66
- activateItem : false ,
67
- } ) ) as TextEditor
68
- const buffer = editor . getBuffer ( )
69
- const edits = Convert . convertLsTextEdits ( edit . edits )
70
- const checkpoint = ApplyEditAdapter . applyEdits ( buffer , edits )
71
- checkpoints . push ( { buffer, checkpoint } )
54
+ const promises = ( workspaceEdit . documentChanges || [ ] ) . map ( async ( edit ) : Promise < void > => {
55
+ if ( ! TextDocumentEdit . is ( edit ) ) {
56
+ return ApplyEditAdapter . handleResourceOperation ( edit ) . catch ( ( err ) => {
57
+ throw Error ( `Error during ${ edit . kind } resource operation: ${ err . message } ` )
58
+ } )
72
59
}
73
- )
60
+ const path = Convert . uriToPath ( edit . textDocument . uri )
61
+ const editor = ( await atom . workspace . open ( path , {
62
+ searchAllPanes : true ,
63
+ // Open new editors in the background.
64
+ activatePane : false ,
65
+ activateItem : false ,
66
+ } ) ) as TextEditor
67
+ const buffer = editor . getBuffer ( )
68
+ const edits = Convert . convertLsTextEdits ( edit . edits )
69
+ const checkpoint = ApplyEditAdapter . applyEdits ( buffer , edits )
70
+ checkpoints . push ( { buffer, checkpoint } )
71
+ } )
74
72
75
73
// Apply all edits or fail and revert everything
76
74
const applied = await Promise . all ( promises )
0 commit comments