Fix extract function code action being triggered too early #209
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We were incorrectly running the extract method code action on the resolve request. The resolve request is just to fill in the edits, not to run the request. Instead we need to pass a command that will triggered after the code action is triggered. Most of the time, the code action was resolved when the code action was triggered, so it didn't cause any issues. But recently the Live Share extension changed it to eagerly resolve all code action when they are requested. This caused us to manually trigger the extract function every time a code action was requested, but not triggered.
Fixes #208.