Skip to content

Fix extract local function crash#49184

Merged
allisonchou merged 4 commits intodotnet:masterfrom
allisonchou:ExtractMethodCrash
Nov 5, 2020
Merged

Fix extract local function crash#49184
allisonchou merged 4 commits intodotnet:masterfrom
allisonchou:ExtractMethodCrash

Conversation

@allisonchou
Copy link
Contributor

@allisonchou allisonchou commented Nov 4, 2020

Fixes #45422.

Extract local function always introduces a call to the newly extracted function. There are some cases when introducing this call is impossible (e.g. when the selection is solely a local function), and trying to extract these selections currently results in a crash. We should not offer extract local function in this case.

@allisonchou allisonchou requested a review from a team as a code owner November 4, 2020 21:43
@allisonchou allisonchou marked this pull request as draft November 4, 2020 21:57
@allisonchou
Copy link
Contributor Author

allisonchou commented Nov 4, 2020

Whoops hold on, noticed something weird with the fix - will re-open when ready.
edit: This should now be ready to review!

@allisonchou allisonchou closed this Nov 4, 2020
@runfoapp runfoapp bot mentioned this pull request Nov 4, 2020
@allisonchou allisonchou changed the title Fix extract method crash Fix extract local function crash Nov 4, 2020
@allisonchou allisonchou reopened this Nov 4, 2020
@allisonchou allisonchou marked this pull request as ready for review November 4, 2020 23:50
Copy link
Member

@davidwengier davidwengier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A general question: Does this still generate the local function, and just show the message as information, or is this more of an error that says "We can't do anything: " ?

@allisonchou allisonchou merged commit e1afb15 into dotnet:master Nov 5, 2020
@ghost ghost added this to the Next milestone Nov 5, 2020
@allisonchou allisonchou deleted the ExtractMethodCrash branch November 5, 2020 19:41
@allisonchou allisonchou modified the milestones: Next, 16.9.P2 Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Editor: crashed in ExtractMethod

3 participants