Repository: vscode
Issue: Applying multiple valid workspace edits and then awaiting after can fail unexpectedly.
Labels: under-discussion,workspace-edit

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
### VS Code Version & OS Version:
![image](https://user-images.githubusercontent.com/2008729/117876201-f0654680-b257-11eb-8254-8deecf660f18.png)

### Bug:
Running two workspace edits in a row and then awaiting them after results in a failure to apply the second workspace edit. 

Found this when trying to utilize workspace edits via my language server and it needing to string many independent workspace edits together one after the other.

### Steps to Reproduce:

The gist:
```typescript
const edit1 = new vscode.WorkspaceEdit();
edit1.replace(textDocument.uri, new vscode.Range(new vscode.Position(0, 0), new vscode.Position(0, 0)), 'a');
const edit2 = new vscode.WorkspaceEdit();
edit2.replace(textDocument.uri, new vscode.Range(new vscode.Position(0, 1), new vscode.Position(0, 1)), 'b');

// These two edits combined will result in 'ab' on the very first line of the document that's opened
const application1 = vscode.workspace.applyEdit(edit1);
const application2 = vscode.workspace.applyEdit(edit2);
const result1 = await application1;
const result2 = await application2;

// result2 is always false
```

To see it in action:

1. Clone https://github.com/NTaylorMullen/workspaceedit-experiment.git (I just updated the minimal hello world sample)
2. Run the extension
3. Open a file that has at least 1 line and its content is at least 2 long
4. Invoke the experiment command: Ctrl + Shift + P => "Run experiment"
  ![image](https://user-images.githubusercontent.com/2008729/117874907-6f597f80-b256-11eb-9d8a-6e09812463a1.png)
5. See an information message in the bottom right corner with the result.
  ![image](https://user-images.githubusercontent.com/2008729/117874961-7c766e80-b256-11eb-9694-70768bc5bd0d.png)

Following the above steps result in `[ true, false ]` (unexpected). You can follow [these](https://github.com/NTaylorMullen/workspaceedit-experiment/blob/be8865cef96e986c3838f6fc6a400186dcf68f0f/extension.js#L23-L25) instructions to get `[ true, true ]`

<!-- 🔧 Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes

<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->

### Notes

I imagine the extension host or platform just isn't queueing the workspace edits and because of that when it gets two pending it rejects the second immediately. That being said, this is quite common for asynchronous language servers to try and apply multiple workspace edits like this via different points hence what led me to this pain point.