Skip to content

Offer generate variable fixer when inside a lock statement in C##27402

Merged
jinujoseph merged 2 commits intodotnet:masterfrom
davidwengier:IntroduceLocalInLock
Jun 5, 2018
Merged

Offer generate variable fixer when inside a lock statement in C##27402
jinujoseph merged 2 commits intodotnet:masterfrom
davidwengier:IntroduceLocalInLock

Conversation

@davidwengier
Copy link
Copy Markdown
Member

Show generate variable fix inside lock

Customer scenario

When typing a new identifier inside a lock statement none of the Generate Variable fixers are offered as suggestions.

Bugs this fixes

Fixes #26406

Workarounds, if any

None

Risk

Low, the fix is one more item in a switch statement, and Visual Basic already had that option. I've added tests for C# and VB to prevent regression.

Performance impact

Low, no extra allocations etc.

Is this a regression from a previous update?

I don't know

Root cause analysis

There is a large switch statement that has a whitelist of places where the generate variable refactoring is offered, and it was missing from there. There is a reasonable chance there are other things listed.

How was the bug found?

I was just browsing Help Wanted issues, guessing the original requester found it in the course of using VS.

Test documentation updated?

N/A?

@davidwengier davidwengier requested a review from a team as a code owner June 4, 2018 06:44
@jinujoseph jinujoseph added Area-IDE Community The pull request was submitted by a contributor who is not a Microsoft employee. labels Jun 4, 2018
@mavasani
Copy link
Copy Markdown
Contributor

mavasani commented Jun 4, 2018

@jinujoseph for approval

@jinujoseph
Copy link
Copy Markdown
Contributor

@davidwengier could you resolve the conflict

@davidwengier davidwengier force-pushed the IntroduceLocalInLock branch from de0081a to 27aba12 Compare June 4, 2018 23:03
@davidwengier
Copy link
Copy Markdown
Member Author

Resolved conflicts. If the tests pass again this should hopefully be good :)

@jinujoseph
Copy link
Copy Markdown
Contributor

test windows_debug_spanish_unit32_prtest

@jinujoseph jinujoseph merged commit a044d2f into dotnet:master Jun 5, 2018
@davidwengier davidwengier deleted the IntroduceLocalInLock branch June 28, 2018 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved to merge Area-IDE Community The pull request was submitted by a contributor who is not a Microsoft employee.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Don't get offered to generate a field in a lock statement

4 participants